VM device selection does not filter the list by the selected site #6659

Closed
opened 2025-12-29 19:43:36 +01:00 by adam · 1 comment
Owner

Originally created by @abhi1693 on GitHub (Jul 14, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.3.0-beta1

Python version

3.9

Steps to Reproduce

  1. Create a new VM named vm1 and associate it to site DM-Akron and click Save
  2. Edit the same VM and click on the Device drop-down and choose the 1st entry from the list and click save

Expected Behavior

The device list should be pre-filtered by the already associated site

Observed Behavior

An error is thrown (this is good to have as validation but not so user-friendly approach)

image

Originally created by @abhi1693 on GitHub (Jul 14, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.3.0-beta1 ### Python version 3.9 ### Steps to Reproduce 1. Create a new VM named `vm1` and associate it to site `DM-Akron` and click Save 2. Edit the same VM and click on the Device drop-down and choose the 1st entry from the list and click save ### Expected Behavior The device list should be pre-filtered by the already associated site ### Observed Behavior An error is thrown (this is good to have as validation but not so user-friendly approach) ![image](https://user-images.githubusercontent.com/5083532/179052470-75127b6e-c6e4-41d5-ad91-0c4d9cf4f92e.png)
adam added the type: bugstatus: acceptedbeta labels 2025-12-29 19:43:36 +01:00
adam closed this issue 2025-12-29 19:43:36 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 15, 2022):

Edit the same VM and click on the Device drop-down and choose the 1st entry from the list and click save

The issue is that the devices is list is not being filtered by the assigned site; easy enough to fix.

However, there's a second issue, where even if a device within that site is selected, an AttributeError exception is raised because a device has been selected but no cluster is assigned. This is because we're missing a validation rule for the cluster.

I'm going to resolve both bugs under this issue as they're very closely related.

@jeremystretch commented on GitHub (Jul 15, 2022): > Edit the same VM and click on the Device drop-down and choose the 1st entry from the list and click save The issue is that the devices is list is not being filtered by the assigned site; easy enough to fix. However, there's a second issue, where even if a device within that site is selected, an `AttributeError` exception is raised because a device has been selected but no cluster is assigned. This is because we're missing a validation rule for the cluster. I'm going to resolve both bugs under this issue as they're very closely related.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6659