Proxmox VE Deployment
This guide covers automating PiVirt cluster deployments onto Proxmox VE environments using deployer and Proxmox REST APIs.
Prerequisites
Section titled “Prerequisites”Proxmox Requirements
Section titled “Proxmox Requirements”- Proxmox VE 8.0+
- VM templates for PiVirt nodes
- Shared storage (Ceph, NFS, or ZFS)
- Network with VLAN support
Credentials
Section titled “Credentials”providers: proxmox: enabled: true default_endpoint: "https://proxmox.pilab.hu:8006" default_user: "root@pam" token_ref: "vault:secret/data/proxmox#token" insecure: trueDeployment Configuration
Section titled “Deployment Configuration”Cluster Definition
Section titled “Cluster Definition”apiVersion: deployer.pilab.hu/v1kind: Deploymentmetadata: name: "pivirt-proxmox-staging"spec: provider: "proxmox" topology: control_plane: count: 3 template: "pivirt-cp-template" node: "proxmox-01" customization: cpu: 4 cores: 2 memory: 16Gi disk: 100Gi workers: count: 3 template: "pivirt-worker-template" node: "proxmox-02" customization: cpu: 8 cores: 4 memory: 32Gi disk: 200Gi
# VM customization customization: hostname_template: "pivirt-{{.Role}}-{{.Index}}" domain: "pilab.hu" dns_servers: - "10.0.1.5" - "10.0.1.6" ntp_servers: - "time.pilab.hu" timezone: "Europe/Budapest"
# Network configuration network: bridge: "vmbr0" vlan: 100 model: "virtio"
# Storage configuration storage: pool: "local-lvm" format: "raw"
cloud_init: template: "proxmox-node.yaml.tmpl" vars: pivirt_version: "v0.0.89" cluster_name: "pivirt-proxmox-staging"Create VM Templates
Section titled “Create VM Templates”Control Plane Template
Section titled “Control Plane Template”# Create base VM via Proxmox UI or CLIqm create 9000 \ --name pivirt-cp-base \ --memory 16384 \ --cores 4 \ --net0 virtio,bridge=vmbr0 \ --scsihw virtio-scsi-pci \ --scsi0 local-lvm:32 \ --ostype l26 \ --agent enabled=1
# Install Ubuntu 24.04qm start 9000
# Install PiVirt components# ... (install pivirtd, agent, pvcli)
# Shutdown and convert to templateqm shutdown 9000qm template 9000Worker Template
Section titled “Worker Template”# Similar process for worker templateqm create 9001 \ --name pivirt-worker-base \ --memory 32768 \ --cores 8 \ --net0 virtio,bridge=vmbr0 \ --scsihw virtio-scsi-pci \ --scsi0 local-lvm:64 \ --ostype l26 \ --agent enabled=1
# Install and configure# ...
qm template 9001Deployment Process
Section titled “Deployment Process”1. Plan Deployment
Section titled “1. Plan Deployment”deployer plan -f deploy/proxmox-cluster.yaml2. Apply Deployment
Section titled “2. Apply Deployment”deployer apply -f deploy/proxmox-cluster.yaml3. Monitor Progress
Section titled “3. Monitor Progress”deployer status -n pivirt-proxmox-stagingdeployer logs -n pivirt-proxmox-staging --follow4. Verify Deployment
Section titled “4. Verify Deployment”pvcli cluster get stagingpvcli cluster node listcloud-init Template
Section titled “cloud-init Template”#cloud-confighostname: {{ .node_name }}fqdn: {{ .node_name }}.pilab.hu
users: - name: pivirt groups: [sudo, docker, kvm] sudo: ALL=(ALL) NOPASSWD:ALL ssh_authorized_keys: - {{ .ssh_public_key }}
packages: - qemu-kvm - qemu-guest-agent - pivirt-agent - pvcli
runcmd: - systemctl enable --now qemu-guest-agent - systemctl enable --now pivirt-agent - systemctl enable --now pivirtd
final_message: "PiVirt node {{ .node_name }} provisioned on Proxmox"Proxmox-Specific Features
Section titled “Proxmox-Specific Features”QEMU Guest Agent
Section titled “QEMU Guest Agent”# Enable QEMU guest agentspec: agent: enabled: true type: "qemu"Backup Integration
Section titled “Backup Integration”# Use Proxmox backupvzdump <vmid> --mode snapshot --compress zstdLive Migration
Section titled “Live Migration”# Migrate VM between Proxmox nodesqm migrate <vmid> <target-node> --onlineTroubleshooting
Section titled “Troubleshooting”VM Won’t Start
Section titled “VM Won’t Start”# Check Proxmox logsqm status <vmid>qm config <vmid>
# Check QEMU logsqm monitor <vmid>Template Issues
Section titled “Template Issues”# List templatesqm list | grep template
# Convert back to VMqm template <vmid> --rollbackNetwork Issues
Section titled “Network Issues”# Check bridgebrctl show vmbr0
# Check VLANcat /proc/net/vlan/config