Extend Virtual Chassis Object #4886

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

Originally created by @jaakub on GitHub (May 6, 2021).

NetBox version

v2.11.2

Feature type

Data model extension

Proposed functionality

Allow assigning of IP addresses to virtual chassis objects, and allow to filter VC objects by has_primary_ip/has_ip. Essentially mimicking device object in a way.

Use case

We have stacked switches, each with their unique hostnames, and the VC stack itself has its own hostname and a virtual, floating IP between the members.

Example:

Switch 1: tor-b10-sw1.siteA (192.168.0.1/24)
Switch 2: tor-b10-sw2.siteA (192.168.0.2/24)
VC Stack: tor-b10.siteA (192.168.0.3/24)

We have external systems such as backup, SNMP or Syslog query Netbox for active device/vc objects (with filter) to then create their own inventory to either perform certain actions or enrich the data they hold.

In most cases, systems monitor the virtual floating IP/hostname and expect to receive data from that IP/hostname (not the members individual IPs).

Currently, to work around this:

  1. We create VC Stack IP (192.168.0.3/24) with a role of vip, and allocate it to each member device. This is to make sure that IP is allocated in IPAM.
  2. We then use custom fields cf_vc_ipaddress (text) and cf_vc_ipaddress_present (boolean), to be able to assign that same VIP to VC object, and be able to filter results to only those with cf_vc_ipaddress_present = True.

Being able to allocate IPs to VC object would save having to allocate them to VC members as VIP, link IP to VC object (nice), and provide better filtering (has_primary_ip).

Database changes

VC object will need an additional field for IP address.

External dependencies

N/A

Originally created by @jaakub on GitHub (May 6, 2021). ### NetBox version v2.11.2 ### Feature type Data model extension ### Proposed functionality Allow assigning of IP addresses to virtual chassis objects, and allow to filter VC objects by `has_primary_ip`/`has_ip`. Essentially mimicking device object in a way. ### Use case We have stacked switches, each with their unique hostnames, and the VC stack itself has its own hostname and a virtual, floating IP between the members. Example: **Switch 1:** `tor-b10-sw1.siteA` (192.168.0.1/24) **Switch 2:** `tor-b10-sw2.siteA` (192.168.0.2/24) **VC Stack:** `tor-b10.siteA` (192.168.0.3/24) We have external systems such as backup, SNMP or Syslog query Netbox for active device/vc objects (with filter) to then create their own inventory to either perform certain actions or enrich the data they hold. In most cases, systems monitor the virtual floating IP/hostname and expect to receive data from that IP/hostname (not the members individual IPs). Currently, to work around this: 1. We create VC Stack IP (192.168.0.3/24) with a role of `vip`, and allocate it to each member device. This is to make sure that IP is allocated in IPAM. 2. We then use custom fields `cf_vc_ipaddress` (text) and `cf_vc_ipaddress_present` (boolean), to be able to assign that same VIP to VC object, and be able to filter results to only those with `cf_vc_ipaddress_present = True`. Being able to allocate IPs to VC object would save having to allocate them to VC members as VIP, link IP to VC object (nice), and provide better filtering (has_primary_ip). ### Database changes VC object will need an additional field for IP address. ### External dependencies N/A
adam added the type: feature label 2025-12-29 19:21:40 +01:00
adam closed this issue 2025-12-29 19:21:40 +01:00
Author
Owner

@TheNetworkGuy commented on GitHub (May 11, 2021):

Would love to see this implemented, although there have been discussions in the past (mostly all linked to #99) where this feature was rejected.

How i implement VIP's is by setting 2 IP's on the management interface and setting the VIP as primary for the device. The Ansible inventory plugin and my own scripts check the primary / secondary roles in a cluster and only processes the primary node.

@TheNetworkGuy commented on GitHub (May 11, 2021): Would love to see this implemented, although there have been discussions in the past (mostly all linked to #99) where this feature was rejected. How i implement VIP's is by setting 2 IP's on the management interface and setting the VIP as primary for the device. The Ansible inventory plugin and my own scripts check the primary / secondary roles in a cluster and only processes the primary node.
Author
Owner

@jeremystretch commented on GitHub (May 11, 2021):

This is a function of the master device for a virtual chassis. You can simply reference virtualchassis.master.primary_ip.

@jeremystretch commented on GitHub (May 11, 2021): This is a function of the master device for a virtual chassis. You can simply reference `virtualchassis.master.primary_ip`.
Author
Owner

@jaakub commented on GitHub (May 11, 2021):

This is a function of the master device for a virtual chassis. You can simply reference virtualchassis.master.primary_ip.

That's great, thanks. I didn't realise you can access a device object like that, but thinking about it now - it does make sense.

@jaakub commented on GitHub (May 11, 2021): > This is a function of the master device for a virtual chassis. You can simply reference `virtualchassis.master.primary_ip`. That's great, thanks. I didn't realise you can access a device object like that, but thinking about it now - it does make sense.
Author
Owner

@jeremystretch commented on GitHub (May 12, 2021):

Going to close this out as it seems that the underlying use case has been satisfied.

@jeremystretch commented on GitHub (May 12, 2021): Going to close this out as it seems that the underlying use case has been satisfied.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4886