netbox-pve-sync
Synchronize Proxmox Virtual Environment (PVE) information to a NetBox instance. This allows automatic tracking of Virtual Machines, disks, IP addresses/prefixes, MAC addresses, VLANs, ...
How does it work?
This script work by pulling VMs information from the PVE API and create/update/delete resources on NetBox.
Installation
This package is available on PyPi. You can install it using pip.
$ pip install netbox-pve-sync
Configuration
On NetBox
You'll need to create a dedicated user (ex: netbox-pve-sync) on your NetBox instance and then create a write API token.
The following env variables will need to be set:
- NB_API_URL: The URL to your NetBox instance. (ex: https://netbox.example.org)
- NB_API_TOKEN: The token created previously. (ex: f74cb99cf552b7005fd1a616b53efba2ce0c9656)
You can also set the NB_CLUSTER_ID env variable in order to indicate the ID of the cluster that will be used in
NetBox.
You'll also need to perform a minimal configuration on NetBox:
- Create the physical nodes hosting the cluster. (The name should match the one on Proxmox, so that the script can correctly link the VMs to the physical host)
- Create the cluster.
- Add the following Custom Fields:
| Name | Object types | Label | Type |
|---|---|---|---|
| autostart | Virtual Machine | Autostart | Boolean |
| replicated | Virtual Machine | Replicated | Boolean |
| ha | Virtual Machine | Failover | Boolean |
| backup | Virtual Disk | Backup | Boolean |
| dns_name | Prefix | DNS Name | Text |
On the PVE API
You'll need to create a dedicated user (ex: netsync) on your PVE cluster and then create an API token.
The user needs to have access to the VM.Monitor, Pool.Audit, VM.Audit, Sys.Audit permissions.
The following env variables will need to be set:
- PVE_API_HOST: The DNS/IP to your PVE instance. (ex: 10.10.0.10)
- PVE_API_USER: The username of the account created previously. (ex: netsync@pve)
- PVE_API_TOKEN: The name of the API token created previously. (ex: test-token)
- PVE_API_SECRET: The API token created previously (ex: 4d46dc0a-6363-47a2-98df-d5cdfefa33d2)
Executing the script
You can then execute the script using the following command:
PVE_API_HOST=xx PVE_API_USER=xx PVE_API_TOKEN=xx PVE_API_SECRET=xx NB_API_URL=xx NB_API_TOKEN=xx nbpxsync
Metadata
Release files for netbox-pve-sync 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| netbox_pve_sync-0.2.4.tar.gz | 18.3 kB | Without provenance | Details for netbox_pve_sync-0.2.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| netbox_pve_sync-0.2.4-py3-none-any.whl | Python 3 | none | any | Details for netbox_pve_sync-0.2.4-py3-none-any.whl |
Total release size: 37.2 kB
Release files / netbox_pve_sync-0.2.4.tar.gz
| Download URL | netbox_pve_sync-0.2.4.tar.gz |
|---|---|
| Size | 18.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2a56da1533f01a3bb5968fc8cf155b8b5b3b406e9be1c8d9227acb1488e67bb9
|
|
BLAKE2b-256 checksum How to use checksums |
69f6e52bce442aecedc20f5eda27e7f3d81bd3c2983d912085d2073e47ceadd5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / netbox_pve_sync-0.2.4-py3-none-any.whl
| Download URL | netbox_pve_sync-0.2.4-py3-none-any.whl |
|---|---|
| Size | 18.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
da609eaece500df3df86f4a018b750bee29e98a8534f6043a494ab9781d76df2
|
|
BLAKE2b-256 checksum How to use checksums |
37ced18ed9f714aaf0d6a6beb0715dcc9879597ac119025d26a5cc74fcd01e4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for netbox-pve-sync 0.2.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.