device.interfaces.all() on Master Virtual Chassis device, returning only Master interfcaces #8678

Closed
opened 2025-12-29 20:39:47 +01:00 by adam · 2 comments
Owner

Originally created by @jonatangobbato on GitHub (Sep 26, 2023).

NetBox version

v3.6.1

Python version

3.8

Steps to Reproduce

  1. Creates a config template with:

{% for interface in device.interfaces.all() %}
{{ interface.name }}
{% endfor %}

  1. Render a config for a Master Device of Virtual Chassis with 2 members.

Expected Behavior

A rendered config with all interfaces of master device and the second devices of virtual chassis.

Like:

1/1/1
1/1/2
1/1/x
2/1/1
2/1/2
2/1/x

Observed Behavior

Only interfaces of master devices are rendered.

I dont know if it is a bug or im using wrong view for the template, if its the case, i need a help to set correct view on template to render all interfaces o virtual chassis.

thanks

Originally created by @jonatangobbato on GitHub (Sep 26, 2023). ### NetBox version v3.6.1 ### Python version 3.8 ### Steps to Reproduce 1. Creates a config template with: {% for interface in device.interfaces.all() %} {{ interface.name }} {% endfor %} 2. Render a config for a Master Device of Virtual Chassis with 2 members. ### Expected Behavior A rendered config with all interfaces of master device and the second devices of virtual chassis. Like: 1/1/1 1/1/2 1/1/x 2/1/1 2/1/2 2/1/x ### Observed Behavior Only interfaces of master devices are rendered. I dont know if it is a bug or im using wrong view for the template, if its the case, i need a help to set correct view on template to render all interfaces o virtual chassis. thanks
adam closed this issue 2025-12-29 20:39:47 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 26, 2023):

This is working as intended. You'll need to use the vc_interfaces() method on the Device model for interfaces that belong to peer VC members.

@jeremystretch commented on GitHub (Sep 26, 2023): This is working as intended. You'll need to use the `vc_interfaces()` method on the Device model for interfaces that belong to peer VC members.
Author
Owner

@jonatangobbato commented on GitHub (Sep 26, 2023):

Thanks @jeremystretch thats worked. Where can i get thats methos for use in config templates?

@jonatangobbato commented on GitHub (Sep 26, 2023): Thanks @jeremystretch thats worked. Where can i get thats methos for use in config templates?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8678