Skip to content

Sync VMware VM Host to NetBox "Host Device" field #516

Description

@tikondrus

Feature Request: Sync VMware VM Host to NetBox "Host Device" field

Problem

When synchronizing VMware virtual machines to NetBox, netbox-sync creates and updates both ESXi hosts (Devices) and Virtual Machines. However, the relationship between a VM and its current ESXi host is not populated in NetBox.

As a result, the Host Device field of Virtual Machines remains empty, even though this information is available from vCenter (vm.runtime.host).

Proposed Enhancement

Add support for populating the NetBox Virtual Machine Host Device field during VMware synchronization.

Suggested behavior:

  1. Determine the ESXi host running the VM from vCenter (vm.runtime.host).
  2. Match the corresponding ESXi host Device already created by netbox-sync.
  3. Set the VM's host_device attribute in NetBox.
  4. Update the relationship on subsequent sync runs if a VM is migrated to another ESXi host (vMotion).

Benefits

  • Improved visibility of VM placement in NetBox.
  • Easier troubleshooting and capacity management.
  • Accurate representation of the current VMware environment.
  • Automatic tracking of vMotion operations.
  • Better integration with NetBox virtualization features.

Additional Notes

This could be implemented either:

  • always enabled by default, or
  • through an optional configuration parameter (for example sync_vm_host_device = true).

Since netbox-sync already synchronizes both ESXi hosts and VMs, all required information appears to be available from the VMware source and should not require additional vCenter permissions.

Thank you for considering this enhancement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions