Cannot set Primary IP for VM when Importing IP with CSV #9380

Closed
opened 2025-12-29 20:49:09 +01:00 by adam · 1 comment
Owner

Originally created by @Pythbit on GitHub (Mar 22, 2024).

Originally assigned to: @DanSheps on GitHub.

Deployment Type

Self-hosted

NetBox Version

v3.7.4

Python Version

3.8

Steps to Reproduce

  1. Attempt to assign an IP to a VM interface by importing it in CSV format, as an example on the online demo:
address,id,virtual_machine,interface,is_primary,status
172.16.0.3/24,33,vm6,eth0,true,active

Into IP Addresses > Import > Direct Import
2. Receive the following error:

<class 'KeyError'>

'device'

Python version: 3.8.10
NetBox version: 3.7.4
Plugins: 
  netbox_demo: 0.3.1

Expected Behavior

The IP Address to be updated and assigned to the interface on that VM, as well as set as the primary IP. The GUI lists the Primary IP checkbox as being for both devices and VMs, and there is no other listed import field specifically for VMs.

Observed Behavior

Returned a KeyError about missing the "device" field.

Originally created by @Pythbit on GitHub (Mar 22, 2024). Originally assigned to: @DanSheps on GitHub. ### Deployment Type Self-hosted ### NetBox Version v3.7.4 ### Python Version 3.8 ### Steps to Reproduce 1. Attempt to assign an IP to a VM interface by importing it in CSV format, as an example on the online demo: ``` address,id,virtual_machine,interface,is_primary,status 172.16.0.3/24,33,vm6,eth0,true,active ``` Into IP Addresses > Import > Direct Import 2. Receive the following error: ``` <class 'KeyError'> 'device' Python version: 3.8.10 NetBox version: 3.7.4 Plugins: netbox_demo: 0.3.1 ``` ### Expected Behavior The IP Address to be updated and assigned to the interface on that VM, as well as set as the primary IP. The GUI lists the Primary IP checkbox as being for both devices and VMs, and there is no other listed import field specifically for VMs. ### Observed Behavior Returned a KeyError about missing the "device" field.
adam added the type: bugstatus: acceptedseverity: medium labels 2025-12-29 20:49:09 +01:00
adam closed this issue 2025-12-29 20:49:09 +01:00
Author
Owner

@Pythbit commented on GitHub (Apr 3, 2024):

Hi,

Thanks for getting a PR open on this. Since it seems to be taking some time to get reviewed, I'm wondering if there are any workarounds to this? Just to get primaries assigned in bulk.

@Pythbit commented on GitHub (Apr 3, 2024): Hi, Thanks for getting a PR open on this. Since it seems to be taking some time to get reviewed, I'm wondering if there are any workarounds to this? Just to get primaries assigned in bulk.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9380