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 NetBoxWhat is written
ClusterThe 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 machinesOne 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 interfacesOne 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 addressesThe 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 disksOne 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 nodesOnly 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' networksWith 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

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.

FieldWhat to enter
NameA name for the list, for example "Halden Proxmox". Blank uses the cluster's name.
HostAny node of the cluster, by name or IP address, for example pve01.halden.example.
API port8006 by default.
API token IDThe token, as user@realm!tokenid, for example cinqstack@pve!sync.
Token secretThe secret Proxmox printed when the token was made. Stored encrypted.
Verify the certificateTick 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 fingerprintOptional: the node certificate's SHA-256 fingerprint, as Datacenter › node › System › Certificates shows it. Blank reads it now and pins it.

Then choose:

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.

FieldDefaultWhat it does
NameA name for the job.
Proxmox clusterThe connection to read.
NetBox cluster typeProxmox VEThe cluster type for new clusters. Created if missing.
LXC containers, as virtual machines in NetBoxonReads containers too. Off: only QEMU VMs.
Guest addresses and OS from the QEMU guest agent and from running containersonAsks 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 NetBoxonWrites node details to the matching devices.
The nodes' bridges, bonds and VLAN interfaces, as virtual interfaces on their devicesonWrites the nodes' networks (see above). Needs the nodes option on.
VM and container NICs, MAC addresses and VLAN tagsonWrites VM interfaces.
Guest IP addresses and primary IPonWrites the addresses the guests report. Needs interfaces on.
Skip IPs of stopped guestsoffLeaves addresses alone for guests that are not running.
Virtual disksonWrites virtual disks.
Guests that disappear from ProxmoxMark offline and tag proxmox-orphanOr Leave them alone. VMs are never deleted.
Watch for changesoffChange signals PROPro: see below.
Minutes between checks2How often a watching job checks the cluster, 1 to 60.
EnabledonA 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.

WhenMatches 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 elseAnything 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