A Python tool for automating the creation of cloud-init enabled VM templates in Proxmox VE. Simplifies downloading official cloud images and converting them into ready-to-use templates.
- Automated template creation from cloud images
- Automatic VM ID assignment (starting at 900)
- Smart storage selection from available pools
- Cloud-init support with SSH key integration
- Support for 15+ operating systems (Linux & BSD)
- Interactive command-line interface
- QEMU guest agent pre-configured
- Automatic cleanup of temporary files
- Proxmox VE 7.0 or higher
- Python 3
- Root or sudo access
- Sufficient storage space
- Internet connection
- SSH public key (recommended)
SSH into your Proxmox node and run:
python3 <(curl -s https://raw.githubusercontent.com/rothdennis/Proxmox-Templates/main/generate.py)Or download first:
wget https://raw.githubusercontent.com/rothdennis/Proxmox-Templates/main/generate.py
python3 generate.pyFollow the interactive prompts to:
- Choose cloud-init method (manual credentials or cloud-init file)
- Enter credentials manually OR select a cloud-init file from snippet storage
- Select storage pool
- Choose OS and version
The script automatically assigns the next available VM ID starting at 900.
Note: The operating system images and their download URLs are now maintained in the
images.jsonconfiguration file. This allows for easier updates and maintenance of supported distributions without modifying the main script.
- Alma Linux
- Alpine Linux
- Amazon Linux
- Arch Linux
- CentOS Stream
- Debian
- Fedora Cloud
- Flatcar Container Linux
- FreeBSD
- Kali Linux
- openSUSE tumbleweed
- Oracle Linux
- Rocky Linux
- Ubuntu
| Component | Default Configuration |
|---|---|
| Memory | 1 GB |
| CPU | 2 cores, 1 socket, host type |
| Network | VirtIO on vmbr0 |
| Disk | 10 GB, VirtIO SCSI |
| Cloud-Init | Enabled with SSH keys |
| Guest Agent | Enabled |
Via Web UI:
- Right-click template → Clone → Full Clone
- Set VM ID and name
- Customize settings as needed
Via CLI:
qm clone <template-id> <new-vm-id> --name <vm-name> --fullResize disk after cloning:
qm resize <vm-id> scsi0 +10GTo change default settings you can modify the script parameters:
# python3 generate.py --help
usage: Proxmox VM Template Generator [-h] [--memory MEMORY] [--cores CORES] [--sockets SOCKETS] [--disk-size DISK_SIZE] [--cpu CPU] [--network-bridge NETWORK_BRIDGE] [--ipv4 IPV4] [--ipv6 IPV6] [--prefix PREFIX] [--id-start ID_START]
Generate Proxmox VM templates from cloud images with custom configurations.
options:
-h, --help show this help message and exit
--memory MEMORY set the memory size in MB (default: 1024)
--cores CORES set the number of CPU cores (default: 2)
--sockets SOCKETS set the number of CPU sockets (default: 1)
--disk-size DISK_SIZE
set the disk size (default: 10G)
--cpu CPU set the CPU type (default: host)
--network-bridge NETWORK_BRIDGE
set the network bridge (default: vmbr0)
--ipv4 IPV4 set the IPv4 configuration (default: dhcp)
--ipv6 IPV6 set the IPv6 configuration (default: auto)
--prefix PREFIX set the prefix for VM template names (default: template)
--id-start ID_START set the starting ID for VM templates (default: 900)When running the script, you will be prompted to choose between:
- Enter credentials manually - Enter username, password, and SSH key interactively
- Use a cloud-init file - Select from available cloud-init files in snippet-enabled storage pools
If you choose to use a cloud-init file, the script will list all .yaml and .yml files found in the snippets directory of storage pools that support the snippets content type. Files are displayed in the Proxmox volume format (e.g., local:snippets/userconfig.yaml).
To add cloud-init files for selection:
- Ensure you have a storage pool with
snippetscontent type enabled - Place your cloud-init YAML files in the storage's snippets directory
- Run the script and select option 2 to choose from available files
Example cloud-init user-data file:
#cloud-config
users:
- name: myuser
sudo: ALL=(ALL) NOPASSWD:ALL
ssh_authorized_keys:
- ssh-rsa AAAA...your-public-key...Storage not found:
- Check available storage:
pvesm status - Ensure storage is enabled and mounted
Download fails:
- Check internet connectivity
- Verify Proxmox can reach external URLs
- Try again
Insufficient disk space:
- Free up space or choose different storage
- Cloud images typically need 2-5GB during download
Template not visible:
- Refresh Proxmox web interface
- Check correct node in tree view
Check logs:
tail -f /var/log/pve/tasks/activeContributions welcome! Please:
- Report issues on GitHub
- Submit pull requests with clear descriptions
- Test changes on Proxmox
- Update documentation
- Based on this project by apalrd
- Cloud images provided by respective Linux distributions
Note: Unofficial tool, not affiliated with Proxmox Server Solutions GmbH or any Linux distributions.
Made with ❤️ for the Proxmox community
