Netbox create vm #2050

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

Originally created by @FedorArbuzov on GitHub (Oct 8, 2018).

Hello! I recently started using api netbox and as it seems to me I found an error in the post method /virtualization/virtual-machines/. (request body {}) I'm trying to create a new machine, but get 500 error.

Here api request and response:
url: api/virtualization/virtual-machines/
request body: { "name": "vm-3"}

answer:
The complete exception is provided below:

<class 'django.db.utils.IntegrityError'>

null value in column "cluster_id" violates not-null constraint
DETAIL: Failing row contains (7, 2018-09-20, 2018-09-20 10:23:44.119076+00, vm-3, null, null, null, , null, null, null, null, null, 1, null).

Environment

  • Python version: 3.5.4
  • NetBox version: 2.4.3
Originally created by @FedorArbuzov on GitHub (Oct 8, 2018). Hello! I recently started using api netbox and as it seems to me I found an error in the post method /virtualization/virtual-machines/. (request body {}) I'm trying to create a new machine, but get 500 error. Here api request and response: url: api/virtualization/virtual-machines/ request body: { "name": "vm-3"} answer: The complete exception is provided below: <class 'django.db.utils.IntegrityError'> null value in column "cluster_id" violates not-null constraint DETAIL: Failing row contains (7, 2018-09-20, 2018-09-20 10:23:44.119076+00, vm-3, null, null, null, , null, null, null, null, null, 1, null). ### Environment * Python version: 3.5.4 * NetBox version: 2.4.3
adam closed this issue 2025-12-29 17:21:46 +01:00
Author
Owner

@sdktr commented on GitHub (Oct 8, 2018):

The "cluster_id" is a required field, hence your API call fails. You can always look in the /api/docs or the GUI to find the required fields on a create action.

@sdktr commented on GitHub (Oct 8, 2018): The ```"cluster_id"``` is a required field, hence your API call fails. You can always look in the /api/docs or the GUI to find the required fields on a create action.
Author
Owner

@jeremystretch commented on GitHub (Oct 9, 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 (Oct 9, 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#2050