vCenter

Edition: PROPro ENTERPRISEEnterprise

Connector for: VMware vCenter Server · VMware ESXi

What it does

The vCenter connector reads VMware vCenter Server (or a standalone ESXi host) and keeps NetBox in step with it. Each run reads datacenters, clusters, ESXi hosts, virtual machines and port groups, then the cinqstack Sync Engine makes a plan of what would change in NetBox. Nothing is written until an operator applies the plan (see Collect, review and approve). Every property it reads is listed on What each connector reads.

When a plan is applied, cinqstack writes:

In NetBoxWhat is written
ClustersOne cluster per vCenter cluster that a scope rule maps to a site, with the cluster type set on the job.
Virtual machinesName, status, site, cluster, ESXi host, vCPUs, memory, platform (the guest OS), tenant, tag, and the first line of the VM's vCenter notes as its description. Templates are skipped.
VM interfacesOne per network adapter, with its MAC address, connected or not, the port group in the description, and the port group's VLAN as the untagged access VLAN.
IP addressesThe guest IP addresses VMware Tools reports, with the guest host name as DNS name. The first matching IPv4 address becomes the VM's primary IP.
Virtual disksOne per disk, with its size.
ESXi hostsOnly hosts that already exist as NetBox devices: serial, cluster, platform (VMware ESXi <version>) and the management IP of vmk0, on an interface named vmk0.

Power state maps to NetBox status: powered on is Active; powered off and suspended are Offline.

Each VM is known across runs by its vCenter instance uuid. A VM created directly on a standalone ESXi host has none, so it is known by its BIOS uuid instead (or, failing that, its managed object id), and the run notes it: <VM>: no vCenter instance uuid (created on the host directly); known by its BIOS uuid instead.

Identity. Every object the sync owns carries the vcenter_id custom field: the vCenter instance ID and the object's own ID. A renamed VM, a vMotion or a move to another cluster is therefore an update, never a duplicate. Objects already in NetBox without the field are adopted on first match: a VM by name within its site, a host by serial and then by short name, a cluster by name within its site.

Changes between runs. Each run compares vCenter with the previous run of the same job and records every VM that was added, removed or changed. Routine noise is left out: a VM that only moved host inside its cluster (DRS or vMotion), and a guest OS or IP address that disappears because VMware Tools stopped reporting. Each change gets risk labels and waits for someone to acknowledge it (see VM changes).

The collected data also feeds the Virtual view of the topology and its checks.

What it needs in NetBox

Created on demand, if missing: the cluster type, platforms (one per guest OS and ESXi version) and the vcenter-orphan tag.

If the optional last_synced and sync_source fields exist, each written VM and host gets the time and cinqstack vCenter sync.

For sharper risk labels on VM changes, classify your VLANs with a Purdue level (see Segmentation). Without it, changes are still recorded.

Setting up

1. Add a connection

An admin opens Connectors › vCenter and clicks Connections. A read-only role on the vCenter is enough. The page says: "Read-only accounts are enough: the sync only reads vCenter. Passwords are encrypted at rest."

FieldWhat to enter
NameA name for the list, for example "Site 2 vCenter". Blank uses the host.
HostThe vCenter or ESXi host name, for example vcenter.example.com.
Port443 by default.
UsernameA read-only account, for example [email protected].
PasswordStored encrypted.
Verify TLS certificateOn by default. The cinqstack host must trust the vCenter certificate.

Then choose:

A connection that a job uses cannot be deleted: That connection is used by a job.

2. Create a job

An operator or admin clicks New job on the Connectors › vCenter page.

FieldDefaultWhat it does
NameA name for the job.
vCenterThe connection to read.
NetBox cluster typeVMware vSphereThe cluster type for new clusters. Created if missing.
ESXi hosts (serial, cluster, ESXi version, management IP) for hosts that exist in NetBoxonWrites host details to matching devices.
VM interfaces, MAC addresses and port-group VLANsonWrites VM interfaces.
Guest IP addresses, DNS names and primary IPonWrites the addresses VMware Tools reports. Needs interfaces on.
Skip IPs of powered-off VMsonLeaves addresses alone for VMs that are not powered on: a powered-off VM's guest IP is the last one VMware Tools saw and may now belong to a running VM. On by default for new jobs; existing jobs keep their setting.
Virtual disksonWrites virtual disks.
VMs that disappear from vCenterMark offline and tag vcenter-orphanOr Leave them alone. VMs are never deleted.
EnabledonA disabled job is not run by its schedule.

Schedule sets when the job runs: Manual, Repeating (every 5 minutes or more, optionally inside a daily time window), At a set time (chosen days) or Cron.

What happens after a run sets how far the job may write on its own:

LevelWhat happens
Report onlyCollect and plan. Never write to NetBox, even by hand.
Review firstEvery plan waits for someone to review and apply it.
Automatic updatesUpdates to existing objects are written. New VMs and clusters, and VMs marked offline, wait for review.
Fully automaticEverything is written, including new VMs and clusters and VMs marked offline.

Safety limit holds an automatic write for review when a run would change more than the number of objects you set.

Click Save. Until the job has scope rules, it says Job saved. Add scope rules to decide what goes to which site.

3. Add scope rules

Scope rules decide which part of vCenter goes to which NetBox site. They are listed under Scope rules on the job page. 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.

A vCenter job's scope rules: two cluster rules mapped to sites and an "Everything else" rule that is excluded.
A vCenter job's scope rules: two cluster rules mapped to sites and an "Everything else" rule that is excluded.
WhenMatches on
Datacenter name matches (regex)The vCenter datacenter.
Cluster name matches (regex)The cluster.
VM name matches (regex)The VM name.
Host name matches (regex)The ESXi host name.
Everything elseAnything still unmatched.

Each rule also has a Pattern (a regular expression, for example ^rot- or OT-CL01$), an Order (100 by default), a NetBox site slug (blank excludes), and an optional Tenant slug and Tag slug. Patterns ignore upper and lower case. A pattern that is not a valid regular expression never matches.

Clusters are placed by datacenter and cluster rules only; hosts also by host name; VMs by all four. If a VM and its cluster end up at different sites, the VM is synced without a cluster (see Limits).

Several jobs can share one vCenter, each with its own rules. A job only reports on, and only retires, the VMs its own rules take.

4. Run it

On the Connectors › vCenter 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.

To collect through a Relay edge ENTERPRISEEnterprise, route the job under Connectors › Relay › Routes.

Problems with logins, certificates or ports are covered in vCenter troubleshooting.

Reading the results

The run page

Each run has a page at /vcenter/runs/<run id>. Its status is one of queued, running, relay (waiting for a Relay edge), planned, apply queued, applying, applied or failed. A live run shows its progress in a console.

The tiles give the counts: VMs in scope, new VMs, VMs changed, new clusters, hosts to update, hosts not in NetBox and VMs gone.

If the plan can be written, an operator sees "Review the plan below, then write it to NetBox." with an Apply button. A report-only job has no Apply button.

Above the full plan, the report groups what the run found, each group with what to do:

GroupWhat it means
NetBox refused some writesAfter apply. Everything else was written. Often a duplicate name or a missing site.
Scope rule points at a site that does not existNothing matched by that rule is synced.
VM and its cluster map to different sitesThose VMs are synced without a cluster.
ESXi host not in NetBoxAdd the host as a device, or rename the existing one, and the next run links it.
ESXi host details differ from NetBoxApplying writes the vCenter values.
New clusters, Cluster details differCreated or updated on apply.
New virtual machinesCreated on apply.
VM … changedOne group per field (for example VM memory changed). Applying writes the vCenter value.
Gone from vCenterIn NetBox but no longer in vCenter. Applying marks them offline and tags them vcenter-orphan.
Out of scopeNo rule matched, or a rule excludes them.
Already up to dateNothing to do.

Under Full plan come Changed in vCenter since the previous run, then tables of Clusters, ESXi hosts and Virtual machines (switch between New and changed and All in scope), Gone from vCenter, and the VMs out of scope. On a job's first run you see "First run of this job: the vCenter snapshot is the baseline for future change tracking."

After apply, Apply result shows how many objects were created and updated, each error, and every operation.

Job history (from the run page or the job name) lists past runs with their counts.

What apply does

Apply is queued (Apply queued. The worker writes the reviewed changes to NetBox.) and the worker writes the whole plan. It looks object IDs and tags up again, so a slightly old plan does not fail, and compares each planned field with what NetBox holds now: a field someone edited in NetBox since the plan is left alone and listed under Apply result and in the run report as "changed in NetBox since the plan", with a Plan again button. VM interfaces and virtual disks that are gone from vCenter are deleted from the NetBox VM. An IP address already assigned to another object in NetBox is left alone and reported. If NetBox cannot be reached, the run goes back to planned with Apply failed: ….

Applying is blocked while more devices are counted than the licence covers or a schema field the sync needs is missing. Pause all automation stops only automatic applies; an operator can still apply by hand.

VM changes

Each recorded VM change appears under Review › Changes (filter on VMs) and opens in the side panel. The panel's header names the change in one pill: New VM (not in NetBox yet), Changed VM (changed in vCenter since the last sync) or Gone from vCenter. A change someone has already reviewed adds its status, such as acknowledged, and the change's risk labels follow at the same size. The panel shows what changed (before and after), the VM's power, vCPUs, memory and disk, its host, cluster, site and addresses, its network adapters, and earlier changes to the same VM.

A VM change: what vCenter changed since the last run, before and after, waiting for acknowledgement.
A VM change: what vCenter changed since the last run, before and after, waiting for acknowledgement.
A vCenter run's changes: a VM gone from vCenter, a new VM and a VM whose status changed.
A vCenter run's changes: a VM gone from vCenter, a new VM and a VM whose status changed.

An operator or admin acknowledges a change with an optional Ticket and Note, then Acknowledge. cinqstack then writes a journal entry on the VM in NetBox naming who acknowledged it, the ticket and the note (unless journal entries are turned off). A VM removed before it ever reached NetBox gets no entry.

Virtual switches on a host

A host's physical NIC says little on its own: what matters is the virtual switch above it. For an ESXi host of a vCenter job, the Interfaces tab of the device draws the host's virtual switching from the job's latest run, whichever connector keeps the device in NetBox. Read it left to right, as the traffic goes:

The check is part of the drawing. A VLAN the switch port does not carry in NetBox shows on that port as a red chip, and the way from its port group through the switch to that uplink is drawn in the warning colour. It is the Virtual view's NetBox port VLANs don't match the VMs on <host> check, shown where the cable is; the NIC's row in the list above the drawing carries the same warning, with See it in Virtual. A port that NetBox records no VLANs for is marked not checked. Where vCenter did not say which NICs a switch uses, the switch ends in a dashed stub that says so, and those NICs are drawn below with no switch behind them.

Point at a port group, an uplink or a VM, or move to it with the keyboard, and its whole path lights up. A VM opens in the Virtual view, the small arrow after an uplink's name opens its interface in NetBox, and the far end opens that device. As a table, under the drawing, holds the same as text. In the interface list each NIC carries its name in vCenter and uplink of <switch>; where NetBox has no speed for the NIC, the speed vCenter reports is shown, marked vCenter.

cinqstack matches a NIC to its NetBox interface by MAC address, then by name (an interface named vmnic0, or one that names it in its description), and last by position, when the host has as many physical interfaces left as NICs. The tab says when it matched by position. Only a match by MAC address or by name checks a port against the VLANs of its own switch; any other port is checked against every VLAN the host's VMs use, as the Virtual view always has. Record each NIC's MAC address in NetBox for an exact match.

This is a view in cinqstack: virtual switches and port groups are not written to NetBox. After an upgrade, run the job once: an older run draws the switches without their uplinks, and the tab says so. A standalone ESXi host has standard switches only. A VMkernel adapter's VLAN (management, vMotion) is shown and not checked.

Findings it raises

Findings appear in the Findings inbox PROPro.

From the vCenter connector:

FindingSeverity
ESXi host <name> is not in NetBoxLow
<VM>: <risk labels>, one per VM change not yet acknowledgedThe change's highest risk, below

Risk labels on a VM change. A VM counts as part of the control system when its name, NetBox role, notes or guest host name contain words such as SCADA, HMI, historian, EWS, PLC, OPC, DCS, MES or safety.

LabelSeverity
Control-system VM removed from vCenter, Control-system VM powered offHigh
VM removed from vCenter, VM powered offMedium
New VM on OT VLAN … (a VLAN classified level 0 to 3)High
New VMLow
Moved off an OT network, from VLAN … to VLAN …, Moved onto an OT network, from VLAN … to VLAN …High
VLAN changed, from VLAN … to VLAN …, Port group changed (same VLAN)High for a control-system VM or an OT VLAN, otherwise medium
Network adapter disconnectedHigh for a control-system VM, otherwise medium
Network adapter added, removed or reconnected, IP address changed, Moved to another clusterMedium
Resources changed, Renamed, Guest OS changedLow

From the Virtual view of the topology PROPro, for each site with vCenter data:

FindingSeverity
<host> runs an IT VM next to OT VMs (<levels>): one hypervisor serves OT and IT VMsHigh
<host> runs a DMZ VM next to control VMs (<levels>)Medium
<VM> has adapters in OT and IT networksHigh
NetBox port VLANs don't match the VMs on <host>: a VLAN the VMs use is not carried by a switch port the host is cabled to in NetBoxMedium when the difference points to another zone, otherwise low
<cluster> is … short to restart its VMs if a host fails, or <cluster> has no second hostHigh if the cluster runs OT VMs, otherwise medium

These resolve on the next scan after the cause is gone.

Limits