virtualization_virtual-machines_create #2151

Closed
opened 2025-12-29 17:22:42 +01:00 by adam · 2 comments
Owner

Originally created by @Ti3o on GitHub (Nov 28, 2018).

Hello,
i try to use the api of netbox to create a new virtual machine with this request

{
"name":"Server_1",
"site":{"id":1,"slug":"site1","name":"site1"},
"cluster":{"id":1,"name":"demo"},
"role":{"slug":"Applicative Server","id":1,"name":"Applicative Server"},
"vcpus":4,
"memory":4160,
"disk":15,
"tenant":{"slug":"example","id":1,"name":"Example"}
}

the reply :

{
"cluster": [
"Primary key must be an integer"
],
"role": [
"Primary key must be an integer"
],
"tenant": [
"Primary key must be an integer"
]
}

did you have a good exemple for me ?

Originally created by @Ti3o on GitHub (Nov 28, 2018). Hello, i try to use the api of netbox to create a new virtual machine with this request { "name":"Server_1", "site":{"id":1,"slug":"site1","name":"site1"}, "cluster":{"id":1,"name":"demo"}, "role":{"slug":"Applicative Server","id":1,"name":"Applicative Server"}, "vcpus":4, "memory":4160, "disk":15, "tenant":{"slug":"example","id":1,"name":"Example"} } the reply : { "cluster": [ "Primary key must be an integer" ], "role": [ "Primary key must be an integer" ], "tenant": [ "Primary key must be an integer" ] } did you have a good exemple for me ?
adam closed this issue 2025-12-29 17:22:42 +01:00
Author
Owner

@Ti3o commented on GitHub (Nov 28, 2018):

ok i try with the id and it's work :
{
"name":"server_1",
"site":{"id":1,"slug":"site1","name":"site1"},
"cluster":1,
"vcpus":4,
"role":1,
"memory":4160,
"disk":15,
"tenant":1
}

@Ti3o commented on GitHub (Nov 28, 2018): ok i try with the id and it's work : { "name":"server_1", "site":{"id":1,"slug":"site1","name":"site1"}, "cluster":1, "vcpus":4, "role":1, "memory":4160, "disk":15, "tenant":1 }
Author
Owner

@jeremystretch commented on GitHub (Nov 28, 2018):

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

@jeremystretch commented on GitHub (Nov 28, 2018): Thank you for your interest in NetBox. GitHub issues are intended for reporting reproducible bugs and requesting features, and must be submitted using the template provided [here](https://raw.githubusercontent.com/digitalocean/netbox/develop/.github/ISSUE_TEMPLATE.md). For general discussion, questions, or assistance with installation issues, please post to our [mailing list](https://groups.google.com/forum/#!forum/netbox-discuss).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2151