# Technical Information (/docs/integrations/vmware-vcenter/vmware-vcenter-tech-info)



## VMware vCenter to NetBox Object Mapping [#vmware-vcenter-to-netbox-object-mapping]

## Object Type Mapping Table [#object-type-mapping-table]

| **vCenter Object**         | **NetBox Object** | **Key Attributes**                                                                                                                                                                                                                                                                                                                                                                                   |
| -------------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Datacenter`               | `ClusterGroup`    | `name`, `description`, `tags`                                                                                                                                                                                                                                                                                                                                                                        |
| `Cluster`                  | `Cluster`         | `name` (prefixed with the vCenter host when `CLUSTER_NAME_VCENTER_PREFIX` is set), `group` (ClusterGroup), `type` "VMware vSphere", `scope_site` or `scope_site_group`, `tenant` (when `DEFAULT_TENANT` is set), `custom_fields.vcenter_cluster_moid`, `custom_fields.vcenter_server` (when `VCENTER_SERVER_FIELD` is on)                                                                            |
| Host tag `netbox_site:*`   | `Site`            | `name` from tag value; default "DefaultSite"                                                                                                                                                                                                                                                                                                                                                         |
| Multi-site cluster         | `SiteGroup`       | `name` "SiteGroup-\{cluster.name}" (prefixed with the vCenter host when `CLUSTER_NAME_VCENTER_PREFIX` is set)                                                                                                                                                                                                                                                                                        |
| `ESXi Host`                | `Device`          | `name`, `manufacturer`, `device_type`, `serial`, `platform`, `status`, `site`, `cluster`, `custom_fields.vcenter_host_moid`, `custom_fields.vcenter_datacenter`, `custom_fields.vcenter_host_cpu_cores`, `custom_fields.vcenter_host_cpu_model`, `custom_fields.vcenter_host_memory_gb`, `tenant` (when `DEFAULT_TENANT` is set), `custom_fields.vcenter_server` (when `VCENTER_SERVER_FIELD` is on) |
| Host hardware model        | `DeviceType`      | `model`, `manufacturer`                                                                                                                                                                                                                                                                                                                                                                              |
| `config.product.fullName`  | `Platform`        | `name` (e.g. "VMware ESXi 7.0.0")                                                                                                                                                                                                                                                                                                                                                                    |
| *(static)*                 | `DeviceRole`      | `name` "ESXi Host"                                                                                                                                                                                                                                                                                                                                                                                   |
| Host vNIC / pNIC           | `Interface`       | `name`, `primary_mac_address`, `type` "other", `enabled`                                                                                                                                                                                                                                                                                                                                             |
| `Virtual Machine`          | `VirtualMachine`  | `name`, `status`, `vcpus`, `memory`, `cluster`, `site`, `custom_fields.vcenter_vm_uuid`, `custom_fields.vcenter_datacenter`, `tenant` (when `DEFAULT_TENANT` is set), `custom_fields.vcenter_server` (when `VCENTER_SERVER_FIELD` is on)                                                                                                                                                             |
| *(static)*                 | `DeviceRole`      | `name` "Virtual Machine"                                                                                                                                                                                                                                                                                                                                                                             |
| `config.guestFullName`     | `Platform`        | `name` (guest OS full name)                                                                                                                                                                                                                                                                                                                                                                          |
| VM network adapter         | `VMInterface`     | `name`, `enabled`, `primary_mac_address`, `description`, `mtu`                                                                                                                                                                                                                                                                                                                                       |
| VM disk (FileBackingInfo)  | `VirtualDisk`     | `name`, `size` (MB), `custom_fields.vcenter_datastore_name`, `custom_fields.vcenter_vmdk_path`                                                                                                                                                                                                                                                                                                       |
| Host vNIC IP / VM guest IP | `IPAddress`       | `address` (CIDR), assigned to `Interface` or `VMInterface`                                                                                                                                                                                                                                                                                                                                           |
| Interface / VM adapter MAC | `MACAddress`      | `mac_address` (uppercase)                                                                                                                                                                                                                                                                                                                                                                            |
| *(static)*                 | `ClusterType`     | `name` "VMware vSphere"                                                                                                                                                                                                                                                                                                                                                                              |
| `summary.hardware.vendor`  | `Manufacturer`    | `name` (per-host hardware vendor)                                                                                                                                                                                                                                                                                                                                                                    |

## Field Mapping Details [#field-mapping-details]

### Host Status Mapping [#host-status-mapping]

Host power\_state in the integration is set only to "poweredOn" or "poweredOff" from runtime.powerState.

| **vCenter Power State**     | **NetBox Status** |
| --------------------------- | ----------------- |
| `poweredOn`                 | `active`          |
| `poweredOff` (or any other) | `offline`         |

### VM Status Mapping [#vm-status-mapping]

| **vCenter Power State** | **NetBox Status** |
| ----------------------- | ----------------- |
| `poweredOn`             | `active`          |
| `poweredOff`            | `offline`         |
| `suspended`             | `staged`          |
| Any other value         | `offline`         |

### Interface Type Mapping [#interface-type-mapping]

| **vCenter Interface** | **NetBox Type**         |
| --------------------- | ----------------------- |
| Host vNIC / pNIC      | `other`                 |
| VM network adapter    | `virtual` (VMInterface) |

### Site Discovery Logic [#site-discovery-logic]

1. **Tag-based**: Host tags fetched via vCenter REST API (cis/tagging). First tag matching `netbox_site:*` gives site name (value after colon, trimmed).
2. **Default**: Hosts without such a tag are assigned to site "DefaultSite".
3. **Sites created**: One NetBox Site per unique site name discovered from tags; if none, a single Site "DefaultSite" is created.

### Cluster Scoping Logic [#cluster-scoping-logic]

| **Host site distribution**     | **Cluster scope**                                                                                                                                                                                                                                                   |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| All hosts in one site          | `scope_site` (that site)                                                                                                                                                                                                                                            |
| Hosts in multiple sites        | New SiteGroup "SiteGroup-\{cluster.name}" created (prefixed like the cluster name when `CLUSTER_NAME_VCENTER_PREFIX` is set); cluster uses `scope_site_group`; each child site gets `custom_fields.parent_site_groups_json` (JSON array referencing the SiteGroup). |
| No site info (all DefaultSite) | `scope_site` (DefaultSite)                                                                                                                                                                                                                                          |

Standalone hosts (ComputeResource but not ClusterComputeResource) are grouped into a synthetic cluster per datacenter, named `{datacenter}-StandaloneHostsCluster`, or `{vcenter} / {datacenter}-StandaloneHostsCluster` when `CLUSTER_NAME_VCENTER_PREFIX` is set. It gets `DEFAULT_TENANT`, but not the `vcenter_server` or `vcenter_cluster_moid` custom fields.

### IP Address Processing [#ip-address-processing]

* **Host**: vNIC `spec.ip.ipAddress` and `spec.ip.subnetMask` converted to CIDR (prefix length from mask); pNICs have no IPs.
* **VM**: From `vm.guest.net[].ipConfig.ipAddress[]`; subnetMask used for CIDR when present, else /32.
* **Primary IP**: First IPv4 and first IPv6 (by iteration order) on host or VM set as primary\_ip4 / primary\_ip6.

### MTU Discovery (VM interfaces) [#mtu-discovery-vm-interfaces]

* **Standard vSwitch**: Host networkConfig.portgroup → vswitchName → networkInfo.vswitch → mtu.
* **Distributed vSwitch**: device.backing (DistributedVirtualPortBackingInfo) → host.configManager.dvsManager → switch by uuid → config.maxMtu.
* **Fallback**: None if not found.

## Policy Configuration [#policy-configuration]

* **BOOTSTRAP** (optional): When true, only static entities (custom fields, manufacturer) are created; no vCenter connection.
* **VCENTER\_HOST** (required when not BOOTSTRAP): vCenter hostname or IP.
* **VCENTER\_USER** (required when not BOOTSTRAP): Username for authentication.
* **VCENTER\_PWD** (required when not BOOTSTRAP): Password for authentication.
* **SKIP\_SSL** (optional): If true, SSL certificate validation is disabled for the vCenter connection. vCenter's certificate is otherwise checked against the public certificate authorities built into the agent container image. The integration cannot be given an internal CA: it ignores `REQUESTS_CA_BUNDLE` and has no CA setting. If vCenter's certificate is signed by an internal CA, set `SKIP_SSL: true`.
* **CLUSTER\_NAME\_VCENTER\_PREFIX** (optional): Prefixes every cluster name with the vCenter it came from, as `{vcenter} / {cluster}`, so same-named clusters from different vCenters stay separate in NetBox. `fqdn` uses `VCENTER_HOST` as configured; `short` uses its first DNS label (or the whole value for an IP address). Any port is left out. `none` or unset means no prefix. Any other value fails the run. The prefix also applies to the standalone-hosts cluster and to `SiteGroup-{cluster}` site groups, but not to the cluster group, which keeps the datacenter name. Names longer than 100 characters are cut to 100, and a warning is logged. When you turn the prefix on or change it, vSphere clusters are renamed in place. Standalone-hosts clusters and site groups are created again under the new name, and the old ones stay in NetBox until you delete them.
* **VCENTER\_SERVER\_FIELD** (optional): If true, creates the `vcenter_server` custom field and sets it to `VCENTER_HOST` on every ESXi host device, virtual machine and cluster. The synthetic standalone-hosts cluster doesn't get it. Default false.
* **DEFAULT\_TENANT** (optional): Name of a NetBox tenant to assign to every ESXi host device, virtual machine and cluster. It must match an existing tenant name exactly, otherwise a new tenant with that name is created. On devices and virtual machines the tenant is part of matching; on clusters it only records ownership. Unset or empty means no tenant.
* **Scope – datacenters** (optional): List of datacenter names to ingest; default all. Use `["*"]` for wildcard. Invalid names cause validation to fail after fetching datacenters.

Connection uses the vSphere VI/JSON API with retry (3 attempts). Proxy support via HTTPS\_PROXY/HTTP\_PROXY, honoring NO\_PROXY.

## Custom Fields [#custom-fields]

| **Custom Field**          | **Object Type**                              | **Purpose**                                                                                                                                       |
| ------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `vcenter_vm_uuid`         | Virtual Machine                              | VM UUID from vCenter (config.uuid)                                                                                                                |
| `vcenter_datastore_name`  | Virtual Disk                                 | Datastore name for the disk backing                                                                                                               |
| `vcenter_vmdk_path`       | Virtual Disk                                 | VMDK file path (backing.fileName)                                                                                                                 |
| `vcenter_host_moid`       | Device (ESXi host)                           | Host Managed Object ID (MOID)                                                                                                                     |
| `vcenter_host_cpu_cores`  | Device (ESXi host)                           | Number of logical CPU cores on the host                                                                                                           |
| `vcenter_host_cpu_model`  | Device (ESXi host)                           | CPU model string from host hardware info                                                                                                          |
| `vcenter_host_memory_gb`  | Device (ESXi host)                           | Total host memory in gigabytes                                                                                                                    |
| `vcenter_cluster_moid`    | Cluster                                      | Cluster MOID when available                                                                                                                       |
| `vcenter_datacenter`      | Device, Virtual Machine                      | Datacenter name containing the object                                                                                                             |
| `vcenter_server`          | Device (ESXi host), Virtual Machine, Cluster | vCenter server (`VCENTER_HOST`) the object was discovered from; only when `VCENTER_SERVER_FIELD` is true. Not set on the standalone-hosts cluster |
| `parent_site_groups_json` | Site                                         | JSON array of SiteGroup references; populated when a cluster spans multiple sites                                                                 |

## Tags and Metadata [#tags-and-metadata]

All created entities are tagged with:

* `vmware`
* `vcenter`
* `discovered`

Site names are derived from host tags (`netbox_site:siteName`); other tag values are not copied onto entities.

## API and Behavior Notes [#api-and-behavior-notes]

* **APIs**: vSphere VI/JSON for inventory and properties; vCenter REST API for tagging (cis/session, tagging/tag-association, tagging/tag/id).
* **Data flow**: Fetch datacenters and hosts (with tags) → fetch clusters and VMs → build ClusterGroups, Sites, ClusterType → build Clusters (with SiteGroups when multi-site) → build Hosts (devices, interfaces, IPs, MACs) → build VMs (interfaces, disks, IPs, MACs).
* **Manufacturer**: One manufacturer entity; set to "VMware" in bootstrap, then overwritten by each host's hardware.vendor during host build (typically same vendor across hosts).
* **Entity order**: Custom fields, manufacturer (bootstrap only), cluster\_type, cluster\_groups, site\_groups, sites, clusters, devices, virtual\_machines, interfaces, vm\_interfaces, mac\_addresses, ip\_addresses, virtual\_disks. DeviceType, DeviceRole, and Platform are not emitted as standalone entities; they are embedded in Device and VirtualMachine.
