Unable to assign VM/Device in one site to cluster that has no site #9478

Closed
opened 2025-12-29 20:50:28 +01:00 by adam · 9 comments
Owner

Originally created by @jon-nfc on GitHub (Apr 14, 2024).

Originally assigned to: @nopg on GitHub.

Deployment Type

Self-hosted

NetBox Version

v3.7.5

Python Version

3.11

Steps to Reproduce

  1. create vm/device and assign it to a site
  2. create a cluster, don't assign any site
  3. attempt to assign the created device/vm in step 1 to the cluster

Error message The selected cluster (<cluster name>) is not assigned to this site (<site name>)

Expected Behavior

If a cluster has no site set, then a VM/device from any site should be assignable to it. Without being able to do this, it's not possible to track a cluster that spans multiple DC.

Observed Behavior

Can't assign a device/vm with a defined site to a cluster with no defined site (null)

Originally created by @jon-nfc on GitHub (Apr 14, 2024). Originally assigned to: @nopg on GitHub. ### Deployment Type Self-hosted ### NetBox Version v3.7.5 ### Python Version 3.11 ### Steps to Reproduce 1. create vm/device and assign it to a site 2. create a cluster, don't assign any site 3. attempt to assign the created device/vm in step 1 to the cluster Error message `The selected cluster (<cluster name>) is not assigned to this site (<site name>)` ### Expected Behavior If a cluster has no site set, then a VM/device from any site should be assignable to it. Without being able to do this, it's not possible to track a cluster that spans multiple DC. ### Observed Behavior Can't assign a device/vm with a defined site to a cluster with no defined site (`null`)
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 20:50:28 +01:00
adam closed this issue 2025-12-29 20:50:28 +01:00
Author
Owner

@nopg commented on GitHub (Apr 16, 2024):

I'm looking for 'easy' first bug fixes to help with for NetBox. This issue appears to have been accepted, so does that mean the powers-that-be are good with allowing VM's assigned to a Site to be associated with a Cluster that doesn't have a Site?

Seems fairly basic, I'm just wondering if and how I could help. Looks like a simple tweak to: 3c3943c809/netbox/virtualization/models/virtualmachines.py (L181) .

Should it only be allowed for Clusters without a Site assigned, should Clusters be allowed to be assigned to multiple Sites, etc?

@nopg commented on GitHub (Apr 16, 2024): I'm looking for 'easy' first bug fixes to help with for NetBox. This issue appears to have been accepted, so does that mean the powers-that-be are good with allowing VM's assigned to a Site to be associated with a Cluster that doesn't have a Site? Seems fairly basic, I'm just wondering if and how I could help. Looks like a simple tweak to: https://github.com/netbox-community/netbox/blob/3c3943c809aa16499d603acdd160fe431bd8720c/netbox/virtualization/models/virtualmachines.py#L181 . Should it only be allowed for Clusters without a Site assigned, should Clusters be allowed to be assigned to multiple Sites, etc?
Author
Owner

@jon-nfc commented on GitHub (Apr 16, 2024):

Should it only be allowed for Clusters without a Site assigned, should Clusters be allowed to be assigned to multiple Sites, etc?

A Cluster, like in my case can span the globe. Different providers in different regions. The VM's that the cluster runs on, in this case kubernetes do have a site, being their DC.

@jon-nfc commented on GitHub (Apr 16, 2024): > Should it only be allowed for Clusters without a Site assigned, should Clusters be allowed to be assigned to multiple Sites, etc? A Cluster, like in my case can span the globe. Different providers in different regions. The VM's that the cluster runs on, in this case kubernetes do have a site, being their DC.
Author
Owner

@nopg commented on GitHub (Apr 17, 2024):

I can submit a PR allowing device/vm's with a site, to be assigned to a non-site cluster as described above, if allowed :)

@nopg commented on GitHub (Apr 17, 2024): I can submit a PR allowing device/vm's with a site, to be assigned to a non-site cluster as described above, if allowed :)
Author
Owner

@jon-nfc commented on GitHub (Apr 17, 2024):

I can submit a PR allowing device/vm's with a site, to be assigned to a non-site cluster as described above, if allowed :)

Don't know what this allow business is? Generally with Open Source projects, you raise the PR and submit. That's generally the only time you'll have input. Obviously I'm all for the issue being fixed!!

@jon-nfc commented on GitHub (Apr 17, 2024): > I can submit a PR allowing device/vm's with a site, to be assigned to a non-site cluster as described above, if allowed :) Don't know what this allow business is? Generally with Open Source projects, you raise the PR and submit. That's generally the only time you'll have input. Obviously I'm all for the issue being fixed!!
Author
Owner

@nopg commented on GitHub (Apr 17, 2024):

I'm new here but I believe I have to be assigned to the issue before I can/should submit the PR. I have it ready to submit (diff at link below), it appears Devices already have this logic, so I updated VM's to match, added a new test for VM's, and all the similar tests to Devices since they didn't already exist.

https://github.com/netbox-community/netbox/compare/develop...nopg:netbox:15717-vm-cluster-site?diff=split&w=

@nopg commented on GitHub (Apr 17, 2024): I'm new here but I believe I have to be assigned to the issue before I can/should submit the PR. I have it ready to submit (diff at link below), it appears Devices already have this logic, so I updated VM's to match, added a new test for VM's, and all the similar tests to Devices since they didn't already exist. https://github.com/netbox-community/netbox/compare/develop...nopg:netbox:15717-vm-cluster-site?diff=split&w=
Author
Owner

@jon-nfc commented on GitHub (Apr 17, 2024):

I believe I have to be assigned to the issue before I can/should submit the PR

Where'd that come from? If that's the policy to contribute to this repo, I can't imagine anyone coming back, let alone starting in the first place. 2-3 days avg turn around, it'd be a week before you even had the PR started. All that time wasted just for a line of code. When in the end all that is needed is to submit the PR, if it's not good to go, it'll be denied.

@jon-nfc commented on GitHub (Apr 17, 2024): > I believe I have to be assigned to the issue before I can/should submit the PR Where'd that come from? If that's the policy to contribute to this repo, I can't imagine anyone coming back, let alone starting in the first place. 2-3 days avg turn around, it'd be a week before you even had the PR started. All that time wasted just for a line of code. When in the end all that is needed is to submit the PR, if it's not good to go, it'll be denied.
Author
Owner

@peteeckel commented on GitHub (Apr 17, 2024):

Where'd that come from? If that's the policy to contribute to this repo, I can't imagine anyone coming back, let alone starting in the first place. 2-3 days avg turn around, it'd be a week before you even had the PR started. All that time wasted just for a line of code. When in the end all that is needed is to submit the PR, if it's not good to go, it'll be denied.

It comes from the maintainers of NetBox.

NetBox is an enterprise grade piece of software that has many applications in business critical environments, and the process of handling PRs is their chosen way to control the direction the development takes. In the environments NetBox is used in speed is definitely not the first priority, but stability and maturity are.

On the other hand it's also a way to keep people from investing unnecessary work in PRs that eventually wouldn't be accepted anyway, so don't just see it as a random act of bureaucracy.

@peteeckel commented on GitHub (Apr 17, 2024): > Where'd that come from? If that's the policy to contribute to this repo, I can't imagine anyone coming back, let alone starting in the first place. 2-3 days avg turn around, it'd be a week before you even had the PR started. All that time wasted just for a line of code. When in the end all that is needed is to submit the PR, if it's not good to go, it'll be denied. It comes from the maintainers of NetBox. NetBox is an enterprise grade piece of software that has many applications in business critical environments, and the process of handling PRs is their chosen way to control the direction the development takes. In the environments NetBox is used in speed is definitely not the first priority, but stability and maturity are. On the other hand it's also a way to keep people from investing unnecessary work in PRs that eventually wouldn't be accepted anyway, so don't just see it as a random act of bureaucracy.
Author
Owner

@jeremystretch commented on GitHub (Apr 17, 2024):

@jon-nfc please take some time to read our contributing policy. These policies have been put in place to protect everyone's time. If you find yourself unable or unwilling to abide by it, please respectfully refrain from engaging with the project.

@jeremystretch commented on GitHub (Apr 17, 2024): @jon-nfc please take some time to read our [contributing policy](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md). These policies have been put in place to protect everyone's time. If you find yourself unable or unwilling to abide by it, please respectfully refrain from engaging with the project.
Author
Owner

@DanSheps commented on GitHub (Apr 18, 2024):

@nopg I am going to assign this to you. Feel free to submit the PR when you are ready.

@DanSheps commented on GitHub (Apr 18, 2024): @nopg I am going to assign this to you. Feel free to submit the PR when you are ready.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9478