Skip to main content

NetBox plugin for viewing and importing VMs from VMware vCenter servers

Project description

NetBox vCenter Server Plugin

NetBox vCenter Server Plugin

A NetBox plugin for viewing and importing VMs from VMware vCenter servers.

NetBox Version Python Version vSphere Version License PyPI

Features

  • Multi-vCenter Support - Connect to multiple vCenter servers (cached separately)
  • VM Dashboard - View all VMs from vCenter with power state, vCPUs, memory, and disk
  • VM Import - Import VMs from vCenter into NetBox with one click
  • Comparison View - Compare vCenter VMs with NetBox to find differences
  • Manual Cache Control - Data persists until you click Refresh
  • MFA/2FA Support - Works with environments requiring multi-factor authentication

Requirements

  • NetBox 4.0 or higher
  • Python 3.10+
  • VMware vSphere 7.0+ (tested with vSphere 8.0.3)

Installation

From PyPI (recommended)

pip install netbox-vcenter-server

From Source

git clone https://github.com/sieteunoseis/netbox-vcenter-server.git
cd netbox-vcenter-server
pip install -e .

Docker Installation

Add to your NetBox Docker requirements file:

# requirements-extra.txt
netbox-vcenter-server

Configuration

Add the plugin to your NetBox configuration:

# configuration.py or plugins.py

PLUGINS = [
    'netbox_vcenter',
]

PLUGINS_CONFIG = {
    'netbox_vcenter': {
        # Required: List of vCenter servers to choose from
        'vcenter_servers': [
            'vc-server1.example.com',
            'vc-server2.example.com',
        ],
        # Connection settings
        'timeout': 60,       # Timeout for vCenter connections (seconds)
        'verify_ssl': False, # SSL verification (False for self-signed certs)
        # MFA/2FA settings (optional)
        'mfa_enabled': True,  # Show MFA warning in UI
        'mfa_label': 'MFA',   # Label shown in UI (e.g., "Duo", "2FA", "MFA")
        'mfa_message': 'Check your authenticator after clicking Connect & Sync.',
        # Name matching for duplicate detection
        # Options: "exact" (full name), "hostname" (strip domain), "regex"
        'name_match_mode': 'hostname',
        'name_match_pattern': r'^([^.]+)',  # Used with "regex" mode
        # Import settings
        'normalize_imported_name': True,  # "WebServer01.example.com" -> "webserver01"
        'default_tag': '',      # Tag slug to apply (e.g., "vcenter-sync")
        'default_role': '',     # Role slug (e.g., "server")
        'default_platform': '', # Platform slug (e.g., "vmware")
    }
}

Usage

Syncing VMs from vCenter

  1. Navigate to Plugins > vCenter Dashboard
  2. Select a vCenter server from the dropdown
  3. Enter your username and password
  4. Click Connect & Sync
  5. If MFA is enabled, approve the authentication prompt
  6. VMs will be fetched and cached (data persists until you click Refresh)

Importing VMs to NetBox

  1. From the VM list, check the boxes next to VMs you want to import
  2. Click Import Selected to NetBox
  3. Select the target NetBox cluster
  4. Click Import
  5. VMs are created in NetBox with vCPUs, memory, disk, and status

Comparing vCenter with NetBox

  1. Navigate to Plugins > Compare with NetBox
  2. Select a vCenter server
  3. View:
    • Only in vCenter - VMs that can be imported
    • Only in NetBox - VMs not found in vCenter (orphaned?)
    • Spec Differences - VMs with mismatched vCPUs, memory, or disk

Screenshots

Coming soon

Troubleshooting

Connection errors

  • Verify vCenter hostname is reachable from the NetBox server
  • Check that credentials are correct (use domain\username format)
  • For self-signed certificates, set verify_ssl: False
  • If using MFA/2FA, ensure you approve the authentication prompt promptly

Authentication issues

  • Use format DOMAIN\username or username@domain
  • Ensure the account has at least read-only access to vCenter

Development

Setup

git clone https://github.com/sieteunoseis/netbox-vcenter-server.git
cd netbox-vcenter-server
pip install -e ".[dev]"

Code Style

black netbox_vcenter/
isort netbox_vcenter/
flake8 netbox_vcenter/

Changelog

See CHANGELOG.md for release history.

Support

If you find this plugin helpful, consider supporting development:

Buy Me A Coffee

License

Apache License 2.0 - See LICENSE for details.

Author

sieteunoseis (@sieteunoseis)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netbox_vcenter_server-0.4.4.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netbox_vcenter_server-0.4.4-py3-none-any.whl (30.1 kB view details)

Uploaded Python 3

File details

Details for the file netbox_vcenter_server-0.4.4.tar.gz.

File metadata

  • Download URL: netbox_vcenter_server-0.4.4.tar.gz
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for netbox_vcenter_server-0.4.4.tar.gz
Algorithm Hash digest
SHA256 e679e209da436661bf1ec948177edbd8145174db6cf28c783f19ada618d2a4d9
MD5 8b4144b32fed952dcec32f17dbd1cd78
BLAKE2b-256 87b61776dcb719efffb110ea5e8efe6b20d60686efcba77d2d1bee5bfc73f77b

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_vcenter_server-0.4.4.tar.gz:

Publisher: release.yml on sieteunoseis/netbox-vcenter-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file netbox_vcenter_server-0.4.4-py3-none-any.whl.

File metadata

File hashes

Hashes for netbox_vcenter_server-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a053c49aa7a624def378f19c8f3affd72fbcbc50d4fd1bcc8c91f2516758ca64
MD5 5d4546a35aeab5268bbcdd9bf23a6fef
BLAKE2b-256 8428b67f72c8072bc93cb1d2d7d9655686c3f625225a9bded4166579aa77c726

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_vcenter_server-0.4.4-py3-none-any.whl:

Publisher: release.yml on sieteunoseis/netbox-vcenter-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page