netdevopsbr / netbox-proxbox

Netbox Plugin for integration between Proxmox and Netbox
Apache License 2.0
349 stars 53 forks source link

Unable to add PVE nodes to Netbox #157

Open UntestedEngineer opened 10 months ago

UntestedEngineer commented 10 months ago

I am using version 0.0.5 in a Netbox 3.6.5 container installed via pip. For some reason the pve devices fail to add to the DCIM section and I can't figure out why. I enabled logging as per the directions, however there isn't enough visibility into the actual POST action to see what is trying to be inserted:

Bad Request: /api/dcim/devices/ 10.42.10.1 - - [13/Nov/2023:16:58:44 +0000] "POST /api/dcim/devices/ HTTP/1.1" 400 36 "-" "python-requests/2.31.0" http://netbox-svc-tcp.production.svc.cluster.local:80 "POST /api/dcim/devices/ HTTP/1.1" 400 36 [proxbox_api.create.node] Creation of NODE failed.

UntestedEngineer commented 10 months ago

Appears related to this under create > dcim.py

Currently this

def node(proxmox_node):
    ....
    node_json["device_role"] = extras.role(role_id = NETBOX_NODE_ROLE_ID).id

Should be this:

def node(proxmox_node):
    ....
    node_json["role"] = extras.role(role_id = NETBOX_NODE_ROLE_ID).id

As of Netbox 3.6 device_role is deprecated which is annoying because the netbox Swagger REST API still has device_role. I compiled this from the "main" branch and was able to successfully add the pve nodes.

fabriciopiccinin commented 10 months ago

Bom Dia Consigo adicionar somente um pve por vez ele não deixar adicionar mais que um.