VM Rendered Config Context does not consider directly related site #9163

Closed
opened 2025-12-29 20:46:25 +01:00 by adam · 4 comments
Owner

Originally created by @ChrisPortman on GitHub (Jan 28, 2024).

Originally assigned to: @ChrisPortman on GitHub.

Deployment Type

Self-hosted

NetBox Version

v3.7.1

Python Version

3.8

Steps to Reproduce

  1. Create a site
  2. Create a Config Context and apply it to new site (step 1)
  3. Create a VM and set its site to the one created above
  4. DO NOT assign the VM to a cluster
  5. Inspect the rendered context in the UI. Note that the site config shows as a source context but it is not merged into the rendered context.
  6. Create a VM Cluster and assign its site to that created in step 1.
  7. Update the VM to be a member of that cluster
  8. Note that the rendered context for the VM now includes the sites config context

Expected Behavior

The VMs config context should include the sites context when it is directly related via the VM's site attribute with out requiring the cluster.

Observed Behavior

The VM context does not include the site context when it is directly related and not accessible via a cluster

Originally created by @ChrisPortman on GitHub (Jan 28, 2024). Originally assigned to: @ChrisPortman on GitHub. ### Deployment Type Self-hosted ### NetBox Version v3.7.1 ### Python Version 3.8 ### Steps to Reproduce 1. Create a site 2. Create a Config Context and apply it to new site (step 1) 3. Create a VM and set its site to the one created above 4. DO NOT assign the VM to a cluster 5. Inspect the rendered context in the UI. Note that the site config shows as a source context but it is not merged into the rendered context. 6. Create a VM Cluster and assign its site to that created in step 1. 7. Update the VM to be a member of that cluster 8. Note that the rendered context for the VM now includes the sites config context ### Expected Behavior The VMs config context should include the sites context when it is directly related via the VM's site attribute with out requiring the cluster. ### Observed Behavior The VM context does not include the site context when it is directly related and not accessible via a cluster
adam added the type: bugstatus: acceptedseverity: medium labels 2025-12-29 20:46:25 +01:00
adam closed this issue 2025-12-29 20:46:25 +01:00
Author
Owner

@ChrisPortman commented on GitHub (Jan 28, 2024):

I have a PR ready to resolve this

@ChrisPortman commented on GitHub (Jan 28, 2024): I have a PR ready to resolve this
Author
Owner

@jeremystretch commented on GitHub (Jan 29, 2024):

  1. Create a site with some config context

Sites do not have config context. Please elaborate on exactly what actions you're taking and what data you're providing at each step, so that someone else can confidently attempt to reproduce the bug.

@jeremystretch commented on GitHub (Jan 29, 2024): > 1. Create a site with some config context Sites do not have config context. Please elaborate on _exactly_ what actions you're taking and what data you're providing at each step, so that someone else can confidently attempt to reproduce the bug.
Author
Owner

@ChrisPortman commented on GitHub (Jan 29, 2024):

@jeremystretch Sorry, you have to create the site, and then create the context and apply it to the site:

1b9e6bed55/netbox/extras/models/configs.py (L63)

image

@ChrisPortman commented on GitHub (Jan 29, 2024): @jeremystretch Sorry, you have to create the site, and then create the context and apply it to the site: https://github.com/netbox-community/netbox/blob/1b9e6bed55d4ee53f60bcd6540bce953ddbf4167/netbox/extras/models/configs.py#L63 ![image](https://github.com/netbox-community/netbox/assets/1924479/1e5ac041-c94d-4aed-b7bd-002c16f3ae57)
Author
Owner

@ChrisPortman commented on GitHub (Jan 31, 2024):

@jeremystretch, Im happy to own this one and submit a PR

@ChrisPortman commented on GitHub (Jan 31, 2024): @jeremystretch, Im happy to own this one and submit a PR
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9163