🚀 A powerful shell script for automating cloud-init VM template creation in Proxmox VE. Streamline your VM deployment with smart defaults, custom configurations, and comprehensive error handling.
-
Automated VM template creation from cloud images
-
Smart defaults with customizable options
-
SSD optimization support
-
Custom cloud-init configuration
-
Automatic resource detection
-
Dry-run capability
-
Comprehensive error handling
The following commands must be available on your Proxmox host:
-
qm(Proxmox VM management) -
wget(File downloads) -
qemu-img(Image manipulation) -
pvesm(Proxmox storage management)
./pveci [OPTIONS]
Options:
-u, --url URL Cloud image URL (required)
-i, --id ID VM ID (auto-detected if not specified)
-n, --name NAME VM name (auto-generated if not specified)
-m, --memory MB Memory in MB (default: 1024)
-c, --cores NUM Number of CPU cores (default: 1)
-s, --size SIZE Disk size (default: 10G)
-b, --bridge BRIDGE Network bridge (default: vmbr0)
-t, --storage STORAGE Storage pool (auto-detected if not specified)
--cloud-config PATH Use custom cloud-init config (file path or URL)
--dry-run Show what would be done without executing
--no-ssd Disable SSD optimization (default: enabled)
-h, --help Show this help message-
Basic usage with Ubuntu cloud image:
./pveci -u https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img --name ubuntu-cloud
-
Custom configuration:
./pveci --url https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img \ --id 100 \ --name ubuntu-template \ --memory 2048 \ --cores 2 \ --size 20G -
Using custom cloud-init config:
./pveci -u https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img \ --cloud-config ./templates/base-and-docker.yaml
The repository includes two predefined cloud-init configurations:
-
base.yaml- Minimal configuration with:- qemu-guest-agent installation
- SSH service enablement
-
base-and-docker.yaml- Extended configuration with:- Everything from base.yaml
- Docker installation and configuration
- User docker group management
- Custom MOTD
- Secure SSH configuration
If you just need the script without templates:
# Download and install the script
wget https://raw.githubusercontent.com/kricha/cloud-init-helper/main/pveci && \
chmod +x pveci && \
mv pveci /usr/local/bin/
# Verify installation
pveci --help# Create templates directory and download
mkdir -p templates/ && cd templates/ && \
wget https://raw.githubusercontent.com/kricha/cloud-init-helper/main/templates/base.yaml \
https://raw.githubusercontent.com/kricha/cloud-init-helper/main/templates/base-and-docker.yaml
# Create templates directory
mkdir -p templates/
mv base*.yaml templates/To get the complete repository with all examples and documentation:
-
Clone the repository:
git clone https://github.com/kricha/cloud-init-helper.git
-
Make the script executable:
chmod +x pveci
-
Optional: Move to system path:
sudo cp pveci /usr/local/bin/
After installation, you can verify that everything is working correctly:
-
Check script availability:
pveci --help
-
Verify templates:
# For quick install ls ~/.config/pveci/templates/ # For repository install ls templates/
-
Test with dry-run:
pveci --url https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img --dry-run
Contributions are welcome! Please feel free to submit pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.