You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/proxmox-templates.md
+13-12Lines changed: 13 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,23 @@
1
-
# Proxmox Templates
1
+
# Proxmox VM Templates
2
2
3
-
`netbox-proxmox-automation` is intended to make your life as simple as possible. Once you have a working Proxmox node (or cluster), have provisioned a Proxmox API token with the permissions noted above, a NetBox instance, a NetBox API token, the entire process of managing Proxmox VMs via NetBox involves these simple requirements.
3
+
`netbox-proxmox-automation` is intended to make your life as simple as possible. Once you have a working Proxmox node (or cluster), have provisioned a Proxmox API token (the permission is able to manage both VMs and storage), a NetBox instance, a NetBox API token, the entire process of managing Proxmox VMs via NetBox involves these simple requirements.
4
4
5
-
1. You have defined event rules and webhooks for VM operations in NetBox
6
-
2. You have a web service that handles events via webhooks
5
+
1. You have defined a webhook that will be used to facilitate your automation
6
+
2. You have defined an event rule that uses the webhook in Step 1 -- for automating Proxmox VM operations based on VM state in NetBox
7
+
3. You have a web application that handles events via webhooks
7
8
8
-
-You are running a web service that handles events via webhooks, e.g. [example-netbox-webhook-flask-app](https://github.com/netboxlabs/netbox-proxmox-automation/tree/main/example-netbox-webhook-flask-app)
9
+
-For example, [example-netbox-webhook-flask-app](https://github.com/netboxlabs/netbox-proxmox-automation/tree/main/example-netbox-webhook-flask-app) is an example web application that you can use to facilitate Proxmox automation by handling event rules from NetBox.
9
10
10
11
*-or-*
11
12
12
-
- You are running AWX and have created templates to handle events via webhooks
13
+
- You are running AWX and have created (project) templates to handle events via webhooks
13
14
14
15
15
16
## Initial Configuration: Creating Proxmox VM templates from (cloud-init) images
16
17
17
18
`netbox-proxmox-automation`*only* supports cloud-init images. The dynamic nature of Proxmox VM automation requires this implementation to be able to set things, during the Proxmox VM provisioning process, like network configuration, hostnames, and more. While it's *possible* that `netbox-proxmox-automation`*might* support your existing Proxmox VM templates, it's *highly* recommended that you follow the procedure below -- for the best results.
18
19
19
-
As a cloud-init image is basically "blank", meaning that there is not broad network or SSH key configuration, this allows us to have total flexibility in the way that this automation takes a *desired* Proxmox VM state from NetBox and generates anticipated changes to VMs -- in Proxmox.
20
+
As a cloud-init image is sufficient "bare bones", meaning that there is not broad network or SSH key or package configuration(s), this allows us to have total flexibility in the way that this automation takes a *desired* Proxmox VM state from NetBox and generates anticipated changes to VMs -- in Proxmox.
20
21
21
22
This process is [well documented](https://pve.proxmox.com/wiki/Cloud-Init_Support) by the Proxmox team. In the end it comes down to:
22
23
- logging into your Proxmox node(s) and running these commands as the 'root' user, or as a user who has adequate permissions to modify Proxmox VMs and the underlying storage
@@ -39,7 +40,7 @@ proxmox-ve-node# cd cloud-images/ubuntu
39
40
proxmox-ve-node# for r in jammy focal noble; do wget "https://cloud-images.ubuntu.com/${r}/current/${r}-server-cloudimg-amd64.img" & done
40
41
```
41
42
42
-
Then let the cloud-init images download. Once the downloads have completed, you might want to take backups of the original cloud-init images -- as we will proceed with modifying these cloud-init images slightly before converting them to Proxmox VM templates. Taking backups of the original cloud-init images is helpful should you ever need to revert any customization you did before converting the cloud-init images into Proxmox VM templates. Run this, again, as 'root' on the proxmox-node of your choice.
43
+
Then wait for the cloud-init images to download. Once the downloads have completed, you might want to take backups of the original cloud-init images -- as we will proceed with modifying these cloud-init images slightly before converting them to Proxmox VM templates. Taking backups of the original cloud-init images is helpful should you ever need to revert any customization you did before converting the cloud-init images into Proxmox VM templates. Run this, again, as 'root' on the proxmox-node of your choice.
43
44
44
45
```
45
46
proxmox-ve-node# cd /root/cloud-images/ubuntu
@@ -110,7 +111,7 @@ First, create the Proxmox VM, with a unique id, and configure its attributes. W
110
111
- create the Proxmox VM
111
112
- import the cloud-init image to the Proxmox VM
112
113
- set the SCSI (disk) hardware attributes for the Proxmox VM root disk
113
-
- map an IDE disk to the cloud-init image
114
+
- map an IDE disk to the cloud-init image (this will be used as a CD-ROM)
114
115
- define a boot disk for the Proxmox VM
115
116
- define a serial port such that the Proxmox VM is accessible through the Proxmox console
116
117
- set the QEMU agent to be enabled such that you can access various information from `qemu-guest-agent` when the Proxmox VM is running
@@ -188,14 +189,14 @@ proxmox-ve-node# qm set 9000 --agent enabled=1
188
189
update VM 9000: -agent enabled=1
189
190
```
190
191
191
-
Second, convert the Proxmox VM into a template. You can then use this Proxmox VM template in your `netbox-proxmox-automation` automation.
192
+
Second, convert the Proxmox VM into a template. You can then use this Proxmox VM template in your `netbox-proxmox-automation` automation.
192
193
193
-
Now convert the Proxmox VM to a template. *Note that this cannot be undone!*
194
+
*Note that this cannot be undone!*
194
195
195
196
```
196
197
proxmox-ve-node# qm template 9000
197
198
Renamed "vm-9000-disk-0" to "base-9000-disk-0" in volume group "pve"
198
199
Logical volume pve/base-9000-disk-0 changed.
199
200
```
200
201
201
-
You should now be able to use your Proxmox VM template, with a VM id (vmid) of 9000 (or whatever you choose) in your `netbox-proxmox-automation` automation.
202
+
You should now be able to use your Proxmox VM template, with a VM id (vmid) of 9000 (or whatever you chose) in your `netbox-proxmox-automation` automation.
0 commit comments