netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
15.76k stars 2.54k forks source link

Assignment of VLANs out of VLAN Groups to VMs #15310

Open kiwichrism opened 6 months ago

kiwichrism commented 6 months ago

Deployment Type

Self-hosted

NetBox Version

v3.7.3

Python Version

3.9

Steps to Reproduce

Create two different sites and a virtualization cluster with devices (nodes) not assigned to any site. Create a "VLAN Group" with the scope "site group". (VLANs in global scope are not forced to be unique) Create a virtual machine in this cluster and assign a VLAN of the VLAN Group to an interface. This worked until a version < 3.7.? and is now not possible anymore.

This example is for a virtualization platform with vSAN and vMotion over more than one data center.

Expected Behavior

Create two different sites in a site group and a virtualization cluster, defined with devices (nodes) in two different sites. Assign the cluster to this site group and virtual machine to this cluster group. Then the ability to use VLANs of the VLAN Group (scope site group) in virtual machines, that are assigned to a cluster group.

Observed Behavior

1st: can't assign a cluster to a site group, only to a site. virtual machines can't be assigned to a site group, only to a site. 2nd: because of the 1st topic we hadn't assigned the cluster to any site. new behavior in newer version observed: the VLAN assignment is not possible anymore but old assignments are still visible on the "802.1Q tagged" interface.

Due to this, not to be captious enough with the assignment of a cluster to a site and the misleading understanding of a site, we wonder how the future development of the Netbox will handle this issue.

In our new understanding of the Netbox we have to shift away from the idea that a Site is equal a data center. If we use a site as a logical unit wich includes different data centers as location everything works fine. The possibility to only define a VLAN Group in the scope of a site group then looks meaningless to us.

We would like to know the direction of how multi-homed virtualization is intend to be handled in netbox before starting a complete restructure. Or maybe this is only a bug, that will be fixed in upcoming releases?

jeremystretch commented 6 months ago

Please rewrite your reproduction steps above more clearly, using discrete names for each object being created. You also seem to be conflating the reproduction steps with expected behavior. This report is not actionable in its current form.

gesmile commented 6 months ago

Steps to Reproduce

create a Site Group "OurEnvironment" and include

       Site Group:
     OurEnvironment
    /              \
  siteA           siteB
  /   \            / \
locA1 locA2    locB1  locB2
  |     |        |      |
racA1 racA2    racB1  racB2
srvA1 srvA2    srvB1  srvB2

Create "OneCluster" and DO NOT assigne this cluster to any site! adding all 4 Devices is possible to this cluster

Add a VLAN group "OneCluster" with scope type "DCIM > Site Group" and fill it a little bit .... e.g ID 10 vlan-A -> 192.168.10.0/24 ID 20 vlan-B -> 192.168.20.0/24 both assigned to the VLAN Group "OneCluster"

Then create a Virtual Machine "VirtOne" and assign it to the Cluster "OneCluster" with an interface in 802.1Q mode "Tagged" and select VLAN goup "OneCluster" -> It is NOT possible to assign a VLAN out of this group

cross-check single site

create another Cluster "ClusterA", add there two (new) devices from siteA create another VLAN Group "SiteA" scope type "DCIM > Site" and add one or more VLANs in this Group

add a virtual server "VirtA" to ClusterA with an interface in 802.1Q mode "Tagged" and select VLAN goup "ClusterA" -> It is still NOT possible to assign a VLAN out of this group

But if you assign "ClusterA" to "siteA" the VLANs form VLAN Group "SiteA" are available.

our conclusion

We would like to be able to configure a cluster in a site-group context as it is possible for a VLAN Group.

As long as this is not possible the only way we can figure out a working setup is to abandon the site-group concept and use always only one site for a cluster setup and a location hierarchy like below.

         Site:
     OurEnvironment
    /              \
  locA            locB
  /   \            / \
locA1 locA2    locB1  locB2
  |     |        |      |
racA1 racA2    racB1  racB2
srvA1 srvA2    srvB1  srvB2
kiwichrism commented 5 months ago

Please rewrite your reproduction steps above more clearly, using discrete names for each object being created. You also seem to be conflating the reproduction steps with expected behavior. This report is not actionable in its current form.

Hi Jeremy, we've reproduced the scenario in a fresh install of netbox. Do the additional steps to reproduce above help in any way now?

jeffgdotorg commented 3 months ago

I'm acting as a fresh set of eyes here, trying to grok the details of the problem you're describing. To save time and provide a common reference point, I'm attaching a PostgreSQL dump of a NetBox 4.0.3-dev database which I think encapsulates the setup with all required objects already created.

@kiwichrism please try this DB (I think it should load fine with a 4.0.2 install as well) and confirm whether I've got the setup right. netbox_db_repro_15310.sql.gz

github-actions[bot] commented 3 months ago

This is a reminder that additional information is needed in order to further triage this issue. If the requested details are not provided, the issue will soon be closed automatically.

kiwichrism commented 3 months ago

Hi @jeffgdotorg,

thanks heaps for the DB dump, I'll whip up a fresh install on our site and see what you've provided. I'll get back to you after the restore.

Cheers, Chris

I'm acting as a fresh set of eyes here, trying to grok the details of the problem you're describing. To save time and provide a common reference point, I'm attaching a PostgreSQL dump of a NetBox 4.0.3-dev database which I think encapsulates the setup with all required objects already created.

@kiwichrism please try this DB (I think it should load fine with a 4.0.2 install as well) and confirm whether I've got the setup right. netbox_db_repro_15310.sql.gz

kiwichrism commented 3 months ago

Hi @jeffgdotorg,

just restored your dump into a fresh install of v4.0.3. So far I agree with the steps you took to reproduce. And I can second that at this stage I can't add VLAN Group "OneCluster" to the eth0 interface of VM "VirtOne". I can select OneCluster and click save, there's a green message popping up it's been saved but it doesn't apply the change. There is still no VLAN Group assigned.

Are we doing something wrong on our site, that this isn't designed to be used like this or why is the assignment not applied?

Thanks again heaps for your efforts, I hope we get to the bottom of this.

Cheers, Chris

I'm acting as a fresh set of eyes here, trying to grok the details of the problem you're describing. To save time and provide a common reference point, I'm attaching a PostgreSQL dump of a NetBox 4.0.3-dev database which I think encapsulates the setup with all required objects already created.

@kiwichrism please try this DB (I think it should load fine with a 4.0.2 install as well) and confirm whether I've got the setup right. netbox_db_repro_15310.sql.gz

jeffgdotorg commented 2 months ago

Hi @kiwichrism, sorry for the long silence. I just realized that your issue has been excluded from our usual evaluation processes because I failed to set a severity label, which I just addressed.

I'm adding it to the agenda for tomorrow's standup to get developer eyes back on it.