cannot create new Virtual Machine within a Cluster #7052

Closed
opened 2025-12-29 19:48:22 +01:00 by adam · 6 comments
Owner

Originally created by @fabricat on GitHub (Sep 30, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.3.3

Python version

3.9

Steps to Reproduce

  1. select Organization > Sites > Add
  2. set field Name = "site1"
  3. click Create
  4. select Virtualization > Cluster Types > Add
  5. set field Name = "type1"
  6. click Create
  7. select Virtualization > Clusters > Add
  8. set field Name = "cluster1"
  9. set field Type = "type1"
  10. set field Site = "site1"
  11. click Create
  12. select Virtualization > Virtual Machines > Add
  13. set field Name = "vm1"
  14. set field Cluster = "cluster1"
  15. leave the Site field empty
  16. click Create

Expected Behavior

A new VM "vm1" should be created and associated with the selected Cluster "cluster1".

Observed Behavior

The VM is not created and the following error appears:

The selected cluster (cluster1 is not assigned to this site (None).

(Note: there is also a missing closed parenthesis in the error message)

If I create the VM selecting a Cluster and also a Site, the operation is successful.
This is probably related with #5303

Originally created by @fabricat on GitHub (Sep 30, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.3.3 ### Python version 3.9 ### Steps to Reproduce 1. select Organization > **Sites** > ➕ Add 2. set field **Name** = "site1" 3. click **Create** 4. select Virtualization > **Cluster Types** > ➕ Add 5. set field **Name** = "type1" 6. click **Create** 7. select Virtualization > **Clusters** > ➕ Add 8. set field **Name** = "cluster1" 9. set field **Type** = "type1" 10. set field **Site** = "site1" 11. click **Create** 12. select Virtualization > **Virtual Machines** > ➕ Add 13. set field **Name** = "vm1" 14. set field **Cluster** = "cluster1" 15. leave the **Site** field empty 16. click **Create** ### Expected Behavior A new VM "vm1" should be created and associated with the selected Cluster "cluster1". ### Observed Behavior The VM is not created and the following error appears: > The selected cluster (cluster1 is not assigned to this site (None). (Note: there is also a missing closed parenthesis in the error message) If I create the VM selecting a Cluster and also a **Site**, the operation is successful. This is probably related with #5303
adam added the type: bugstatus: accepted labels 2025-12-29 19:48:22 +01:00
adam closed this issue 2025-12-29 19:48:22 +01:00
Author
Owner

@kkthxbye-code commented on GitHub (Sep 30, 2022):

Please change the topic title to something more descriptive. Also please revise your reproduction steps to include all replication steps, including the creation of the cluster. With the current steps it is not reproducible.

@kkthxbye-code commented on GitHub (Sep 30, 2022): Please change the topic title to something more descriptive. Also please revise your reproduction steps to include all replication steps, including the creation of the cluster. With the current steps it is not reproducible.
Author
Owner

@fabricat commented on GitHub (Sep 30, 2022):

Hi @kkthxbye-code
Sorry for the wrong title: I have now amended it, together with the reproduction steps.
I hope it is all clear now.

@fabricat commented on GitHub (Sep 30, 2022): Hi @kkthxbye-code Sorry for the wrong title: I have now amended it, together with the reproduction steps. I hope it is all clear now.
Author
Owner

@jeremystretch commented on GitHub (Oct 3, 2022):

I'm not able to reproduce the reported behavior on either v3.3.3 or v3.3.4; the virtual machine is created successfully as expected.

@jeremystretch commented on GitHub (Oct 3, 2022): I'm not able to reproduce the reported behavior on either v3.3.3 or v3.3.4; the virtual machine is created successfully as expected.
Author
Owner

@fabricat commented on GitHub (Oct 3, 2022):

Hi @jeremystretch
sorry, I missed an additional detail (which seems fundamental for bug repoduction): the Cluster must be associated with a Site.

I have now amended (and tested) the Steps to reproduce 👍

@fabricat commented on GitHub (Oct 3, 2022): Hi @jeremystretch sorry, I missed an additional detail (which seems fundamental for bug repoduction): _the Cluster must be associated with a Site_. I have now amended (and **tested**) the Steps to reproduce 👍
Author
Owner

@jeremystretch commented on GitHub (Oct 3, 2022):

This is happening because you're attempting to create a VM assigned to a cluster within a site without also assigning the VM to that site, which would be invalid. We can relax the form a bit to automatically assign the site when none is selected, but I want to be clear that the validation is working as expected.

@jeremystretch commented on GitHub (Oct 3, 2022): This is happening because you're attempting to create a VM assigned to a cluster within a site without also assigning the VM to that site, which would be invalid. We can relax the form a bit to automatically assign the site when none is selected, but I want to be clear that the validation is working as expected.
Author
Owner

@fabricat commented on GitHub (Oct 4, 2022):

Thank you.
Actually, I imagined that was probably the expected behaviour, but looking at docs and error messages I did only see that you must specify a site or a cluster.
I totally agree that when you only specify a cluster, then the site should be inherited.
For my integration/automation tool, retrieving the cluster site is an additional overhead.

@fabricat commented on GitHub (Oct 4, 2022): Thank you. Actually, I imagined that was probably the expected behaviour, but looking at docs and error messages I did only see that you must specify a site or a cluster. I totally agree that when you only specify a cluster, then the site should be inherited. For my integration/automation tool, retrieving the cluster site is an additional overhead.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7052