Skip to content

Commit fe47b31

Browse files
Merge pull request #35 from netboxlabs/features-2025.11.01
v2025.11.01 release
2 parents a0e3d89 + 774c3be commit fe47b31

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1785
-619
lines changed

README.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,11 @@ If you see errors like this...
3939
4040
Try uninstalling `mkdocs` from your package manager, (e.g. `brew uninstall mkdocs`) and just using the version installed by `pip`. It seems that `mkdocs` doesn't like it when you've installed it using different methods.
4141

42-
# What's New in 1.2.0
43-
- Adds LXC support
44-
- Adds the ability to define 'vmid' for both VM and LXC, rather than taking a default value from Proxmox
45-
- Adds "discovery" of Proxmox VM and LXC disks and auto-creation of VM disk objects in NetBox
46-
- Adds rudimentary Proxmox VM and LXC discovery through convenience script
47-
- Adds AWX initial setup through convenience script (uses awxkit)
48-
- Convenience script changes to accommodate LXC requirements
49-
- Can dynamically build webhooks and event rules from current AWX state through convenience script
50-
- Adds customization changes for LXC-specific requirements
42+
# What's New in 2025.11.01
43+
- Switches to calendar (as opposed to semantic) versioning
44+
- Adds Proxmox cluster and node(s) discovery through a new convenience script
45+
- Adds Proxmox VM migration to alternate Proxmox node(s) through events
46+
- Adds [NetBox Branching](https://netboxlabs.com/docs/extensions/branching/) support for Proxmox node and VM discovery
5147

5248
# Developers
5349
- Nate Patwardhan <[email protected]>
@@ -56,9 +52,10 @@ If you see errors like this...
5652

5753
## Known Issues
5854
- *Only* supports SCSI disk types (this is possibly fine as Proxmox predomininantly provisions disks as SCSI)
59-
- Does not currently support Proxmox VM creation to a Proxmox cluster, but is only node-based
55+
- LXC migration is not supported for myriad reasons
56+
- Proxmox "tags" are not supported (seeking community feedback around use cases)
6057

6158
## Roadmap -- Delivery
59+
- Use of NetBox Custom Objects for NetBox > 4.4
60+
- DNS update support via gss-tsig (requires NetBox `netbox-dns` plugin)
6261
- Integration with NetBox Discovery/Assurance
63-
- DNS update support (requires NetBox `netbox-dns` plugin)
64-
- Maybe evolve into to a NetBox plugin for Proxmox

ansible-tasks/collect-proxmox-vm.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

conf.d/netbox_setup_objects.yml-sample

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
proxmox_api_config:
2-
node: pve # or your Proxmox node name
2+
node: pve # or *a* Proxmox node name (even if clustered)
33
api_host: proxmox-ip-or-hostname
44
api_port: 8006
55
api_user: proxmox_api_user
@@ -13,11 +13,20 @@ netbox_api_config:
1313
api_token: netbox_api_secret_token
1414
verify_ssl: false # or true, up to you
1515
proxmox:
16-
cluster_name: proxmox-ve
16+
cluster_name: name-of-proxmox-cluster #(no longer required as it will be discovered)
17+
node_commands:
18+
dmidecode_command: /usr/sbin/dmidecode # required: where dmidecode lives on your system
19+
lshw_command: /usr/bin/lshw # required: where lshw lives on your system
20+
ethtool_command: /usr/sbin/ethtool # required: where ethtool lives on your system
21+
ipaddr_command: /usr/sbin/ip -br a # required: where ip command lives on your system
1722
netbox:
18-
cluster_role: Proxmox
19-
vm_role: "Proxmox VM"
20-
lxc_role: "Proxmox LXC"
23+
branch: name-of-branch-where-you-want-to-import-data # optional
24+
branch_timeout: integer-to-represent-seconds-for-branch-operation # optional
25+
site: Home Lab # optional
26+
cluster_role: Proxmox # required
27+
device_role: "Proxmox node" # required
28+
vm_role: "Proxmox VM" # required
29+
lxc_role: "Proxmox LXC" # required
2130
automation_type: choices are ansible_automation or flask_application
2231
ansible_automation:
2332
host: name or ip of AWX/Tower/AAP host

docs/configure-awx-aap.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ When you create *any* template in AWX for Proxmox automation, you will need to s
251251
| awx-proxmox-remove-vm-disk.yml | Removes a non-OS disk (i.e. not scsi0) from a Proxmox VM |
252252
| awx-proxmox-remove-vm.yml | Removes a Proxmox VM |
253253
| awx-proxmox-resize-vm-disk.yml | Resizes a Proxmox VM disk |
254-
| awx-proxmox-set-ipconfig0.yml | Sets ipconfig0 for Proxmox VM and adds ssh key|
254+
| awx-proxmox-set-ipconfig0.yml | Sets ipconfig0 for Proxmox VM and adds ssh key |
255255
| awx-proxmox-start-vm.yml | Starts Proxmox VM |
256256
| awx-proxmox-stop-vm.yml | Stops Proxmox VM |
257+
| awx-proxmox-migrate-vm.yml | Migrates Proxmox VM to an alternate Proxmox node |
257258

docs/netbox-event-rules-and-webhooks-flask.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Regardless of whether you are using a Flask (or other) application for Proxmox a
2222

2323
### Flask Application
2424

25-
As noted [here](#initial-configuration-flask-application-python), you will need to have a running Flask application *before* you can start handling events (i.e. object changes) inside of NetBox.
25+
You will need to have a running Flask application *before* you can start handling events (i.e. object changes) inside of NetBox.
2626

2727
#### Automated Webhook and Event Rules Configuration
2828

docs/proxmox-and-node-migration.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# NetBox and Proxmox Node Migration
2+
3+
It is well known that Proxmox can support both clustering and single nodes. When using a Proxmox cluster, one can select a respective virtual machine (VM) and migrate the VM to any available Proxmox nodes.
4+
5+
As NetBox requires that virtual machines are assigned to a virtual cluster, this gives you the ability to migrate virtual machines between Proxmox nodes. `netbox-proxmox-automation` 2025.11.01 implements an *experimental* feature that allows you to migrate Proxmox VMs between Proxmox nodes, simply when you make changes to the intended state of a Proxmox VM in NetBox. This is done through event-driven automation in `netbox-proxmox-automation`, such that changing the assigned `proxmox_node` custom field in NetBox will trigger an event -- and this event will migrate the VM from the existing Proxmox node to a specified Proxmox node. Whether you are using the included Flask application or are using AWX/Tower/AAP, both automation strategies should work for this purpose.
6+
7+
*NOTE: LXC migration is not supported. This is a technical blocker based on Proxmox currently.*
8+
9+
*NOTE 2: This only works for NetBox (Proxmox) VMs that are in a state of 'active' or 'offline'*
10+
11+
To do this, you must do three things before attempting to induce Proxmox VM migration by way of NetBox.
12+
13+
1. you have a running Proxmox cluster or clusters
14+
2. you have created a `netbox-proxmox-automation` configuration for each of your Proxmox clusters
15+
3. you have created all custom fields with the `netbox_setup_objects_and_custom_fields.py` script
16+
4. you have defined your automation strategy and run the `netbox_setup_webhook_and_event_rules.py` script
17+
5. your NetBox is up to date with VM and customization information
18+
19+
Once you have done the above, all that it takes to induce this automation is to select a Proxmox VM in NetBox, *edit* that object, toggle the name of the `proxmox_node` custom field, then click the Save button. This will kick off the (node) migration in Proxmox.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
- Virtual Machine Cluster (with Device mappings)
32+
33+
Once the Proxmox node(s) has/have been added to NetBox, you can start discovering VMs and LXCs in Proxmox.
34+
35+
`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.
36+
37+
```
38+
shell$ cd /path/to/netbox-proxmox-automation/setup
39+
40+
shell$ deactivate
41+
42+
shell$ python3 -m venv venv
43+
44+
shell$ source venv/bin/activate
45+
46+
shell$ pip install -r requirements.txt
47+
48+
shell$ ./netbox-discover-proxmox-cluster-and-nodes.py --config ../path/to/your-config.yml
49+
```
50+
51+
*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.*

docs/usage.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ For LXC automation, `netbox-proxmox-automation` uses LXC (container images) on P
1717

1818
NetBox models VMs in an intuitive way. You can define roles for VMs, such as for Proxmox, and from there you can define both VM state (Staged, Active, Offline, etc) and other resources like vcpus, memory, network configuration, VM disks, and more (through customizations in NetBox).
1919

20-
This automation is based on the premise(s) that:
20+
This automation *requires* that:
2121

2222
1. You are using Python (version 3)
23-
2. You are using NetBox 4.1.0 or newer (NetBox 3.7.x should also work)
24-
3. You have a running Proxmox instance or cluster
23+
2. You are using NetBox 4.3.7 or newer
24+
3. You are running Proxmox 8.4.x single node or cluster (Proxmox 9.x is *not* tested)
2525
4. You have a running [AWX](https://github.com/ansible/awx) instance or are running [your own web application](https://github.com/netboxlabs/netbox-proxmox-automation/tree/main/netbox-event-driven-automation-flask-app) to handle webhooks and event rules
2626
5. You have converted a cloud-init image to a Proxmox VM template
2727
6. Your Promox VM template(s) has/have qemu-guest-agent installed, and that qemu-guest-agent has been enabled via cloud-init
@@ -31,7 +31,7 @@ This automation is based on the premise(s) that:
3131

3232
## What this implementation *is not*
3333

34-
`netbox-proxmox-automation` is not currently a NetBox plugin, but this may change.
34+
`netbox-proxmox-automation` is not a NetBox plugin, and future aspirations of this implementation will employ [custom objects](https://github.com/netboxlabs/netbox-custom-objects).
3535

3636
[ProxBox](https://github.com/netdevopsbr/netbox-proxbox) is a neat implementation of pulling information from Proxmox into NetBox. ProxBox has its place, most certainly, but what it does is *not* the aim of `netbox-proxmox-automation`.
3737

legacy/README.TXT

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)