Virtual Machine wrongfully inheriting config context from site's location #10645

Closed
opened 2025-12-29 21:34:07 +01:00 by adam · 0 comments
Owner

Originally created by @WilliamFitzjohn on GitHub (Jan 14, 2025).

Originally assigned to: @jeremystretch on GitHub.

Deployment Type

NetBox Cloud

Triage priority

N/A

NetBox Version

v4.2.0

Python Version

3.10

Steps to Reproduce

Diagram for reference when reproducing:
Screenshot 2025-01-14 at 10 36 24 AM

STEPS:

  1. New Site "A1"
  2. New Location "L1 - prod" (linked to site "A1")
  3. New Location "L2 - lab" (linked to site "A1")
  4. New Config Context "A1-config"
    Location: "L1 - prod"
    Data:
    {
        "site_name": "A1 - prod"
    }
    
  5. New Config Context "A1-lab-config"
    Location: "L2 - lab"
    Data:
    {
        "site_name": "A1 - lab"
    }
    
  6. New VM "A1-prod-vm" (linked to site "A1", no location because VMs cant have locations)
  7. Check rendered config context of VM "A1-prod-vm"
    Screenshot 2025-01-14 at 10 33 54 AM

First question: How does the VM have a rendered config context but no source config contexts?
Second question: How is the VM getting a location based config context when the VM doesn't have a location?
Third question (optional): Why is the VM getting specifically the LAB config context in this senario?

For background, i first tried this in a v3.7.3 deployment then tried it in the v4.2.0 community demo and found the same issue. Found when we saw all our prod vms using a lab config context.

Expected Behavior

The VM shouldn't have any data in its config context

Observed Behavior

  1. The VM has data in the config context
  2. The VM's config context doesn't show where it got the source config from
Originally created by @WilliamFitzjohn on GitHub (Jan 14, 2025). Originally assigned to: @jeremystretch on GitHub. ### Deployment Type NetBox Cloud ### Triage priority N/A ### NetBox Version v4.2.0 ### Python Version 3.10 ### Steps to Reproduce Diagram for reference when reproducing: ![Screenshot 2025-01-14 at 10 36 24 AM](https://github.com/user-attachments/assets/2c1b4eeb-1636-4ec6-82a8-47cec3503916) STEPS: 1. New Site "A1" 2. New Location "L1 - prod" (linked to site "A1") 3. New Location "L2 - lab" (linked to site "A1") 4. New Config Context "A1-config" Location: "L1 - prod" Data: ```json { "site_name": "A1 - prod" } ``` 5. New Config Context "A1-lab-config" Location: "L2 - lab" Data: ```json { "site_name": "A1 - lab" } ``` 6. New VM "A1-prod-vm" (linked to site "A1", no location because VMs cant have locations) 7. Check rendered config context of VM "A1-prod-vm" ![Screenshot 2025-01-14 at 10 33 54 AM](https://github.com/user-attachments/assets/f87f1abb-7355-4370-a01a-7f8580bff2f1) **First question:** How does the VM have a rendered config context **but no source config contexts**? **Second question:** How is the VM getting a **location based** config context when the VM doesn't have a location? **Third question (optional):** Why is the VM getting specifically the LAB config context in this senario? For background, i first tried this in a v3.7.3 deployment then tried it in the v4.2.0 community demo and found the same issue. Found when we saw all our prod vms using a lab config context. ### Expected Behavior The VM shouldn't have any data in its config context ### Observed Behavior 1. The VM has data in the config context 2. The VM's config context doesn't show where it got the source config from
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:34:08 +01:00
adam closed this issue 2025-12-29 21:34:08 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10645