Proxmox
Edition: PROPro ENTERPRISEEnterprise
What it does
The Proxmox connector reads a Proxmox VE cluster, or a single Proxmox VE node, and keeps NetBox in step with it. Each run reads the cluster, its nodes with their bridges, VLAN-aware bridges and bonds, the SDN zones and vnets, and every QEMU virtual machine and LXC container with its NICs, VLANs and disks, then makes a plan of what would change in NetBox. Nothing is written until an operator applies the plan (see Collect, review and approve).
cinqstack reads the Proxmox API over HTTPS with an API token, and sends only read requests. Nothing is installed, changed or written on the cluster. Every request it sends is listed on What each connector reads.
When a plan is applied, cinqstack writes:
| In NetBox | What is written |
|---|---|
| Cluster | The Proxmox cluster, by its name, with the cluster type set on the job. A single node that is in no cluster is its own cluster, named after the node. |
| Virtual machines | One per QEMU VM and, with LXC containers on, one per container: name, status, site, cluster, node device, vCPUs, memory, platform (the guest OS), tenant, tag, and the first line of the guest's notes as its description. |
| VM interfaces | One per NIC, named as Proxmox names it (net0, net1), with its MAC address, connected or not (a NIC with Disconnect ticked is disabled), the bridge or SDN vnet in the description, and its VLAN tag as its untagged VLAN. A NIC on an SDN vnet of a VLAN zone gets the vnet's tag. |
| IP addresses | The addresses the guest reports, with their prefix length: from the QEMU guest agent for a running VM, from the container itself for a running container, else from the configuration (a container's static ip=, a VM's cloud-init ipconfig). The first IPv4 address becomes the guest's primary IP. |
| Virtual disks | One per disk, named by its slot (scsi0, virtio0, rootfs, mp0), with its size. CD-ROM drives, cloud-init drives, EFI and TPM state disks are left out. |
| The nodes | Only when the node already exists as a NetBox device: cluster, platform (Proxmox VE 9.2) and the management IP, on the interface that carries it (for example vmbr0). |
| The nodes' networks | With The nodes' bridges, bonds and VLAN interfaces on: each Linux or Open vSwitch bridge as an interface of type Bridge, each bond as a LAG, each VLAN interface as a Virtual interface with its parent; a bond's member ports are put in its LAG and a bridge's ports bridged to it, when those ports exist on the device. |
Power state maps to NetBox status: running is Active; stopped and paused are Offline.
Containers. NetBox has no separate kind for containers: an LXC container is a virtual machine in NetBox, with its own interfaces, addresses and disks. Its platform is its OS type (Debian, Ubuntu, Alpine Linux and so on).
Identity. Every object the sync owns carries the proxmox_id custom field: the cluster's name and the guest's ID (plant-pve/101), plant-pve/cluster for the cluster and plant-pve/node/pve-a1 for a node. A guest's ID is unique in its cluster and stays the same when the guest is renamed or migrated, so a rename is an update and a migration moves the VM to its new node, never a duplicate. Objects already in NetBox without the field are adopted on first match: a VM by name within its site, a node by its short name, a cluster by name within its site.
Changes between runs. Each run compares the cluster with the previous run of the same job. The run page shows what was added, removed or changed in Proxmox since then.
What it needs in NetBox
- The
proxmox_idcustom field on virtual machines, clusters and devices. It is part of the schema pack: create it under Settings › NetBox schema. See The NetBox schema. - Sites whose slugs match the scope rules. A rule that names a site NetBox lacks syncs nothing.
- The nodes as devices, at the site their scope rule maps to, for node details and networks to be written. The sync never creates node devices. Proxmox does not report a node's serial number, so a node is matched by name.
- Tenants named on scope rules must already exist. A tag slug NetBox does not know is created when the plan is applied.
- VLANs at the site, for VM interfaces to get their VLAN. If no VLAN with that ID is available at the site, the interface is written without one.
- A NetBox write token, for apply only.
Created on demand, if missing: the cluster type, platforms (one per guest OS and Proxmox VE version) and the proxmox-orphan tag.
If the optional last_synced and sync_source fields exist, each written VM and node gets the time and cinqstack Proxmox sync.
Setting up
1. Prepare a read-only token
On any node of the cluster, as root (in the shell, or the same steps under Datacenter › Permissions in the web interface):
pveum user add cinqstack@pve --comment "cinqstack, read-only"
pveum acl modify / --users cinqstack@pve --roles PVEAuditor
pveum user token add cinqstack@pve sync --privsep 0
The last command prints the token's secret once: keep it for the connection. PVEAuditor is Proxmox's built-in read-only role. On / it can read the cluster, the nodes and their networks, SDN, every guest's configuration, and the guest agent's network information; it cannot start, stop, change or create anything. A token with --privsep 0 has the user's rights and no more. To give the token its own rights instead, create it with --privsep 1 and give the token the same role: pveum acl modify / --tokens 'cinqstack@pve!sync' --roles PVEAuditor.
Allow TCP 8006 from the cinqstack server to the node you will connect to.
2. Add a connection
An admin opens Connectors › Proxmox and clicks Connections. Each connection is one Proxmox cluster, reached through any one of its nodes.
| Field | What to enter |
|---|---|
| Name | A name for the list, for example "Halden Proxmox". Blank uses the cluster's name. |
| Host | Any node of the cluster, by name or IP address, for example pve01.halden.example. |
| API port | 8006 by default. |
| API token ID | The token, as user@realm!tokenid, for example cinqstack@pve!sync. |
| Token secret | The secret Proxmox printed when the token was made. Stored encrypted. |
| Verify the certificate | Tick it when the node has a certificate from your own CA or a public one, installed on the cinqstack server. Leave it off for the node's own self-signed certificate. |
| Certificate fingerprint | Optional: the node certificate's SHA-256 fingerprint, as Datacenter › node › System › Certificates shows it. Blank reads it now and pins it. |
Then choose:
- Test connects and shows
Connected to <host>:<port>: Proxmox VE <version>, cluster <name>, <n> nodes, <n> guests (token: read-only).When the token may also change things, the test names those rights: a PVEAuditor token is enough. Nothing is saved. - Test and save saves the connection if the test passes. Without verification, the node's certificate is pinned: if it later changes (renewed, or another server answers), runs stop until the connection is tested and saved again.
A connection that a job uses cannot be deleted: That connection is used by a job.
3. Create a job
An operator or admin clicks New job on the Connectors › Proxmox page.
| Field | Default | What it does |
|---|---|---|
| Name | A name for the job. | |
| Proxmox cluster | The connection to read. | |
| NetBox cluster type | Proxmox VE | The cluster type for new clusters. Created if missing. |
| LXC containers, as virtual machines in NetBox | on | Reads containers too. Off: only QEMU VMs. |
| Guest addresses and OS from the QEMU guest agent and from running containers | on | Asks the guest agent of running VMs that have it enabled, and running containers, for their addresses and OS. |
| The nodes (cluster, Proxmox VE version, management IP) when they exist in NetBox | on | Writes node details to the matching devices. |
| The nodes' bridges, bonds and VLAN interfaces, as virtual interfaces on their devices | on | Writes the nodes' networks (see above). Needs the nodes option on. |
| VM and container NICs, MAC addresses and VLAN tags | on | Writes VM interfaces. |
| Guest IP addresses and primary IP | on | Writes the addresses the guests report. Needs interfaces on. |
| Skip IPs of stopped guests | off | Leaves addresses alone for guests that are not running. |
| Virtual disks | on | Writes virtual disks. |
| Guests that disappear from Proxmox | Mark offline and tag proxmox-orphan | Or Leave them alone. VMs are never deleted. |
| Watch for changes | off | Change signals PROPro: see below. |
| Minutes between checks | 2 | How often a watching job checks the cluster, 1 to 60. |
| Enabled | on | A disabled job is not run by its schedule. |
Schedule, What happens after a run and Safety limit work as for every sync job (see vCenter).
4. Add scope rules
Scope rules decide which guests go to which NetBox site. Rules run top to bottom (lowest Order first) and the first match wins. A rule with no site excludes what it matches. Anything no rule matches is left out.
| When | Matches on |
|---|---|
| Node name matches (regex) | The node the guest runs on. Also places the node's device and the cluster. |
| Cluster name matches (regex; a single node is its own cluster) | The cluster's name, or for a single node its own name. |
| VM or container name matches (regex) | The guest's name. |
| Proxmox tag matches (regex) | Any of the guest's Proxmox tags, for example ^ot$. |
| Everything else | Anything still unmatched. |
For a cluster whose guests all belong to one site, one Cluster name rule is enough. Patterns ignore upper and lower case. A node-name rule follows a guest when it migrates to a node another rule maps elsewhere.
5. Run it
On the Connectors › Proxmox page, click Run now beside the job, or use the arrow next to it and choose Run with debug log. Scheduled runs start on their own.
6. Watch for changes
With Watch for changes on (and Change signals on under Settings › Modules), the worker checks the cluster every few minutes with the job's token: three small reads, the cluster's status, its task log and its resource list. When guests changed since the last check, a read of just those guests starts at once and is planned like any run of the job: Review first stays Review first, automatic stays automatic. The run page says what triggered it, for example Triggered by Proxmox's task log: guest opc-gw-01 reconfigured.
What starts a read of just the guests concerned: a guest created, cloned, restored, destroyed, reconfigured, resized, started, stopped, suspended, rebooted or migrated, and a node that comes online or goes offline. Most configuration edits in Proxmox (a container's memory, a VM's cores) leave no task; the resource list shows them, so they are found too. What starts one full read instead: a node joining or leaving the cluster, a network reload on a node, a different cluster answering, the task log going back or no longer reaching back to the last check, and changes to more than 50 guests at once. The first check only records where the log stands. A check that fails waits twice as long before the next one, at most 30 minutes, and finds what changed meanwhile when the cluster answers again. A job read through a Relay edge is not watched.
The Change signals page under Settings shows, per Proxmox job, when it last checked, what it saw, the signals and the reads they started. The scheduled run still reads everything.
Reading the results
The run page
Each run has a page at /proxmox/runs/<run id>, with the same status, tiles, report, plan and apply result as a vCenter run. The Connectors › Proxmox page lists each job's nodes from its latest read: state, guests running, threads, memory, bridges (VLAN-aware marked) and bonds.
The report has one group of its own: Some details could not be read from Proxmox. It lists each node or guest that did not answer in full: a node that is offline, a guest whose configuration the token may not read. Such a guest is kept as the cluster's list shows it, and nothing of it (no NIC, no disk) is removed in NetBox on that run.
A run with nothing to write ends as analysed rather than waiting for review. When the cluster's answer looks incomplete (no guests where the last run had some), nothing is retired: the report shows Looked gone, kept this run, and the next complete run decides again. When more than 30% of the job's VMs would be retired at once, the run waits for review whatever the automation level. When the connection now reaches a different cluster, that run is a fresh baseline and no guest is reported as removed.
Findings it raises
The Proxmox connector raises no findings of its own yet. Its nodes and guests are in NetBox like any other, so the Findings PROPro that read NetBox (segmentation, data quality) cover them.
Limits
- Read-only towards Proxmox. Only GET requests are sent; the product's Proxmox client refuses any other method. The PVEAuditor role is the second guard.
- One cluster per connection. Any node reaches the whole cluster. A single node is read the same way.
- Nodes report no serial number. A node is matched to its NetBox device by name; nodes are never created.
- Only the VLAN tag is written. A NIC's trunk list (
trunks=) is in the interface description, not written as tagged VLANs. - Guest addresses need the guest agent in a VM. Without it a VM's addresses come only from its cloud-init configuration; a stopped container's only from its static configuration. Only addresses with a prefix length are written.
- Node interfaces are never deleted, and a description someone wrote on them is kept. Physical ports are linked to their bond or bridge only when they already exist on the device.
- Apply deletes VM interfaces and virtual disks that are gone from the guest, and only those the plan lists. A guest Proxmox could not read in full keeps all of its NICs and disks. Nothing else is deleted in NetBox. Guests that leave the cluster are marked offline (and give up their primary IP), and only at sites this job's rules sync to.
- A guest ID reused for a new guest after the old one was destroyed is the same VM in NetBox, as in Proxmox's own ID; a full read between the two shows the old one gone first.
- Two connections to clusters or single nodes with the same name share the same
proxmox_idkeys: keep them in different jobs and sites. The connection test says so when it happens. - No VM change records yet. The run page shows what changed between runs, but Proxmox changes are not yet recorded under Review › Changes with risk labels, and the Virtual view of the topology does not draw Proxmox yet.
- Relay. A Proxmox job cannot be routed to a Relay edge yet: it is read from the cinqstack server.