Unable to create tunnel termination for virtual machine #9105

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

Originally created by @abhi1693 on GitHub (Jan 18, 2024).

Originally assigned to: @DanSheps on GitHub.

Deployment Type

Self-hosted

NetBox Version

v3.7.1

Python Version

3.10

Steps to Reproduce

  1. Create tunel without any terminations at first
  2. In the tunnel creation form, choose the newly selected tunnel with type virtual machine and any of its interface

Expected Behavior

A termination for the virtual machine should be created

Observed Behavior

Error of the form is raised

Select a valid choice. That choice is not one of the available choices.

I have debugged this a bit further, the clean method sets the termination which is always picking the Device interface no matter the selection made for the VM. Furthermore, there is an issue with the selector which always remains set for device.

So clearly, any selection made for the VM does show up in the UI but is not taken forward in any requests.

Originally created by @abhi1693 on GitHub (Jan 18, 2024). Originally assigned to: @DanSheps on GitHub. ### Deployment Type Self-hosted ### NetBox Version v3.7.1 ### Python Version 3.10 ### Steps to Reproduce 1. Create tunel without any terminations at first 2. In the tunnel creation form, choose the newly selected tunnel with type virtual machine and any of its interface ### Expected Behavior A termination for the virtual machine should be created ### Observed Behavior Error of the form is raised ``` Select a valid choice. That choice is not one of the available choices. ``` I have debugged this a bit further, the `clean` method sets the `termination` which is always picking the Device interface no matter the selection made for the VM. Furthermore, there is an issue with the selector which always remains set for device. So clearly, any selection made for the VM does show up in the UI but is not taken forward in any requests.
adam added the type: bugstatus: acceptedseverity: medium labels 2025-12-29 20:45:29 +01:00
adam closed this issue 2025-12-29 20:45:29 +01:00
Author
Owner

@abhi1693 commented on GitHub (Jan 18, 2024):

The selector issue can be fixed by adding the following in the init method

self.fields['parent'].widget.attrs['selector'] = 'virtualization.virtualmachine'

But I'm still unsure where the primary issue is coming from.

@abhi1693 commented on GitHub (Jan 18, 2024): The selector issue can be fixed by adding the following in the init method ``` self.fields['parent'].widget.attrs['selector'] = 'virtualization.virtualmachine' ``` But I'm still unsure where the primary issue is coming from.
Author
Owner

@abhi1693 commented on GitHub (Jan 18, 2024):

Another issue I have found is that the edit does not show the selected vm related options in the drop-down

@abhi1693 commented on GitHub (Jan 18, 2024): Another issue I have found is that the edit does not show the selected vm related options in the drop-down
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9105