Adding a VM when Cluster Group is None returns an error #4335

Closed
opened 2025-12-29 18:34:51 +01:00 by adam · 4 comments
Owner

Originally created by @Gelob on GitHub (Dec 7, 2020).

Environment

Python version: Python 3.6.8
NetBox version: 2.9.7

Steps to Reproduce

  1. Navigate to Virtualization > VMs > Add (virtualization/virtual-machines/add/)
  2. Fill in the required fields: Name, Cluster, & Cluster Group. Select None for Cluster Group and try to add the VM.

Expected Behavior

I expected the VM to get added without a cluster group as None is an option automatically created by Netbox

Observed Behavior

I got the error "Select a valid choice. That choice is not one of the available choices."
Screen Shot 2020-12-07 at 8 15 10 AM

Originally created by @Gelob on GitHub (Dec 7, 2020). ### Environment Python version: Python 3.6.8 NetBox version: 2.9.7 ### Steps to Reproduce 1. Navigate to Virtualization > VMs > Add (virtualization/virtual-machines/add/) 2. Fill in the required fields: Name, Cluster, & Cluster Group. Select None for Cluster Group and try to add the VM. <!-- What did you expect to happen? --> ### Expected Behavior I expected the VM to get added without a cluster group as None is an option automatically created by Netbox <!-- What happened instead? --> ### Observed Behavior I got the error "Select a valid choice. That choice is not one of the available choices." <img width="786" alt="Screen Shot 2020-12-07 at 8 15 10 AM" src="https://user-images.githubusercontent.com/422752/101361437-94d7fc80-3864-11eb-8273-e0e191d419d7.png">
adam closed this issue 2025-12-29 18:34:51 +01:00
Author
Owner

@jeremystretch commented on GitHub (Dec 7, 2020):

This is likely the same underlying issue as in #5315. If you remove "none" from the field and simply leave it blank, it should work.

@jeremystretch commented on GitHub (Dec 7, 2020): This is likely the same underlying issue as in #5315. If you remove "none" from the field and simply leave it blank, it should work.
Author
Owner

@Gelob commented on GitHub (Dec 8, 2020):

I confirmed if you remove none and leave it blank, it works.

Is this also related? If you select a cluster group, any clusters not in that group are no longer displayed in the dropdown. However if you select a cluster first, than go back to the cluster group dropdown you can select a cluster group that is outside of the cluster and still add the VM.

Screen Shot 2020-12-08 at 10 15 31 AM
Screen Shot 2020-12-08 at 10 15 51 AM
Screen Shot 2020-12-08 at 10 15 56 AM

@Gelob commented on GitHub (Dec 8, 2020): I confirmed if you remove none and leave it blank, it works. Is this also related? If you select a cluster group, any clusters not in that group are no longer displayed in the dropdown. However if you select a cluster first, than go back to the cluster group dropdown you can select a cluster group that is outside of the cluster and still add the VM. ![Screen Shot 2020-12-08 at 10 15 31 AM](https://user-images.githubusercontent.com/422752/101509444-63336400-393e-11eb-8d35-4c0a3b077f73.png) ![Screen Shot 2020-12-08 at 10 15 51 AM](https://user-images.githubusercontent.com/422752/101509442-629acd80-393e-11eb-8bc0-51e2d8c2e258.png) ![Screen Shot 2020-12-08 at 10 15 56 AM](https://user-images.githubusercontent.com/422752/101509440-62023700-393e-11eb-9da1-994ebb0631dd.png)
Author
Owner

@jeremystretch commented on GitHub (Dec 8, 2020):

However if you select a cluster first, than go back to the cluster group dropdown you can select a cluster group that is outside of the cluster and still add the VM.

Yes, that's expected, though it's not terribly intuitive. Due to the way form widgets are populated, the options for the cluster field are refreshed only when it is selected. The cluster group doesn't actually get assigned to the VM being created: the field is only used to filter the options available to the cluster field.

@jeremystretch commented on GitHub (Dec 8, 2020): > However if you select a cluster first, than go back to the cluster group dropdown you can select a cluster group that is outside of the cluster and still add the VM. Yes, that's expected, though it's not terribly intuitive. Due to the way form widgets are populated, the options for the cluster field are refreshed only when it is selected. The cluster group doesn't actually get assigned to the VM being created: the field is only used to filter the options available to the cluster field.
Author
Owner

@jeremystretch commented on GitHub (Dec 8, 2020):

Going to close this out since it's essentially the same issue as #5315.

@jeremystretch commented on GitHub (Dec 8, 2020): Going to close this out since it's essentially the same issue as #5315.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4335