Issue creating virtual-machine with only cluster field filled in #6867

Closed
opened 2025-12-29 19:46:11 +01:00 by adam · 5 comments
Owner

Originally created by @joeribloemen on GitHub (Aug 24, 2022).

NetBox version

v3.3.0

Python version

3.10

Steps to Reproduce

  1. Go to virtual-machines tab under Virtualization
  2. Click add virtual machine
  3. Fill in name and cluster
  4. Click create and recieve error: the selected cluster (**** is not assigned to this site (None).)

Expected Behavior

In the patch notes it stands that either site or/and cluster need to be assigned to the virtual machine.

image

I expected if the site field is not filled in, the site field is just inherted from the cluster object.

Is this behavior normal ?

Observed Behavior

Error
image

Originally created by @joeribloemen on GitHub (Aug 24, 2022). ### NetBox version v3.3.0 ### Python version 3.10 ### Steps to Reproduce 1. Go to virtual-machines tab under Virtualization 2. Click add virtual machine 3. Fill in name and cluster 4. Click create and recieve error: the selected cluster (**** is not assigned to this site (None).) ### Expected Behavior In the patch notes it stands that either site or/and cluster need to be assigned to the virtual machine. ![image](https://user-images.githubusercontent.com/18398257/186421055-11370080-365a-4a37-90be-38a6327c75ff.png) I expected if the site field is not filled in, the site field is just inherted from the cluster object. Is this behavior normal ? ### Observed Behavior Error ![image](https://user-images.githubusercontent.com/18398257/186422217-2720ac00-74db-4743-8455-5b6281def5fc.png)
adam added the type: bug label 2025-12-29 19:46:11 +01:00
adam closed this issue 2025-12-29 19:46:12 +01:00
Author
Owner

@jeremystretch commented on GitHub (Aug 24, 2022):

You've skipped the part where you create the cluster. If the cluster to which you're assigning the VM is associated with a site, then this is expected: Both the VM and its cluster must belong to the same site, or to no site.

I can confirm that creating a new cluster with no site assigned, and then creating a new VM assigned to that cluster works as expected on v3.3.0.

@jeremystretch commented on GitHub (Aug 24, 2022): You've skipped the part where you create the cluster. If the cluster to which you're assigning the VM is associated with a site, then this is expected: Both the VM and its cluster must belong to the same site, or to no site. I can confirm that creating a new cluster with no site assigned, and then creating a new VM assigned to that cluster works as expected on v3.3.0.
Author
Owner

@joeribloemen commented on GitHub (Aug 24, 2022):

Okey, Thanks for the explanation.

Have a great day!

@joeribloemen commented on GitHub (Aug 24, 2022): Okey, Thanks for the explanation. Have a great day!
Author
Owner

@bb-Ricardo commented on GitHub (Aug 29, 2022):

Hey, just wondering. If the site is enforced by the cluster, and NetBox is aware of the cluster site, then why do I need to specify a site for the VM if the VM will be assigned to a cluster?

@bb-Ricardo commented on GitHub (Aug 29, 2022): Hey, just wondering. If the site is enforced by the cluster, and NetBox is aware of the cluster site, then why do I need to specify a site for the VM if the VM will be assigned to a cluster?
Author
Owner

@jeremystretch commented on GitHub (Aug 29, 2022):

VMs can also be assigned to a site without specifying a cluster, so an explicit entry is necessary for validation.

@jeremystretch commented on GitHub (Aug 29, 2022): VMs can also be assigned to a site without specifying a cluster, so an explicit entry is necessary for validation.
Author
Owner

@bb-Ricardo commented on GitHub (Aug 29, 2022):

That is a great feature, but then the site and cluster attribute should be mutually exclusive. You either select a site OR a cluster as the cluster enforces the site attribute. This is also stated in the release notes (see issue description)

@bb-Ricardo commented on GitHub (Aug 29, 2022): That is a great feature, but then the site and cluster attribute should be mutually exclusive. You either select a site OR a cluster as the cluster enforces the site attribute. This is also stated in the release notes (see issue description)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6867