Unable to add Virtual Machine to Cluster with Site assigned #9936

Closed
opened 2025-12-29 21:24:40 +01:00 by adam · 3 comments
Owner

Originally created by @rodvand on GitHub (Jul 2, 2024).

Originally assigned to: @jeremystretch on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.0.6

Python Version

3.10

Steps to Reproduce

  1. Create a site Site1
  2. Create a cluster Cluster1 and assign it to a site (Cluster type can be whatever)
  3. Create a virtual machine and assign it to Cluster1

Expected Behavior

The virtual machine to be created without issues and be assigned to Cluster1.

Observed Behavior

An error is returned: "The selected cluster (Cluster1) is not assigned to this site (None)."

I suspect this is a regression from https://github.com/netbox-community/netbox/pull/15763

Originally created by @rodvand on GitHub (Jul 2, 2024). Originally assigned to: @jeremystretch on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.0.6 ### Python Version 3.10 ### Steps to Reproduce 1. Create a site Site1 2. Create a cluster Cluster1 and assign it to a site (Cluster type can be whatever) 3. Create a virtual machine and assign it to Cluster1 ### Expected Behavior The virtual machine to be created without issues and be assigned to Cluster1. ### Observed Behavior An error is returned: "The selected cluster (Cluster1) is not assigned to this site (None)." I suspect this is a regression from https://github.com/netbox-community/netbox/pull/15763
adam added the type: bugstatus: acceptedseverity: medium labels 2025-12-29 21:24:40 +01:00
adam closed this issue 2025-12-29 21:24:40 +01:00
Author
Owner

@rodvand commented on GitHub (Jul 2, 2024):

So the VM creation works if you define both the Site and Cluster in the process. However I feel this should not be needed as you assign a site to a cluster for a reason. The change also breaks any automation which doesn't currently define a site and cluster.

(I just noticed due to failing tests in the ansible collection).

@rodvand commented on GitHub (Jul 2, 2024): So the VM creation works if you define both the Site and Cluster in the process. However I feel this should not be needed as you assign a site to a cluster for a reason. The change also breaks any automation which doesn't currently define a site and cluster. (I just noticed due to failing tests in the ansible collection).
Author
Owner

@jeffgdotorg commented on GitHub (Jul 3, 2024):

Hi @rodvand, thanks for reporting this problem you've encountered in NetBox.

I have a hunch you're describing the same fundamental problem as captured in #15310 which I helped triage some weeks ago. Would you please take a look at that issue and join it if my hunch is correct? Otherwise please set me straight on the distinction and we'll move forward here.

@jeffgdotorg commented on GitHub (Jul 3, 2024): Hi @rodvand, thanks for reporting this problem you've encountered in NetBox. I have a hunch you're describing the same fundamental problem as captured in #15310 which I helped triage some weeks ago. Would you please take a look at that issue and join it if my hunch is correct? Otherwise please set me straight on the distinction and we'll move forward here.
Author
Owner

@rodvand commented on GitHub (Jul 4, 2024):

I have a hunch you're describing the same fundamental problem as captured in #15310 which I helped triage some weeks ago. Would you please take a look at that issue and join it if my hunch is correct? Otherwise please set me straight on the distinction and we'll move forward here.

The issue I'm describing only appeared in 4.0.6, so I don't think it's the same issue. I think my issue is just a bit of a logic error in the PR I linked in the initial report.

@rodvand commented on GitHub (Jul 4, 2024): > I have a hunch you're describing the same fundamental problem as captured in #15310 which I helped triage some weeks ago. Would you please take a look at that issue and join it if my hunch is correct? Otherwise please set me straight on the distinction and we'll move forward here. The issue I'm describing only appeared in 4.0.6, so I don't think it's the same issue. I think my issue is just a bit of a logic error in the PR I linked in the initial report.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9936