Virtual machine selection on Add a new interface not recognised #6926

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

Originally created by @technut371 on GitHub (Sep 2, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.3.1

Python version

3.8

Steps to Reproduce

When adding an interface to a Virtual Machine, the Virtual Machine selection drop down does not appear to register a change.

These are the steps I followed, there may be other permutations.

  1. From the Virtual Machine list, Select a VM.
  2. Click '+ Add Interfaces' button.
  3. In the Virtual Machine dropdown list, select a different VM from the one pre-populated.
  4. Enter a name in the 'name' field.
  5. Click Create.
  6. The created interface will be appear on the virtual machine that the form was instantiated from.

Expected Behavior

If it's possible to change the virtual machine in the field, I would expect the interface to be created on VM selected in the 'Virtual Machine' field and not the VM from where the Add an interface was instantiated.

The process I followed was to create several VMs, via clone. The interface doesn't get cloned so I then went to create multiple interfaces using the "Create & Add Another" selecting another VM in the Add new interface form, without having to exit the form, select the next VM and then add an interface on the next VM.

Observed Behavior

After creating the interface on a Virtual Machine, using the 'create and add another' selecting a different VM in the drop down, and entering the same interface name, a notification dialog popped up 'Name: this field is required'. I thought originally that the name entry was not being accepted, but then realised it was the Virtual Machine selection that was not functioning. The warning message was confusing, and I would have expected either the selected virtual machine to be recognised, an error similar to "Name: duplicate interface name" , rather than 'Name: this field is required' as the name field was populated.

Originally created by @technut371 on GitHub (Sep 2, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.3.1 ### Python version 3.8 ### Steps to Reproduce When adding an interface to a Virtual Machine, the Virtual Machine selection drop down does not appear to register a change. These are the steps I followed, there may be other permutations. 1. From the Virtual Machine list, Select a VM. 2. Click '+ Add Interfaces' button. 3. In the Virtual Machine dropdown list, select a different VM from the one pre-populated. 6. Enter a name in the 'name' field. 7. Click Create. 8. The created interface will be appear on the virtual machine that the form was instantiated from. ### Expected Behavior If it's possible to change the virtual machine in the field, I would expect the interface to be created on VM selected in the 'Virtual Machine' field and not the VM from where the Add an interface was instantiated. The process I followed was to create several VMs, via clone. The interface doesn't get cloned so I then went to create multiple interfaces using the "Create & Add Another" selecting another VM in the Add new interface form, without having to exit the form, select the next VM and then add an interface on the next VM. ### Observed Behavior After creating the interface on a Virtual Machine, using the 'create and add another' selecting a different VM in the drop down, and entering the same interface name, a notification dialog popped up 'Name: this field is required'. I thought originally that the name entry was not being accepted, but then realised it was the Virtual Machine selection that was not functioning. The warning message was confusing, and I would have expected either the selected virtual machine to be recognised, an error similar to "Name: duplicate interface name" , rather than 'Name: this field is required' as the name field was populated.
adam added the type: bugstatus: accepted labels 2025-12-29 19:46:50 +01:00
adam closed this issue 2025-12-29 19:46:50 +01:00
Author
Owner

@jeremystretch commented on GitHub (Sep 7, 2022):

This applies to device components and component templates as well. Unfortunately I think a proper fix is going to necessitate a completely new approach to how we currently handle bulk component creation. I'm working on a solution though, and this should be a great opportunity to clean up some template cruft.

@jeremystretch commented on GitHub (Sep 7, 2022): This applies to device components and component templates as well. Unfortunately I think a proper fix is going to necessitate a completely new approach to how we currently handle bulk component creation. I'm working on a solution though, and this should be a great opportunity to clean up some template cruft.
Author
Owner

@jeremystretch commented on GitHub (Sep 9, 2022):

This one really got away from me. I ended up refactoring quite a bit of the underlying views and forms, however I think the end result is much cleaner and will be easier to maintain long-term.

@jeremystretch commented on GitHub (Sep 9, 2022): This one really got away from me. I ended up refactoring quite a bit of the underlying views and forms, however I think the end result is much cleaner and will be easier to maintain long-term.
Author
Owner

@technut371 commented on GitHub (Sep 20, 2022):

Thank you @jeremystretch and the Netbox team for resolving so promptly. Amazing work!

@technut371 commented on GitHub (Sep 20, 2022): Thank you @jeremystretch and the Netbox team for resolving so promptly. Amazing work!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6926