-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VirtualMachine without a cluster set throws exception when viewed through API #2587
Comments
Cluster assignment is mandatory. I did uncover a minor bug (#2589) with the API serializer for virtual machines wherein the cluster field is not required, but attempting to create a VM without a cluster will still correctly yield an
I can't imagine how this wouldn't happen unless you've manually altered the database schema. |
Yeah it was an old change we had added to allow for None value to be set on the cluster field. Our use-case for it was that we have an external system that integrates with netbox api to create VM:s. But our problem was that the external system could not make the decision on what vmware cluster the VM would be located to. That would be done by the internal operations team that owns the netbox instance based on other parameters that we could not make into code. So we would create the VM, either set I guess we could rollback the |
Unless the mentioned use-case scenario would change anything, and using a undefined cluster object is good enough, i guess this can be closed. |
There was a lot of discussion around clusters back in #142. IIRC we agreed that cluster assignment would be mandatory because there is no direct relationship from VirtualMachine to Site. Using a pseudo-cluster like you mention is probably the best approach for partial provisioning. |
Environment
Steps to Reproduce
Expected Behavior
API endpoint not to throw an exception
Observed Behavior
Following exception is returned to the user
Safeguards for this should be added to when netbox tries to build the ConfigContext for the VM.
Current workaround
We created a
UNDEFINED
cluster object and pointed all VM:s that do not have an cluster defined yet to avoid this issue.The text was updated successfully, but these errors were encountered: