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.3.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.3-py3-none-any.whl (30.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for netbox_vcenter_server-0.4.3.tar.gz
Algorithm Hash digest
SHA256 32ce871c29c2f2adbf1055db6254f92547480df45841506179675682ae872199
MD5 025db5abafce499b9286d4c0693b1d41
BLAKE2b-256 a7d9268a90160adfa70fcc14ee9766a9b60c74e7a6d14b59e148924cf27c1742

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_vcenter_server-0.4.3.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.3-py3-none-any.whl.

File metadata

File hashes

Hashes for netbox_vcenter_server-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f6a8b10115c74f0d580b1637abf0dde267b3c2bcbc072c1ec56f0a2cae766bdc
MD5 e2e760cf3dfa15c01354266c7b8aefd7
BLAKE2b-256 13b5365a93b94a1fb1915448b73336b557cc96e1271b7de9d6e6e1aef889ba79

See more details on using hashes here.

Provenance

The following attestation bundles were made for netbox_vcenter_server-0.4.3-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