API call to create VM fails when specifying an IP address #3302

Closed
opened 2025-12-29 18:27:33 +01:00 by adam · 1 comment
Owner

Originally created by @sngx13 on GitHub (Feb 10, 2020).

#3639 Environment

  • Python version: 3.6.9
  • NetBox version: 2.7.4

Add Virtual Machine Fails when "primary_ipv4" address is specified using an ID e.g "primary_ip4": 3752. IP object was created in advance.

API Call:

{
"name": "testvm0001",
"status": "active",
"role": {"id": 29},
"cluster": 9,
"vcpus": 1,
"tenant": {"id": 67},
"memory": 2048,
"disk": 60,
"primary_ip4": 3752,
"custom_fields":
{
"vm_os_type": "linux",
"vm_os_version": "Ubuntu 16.04",
"vm_power_state": "on",
"vm_role": "web"
}
}

Observed Behavior

Following response received:

{
"primary_ip4": [
"The specified IP address (99.0.0.1/32) is not assigned to this VM."
]
}

IP Object:

{
"id": 3752,
"family": {
"value": 4,
"label": "IPv4"
},
"address": "99.0.0.1/32",
"vrf": null,
"tenant": {
"id": 67,
"url": "https://ipam.abc.net/api/tenancy/tenants/67/",
"name": "INFRASTRUCTURE",
"slug": "infrastructure"
},
"status": {
"value": "active",
"label": "Active",
"id": 1
},
"role": null,
"interface": null,
"nat_inside": null,
"nat_outside": null,
"dns_name": "",
"description": "",
"tags": [],
"custom_fields": {},
"created": "2020-02-10",
"last_updated": "2020-02-10T14:10:52.351730Z"
}
Response headers

Originally created by @sngx13 on GitHub (Feb 10, 2020). #3639 Environment * Python version: 3.6.9 * NetBox version: 2.7.4 Add Virtual Machine Fails when "primary_ipv4" address is specified using an ID e.g "primary_ip4": 3752. IP object was created in advance. API Call: { "name": "testvm0001", "status": "active", "role": {"id": 29}, "cluster": 9, "vcpus": 1, "tenant": {"id": 67}, "memory": 2048, "disk": 60, "primary_ip4": **3752**, "custom_fields": { "vm_os_type": "linux", "vm_os_version": "Ubuntu 16.04", "vm_power_state": "on", "vm_role": "web" } } # Observed Behavior Following response received: { "primary_ip4": [ "The specified IP address (99.0.0.1/32) is not assigned to this VM." ] } # IP Object: { "id": 3752, "family": { "value": 4, "label": "IPv4" }, "address": "99.0.0.1/32", "vrf": null, "tenant": { "id": 67, "url": "https://ipam.abc.net/api/tenancy/tenants/67/", "name": "INFRASTRUCTURE", "slug": "infrastructure" }, "status": { "value": "active", "label": "Active", "id": 1 }, "role": null, "interface": null, "nat_inside": null, "nat_outside": null, "dns_name": "", "description": "", "tags": [], "custom_fields": {}, "created": "2020-02-10", "last_updated": "2020-02-10T14:10:52.351730Z" } Response headers
adam closed this issue 2025-12-29 18:27:34 +01:00
Author
Owner

@DanSheps commented on GitHub (Feb 10, 2020):

Thank you for your interest in NetBox. GitHub issues are intended for reporting reproducible bugs and requesting features, and must be submitted using one of the templates provided here. For general discussion, questions, or assistance with installation issues, please post to our mailing list instead.

@DanSheps commented on GitHub (Feb 10, 2020): Thank you for your interest in NetBox. GitHub issues are intended for reporting reproducible bugs and requesting features, and must be submitted using one of the templates provided [here](https://github.com/digitalocean/netbox/issues/new/choose). For general discussion, questions, or assistance with installation issues, please post to our [mailing list](https://groups.google.com/forum/#!forum/netbox-discuss) instead.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3302