|
| 1 | +# Discover Proxmox Clusters and Nodes |
| 2 | + |
| 3 | +Starting with `netbox-proxmox-automation` 2025.11.01, you are able to discover Proxmox cluster and nodes information by way of a convenience script, `netbox-discover-proxmox-cluster-and-nodes.py`. `netbox-discover-proxmox-cluster-and-nodes.py` is located under the `setup` directory; you should run this script *before* attempting to "discover" VMs and/or LXCs and importing them into NetBox. |
| 4 | + |
| 5 | +*Note that you must follow the steps in [this document](./netbox-customization.md) before running this convenience script!* |
| 6 | + |
| 7 | +In NetBox, *all* virtual machines, or in the parlance of Proxmox (virtual machines and/or LXC), are required to be associated with a virtualization cluster in NetBox. Therefore, whether you have a single-node Proxmox installation or have implemented a Proxmox cluster, *all* of your Proxmox installations will be reflected as clusters in NetBox. Given that, `netbox-discover-proxmox-cluster-and-nodes.py` collects the following information about your Proxmox cluster and nodes. |
| 8 | + |
| 9 | + - Make and manufacturer of underlying hardware that's running Proxmox |
| 10 | + - CPU and memory information for each node that's running Proxmox |
| 11 | + - Serial number |
| 12 | + - Network interfaces (name, type, MAC address, enabled) |
| 13 | + - IP addresses |
| 14 | + - Proxmox version and release level, i.e. Platform |
| 15 | + |
| 16 | +*You will need the following commands to be installed on your Proxmox node(s) for this to work, and you'll need root access (direct or via sudo) for this to work*: |
| 17 | + |
| 18 | + - dmidecode |
| 19 | + - 'ethtool' command |
| 20 | + - 'ip' command |
| 21 | + - lshw |
| 22 | + |
| 23 | +After collecting this information, `netbox-discover-proxmox-cluster-and-nodes.py` turns around and creates the related objects in NetBox. |
| 24 | + |
| 25 | + - Manufacturer |
| 26 | + - Device Roles |
| 27 | + - Platforms |
| 28 | + - Device Types |
| 29 | + - Devices |
| 30 | + - IP Addresses (for Devices with interface mappings) |
| 31 | + |
| 32 | +Once the Proxmox node(s) has/have been added to NetBox, you can start discovering VMs and LXCs in Proxmox. |
| 33 | + |
| 34 | +`netbox-proxmox-automation` has a sample config file under the `conf.d` directory that's called `netbox_setup_objects.yml-sample`. Make a copy of `netbox_setup_objects.yml-sample` to the location of your choice. Then run `./setup/netbox-discover-proxmox-cluster-and-nodes.py` as follows. |
| 35 | + |
| 36 | +``` |
| 37 | +shell$ cd /path/to/netbox-proxmox-automation/setup |
| 38 | +
|
| 39 | +shell$ deactivate |
| 40 | +
|
| 41 | +shell$ python3 -m venv venv |
| 42 | +
|
| 43 | +shell$ source venv/bin/activate |
| 44 | +
|
| 45 | +shell$ pip install -r requirements.txt |
| 46 | +
|
| 47 | +shell$ ./netbox-discover-proxmox-cluster-and-nodes.py --config ../path/to/your-config.yml |
| 48 | +``` |
| 49 | + |
| 50 | +*Note that you will need one config file for each Proxmox cluster, or in the case of multiple, single Proxmox nodes, you will need a config file for each of those.* |
0 commit comments