pve-template-vm/README.md

32 lines
1.7 KiB
Markdown
Raw Normal View History

2023-07-30 11:51:42 +02:00
# Create a VM template from the latest Debian release with settings appropriate for the CCCHH Proxmox clusters
2023-07-30 11:36:16 +02:00
2023-07-30 11:51:42 +02:00
## Prerequisites
2023-07-30 11:36:16 +02:00
2023-07-30 11:51:42 +02:00
The script uses the package [`libguestfs-tools`](https://libguestfs.org)' `virt-builder` to download and customize a Debian image. and then add it as a template to Proxmox.
2023-07-30 11:36:16 +02:00
2023-07-30 11:51:42 +02:00
## Building the Template
2023-07-30 11:36:16 +02:00
2023-07-30 11:51:42 +02:00
### Configuration Options
Verify that the settings at the beginning of the script are suitable to the cluster you want to create the template from.
2023-07-30 11:36:16 +02:00
2023-07-30 11:51:42 +02:00
| Variable | Default | Description |
| --------- | ------------------ | ---------------------------------------------------------------------- |
| `VMID` | 9023 | ID the template should have in Proxmox |
| `STORAGE` | `local-zfs` | Pool the disks should be created in |
| `OS` | `debian-12` | `virt-builder` name of the OS to install |
| `NAME` | `chaos-${OS}-tmpl` | name of the template |
| `BRIDGE` | `vmbr0,tag=208` | name of the bridge to use and any parameters needed, like the VLAN tag |
2023-07-30 11:36:16 +02:00
2023-07-30 11:51:42 +02:00
### `authorized_keys`
2023-07-30 11:36:16 +02:00
2023-07-30 11:51:42 +02:00
The script expects `authorized_keys` to be in the current directory. Copy the correct contents from the [appropriate repository](https://gitlab.hamburg.ccc.de/ccchh/infrastructure-authorized-keys).
2023-07-30 11:36:16 +02:00
2023-07-30 11:51:42 +02:00
### Run the Script
2023-07-30 11:36:16 +02:00
2023-07-30 11:51:42 +02:00
```shell
./build-proxmox-template
```
2023-07-30 11:36:16 +02:00
2023-07-30 11:51:42 +02:00
## Cloning the Template
2023-07-30 11:36:16 +02:00
2023-07-30 11:51:42 +02:00
Please use "Full Clone" when creating a VM based on this template. Using Linked Clone means that the template's disk cannot be recreated since the linked clones need it. This means that the script cannot update the template.