Unable to update VM attached IP to Primary IP via Rest API #4755

Closed
opened 2025-12-29 19:20:09 +01:00 by adam · 0 comments
Owner

Originally created by @akballow on GitHub (Apr 13, 2021).

NetBox version

v2.10.4

Python version

3.6

Steps to Reproduce

  1. Create VM Manually - TestVM
  2. Create Interface Manually - TestVMnic
  3. Attach an IP Manually with setting as primary- 1.1.1.1/24
  4. Run API patch call to make the attached IP become the primary
    curl -s "https://netbox/api/virtualization/virtual-machines/1/"
    -X PATCH
    -d '{"primary_ip": {"id": 1}}'
    -H "Authorization: Token XXXX"
    -H "Content-Type: application/json" | jq

Nothing happends

I tried variances like '{"primary_ip": {"id": 1}}' '{"primary_ip": 1}' and '{"primary_ip": "1"}'

Without any luck

Expected Behavior

The non primary IP is not the Primary IP fore the VM.

I do not get this issue for non VM devices.

Observed Behavior

Nothing Happens

Originally created by @akballow on GitHub (Apr 13, 2021). ### NetBox version v2.10.4 ### Python version 3.6 ### Steps to Reproduce 1. Create VM Manually - TestVM 2. Create Interface Manually - TestVMnic 3. Attach an IP Manually with setting as primary- 1.1.1.1/24 4. Run API patch call to make the attached IP become the primary curl -s "https://netbox/api/virtualization/virtual-machines/1/" \ -X PATCH \ -d '{"primary_ip": {"id": 1}}' \ -H "Authorization: Token XXXX" \ -H "Content-Type: application/json" | jq Nothing happends I tried variances like '{"primary_ip": {"id": 1}}' '{"primary_ip": 1}' and '{"primary_ip": "1"}' Without any luck ### Expected Behavior The non primary IP is not the Primary IP fore the VM. I do not get this issue for non VM devices. ### Observed Behavior Nothing Happens
adam added the type: bug label 2025-12-29 19:20:09 +01:00
adam closed this issue 2025-12-29 19:20:09 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4755