5f114d9845f747aa7f22175c941888297872c8d2
pve-lab: Local Proxmox VE test cluster (nested in libvirt/KVM)
Stands up a disposable 2-node Proxmox VE 9.2 cluster plus a dedicated
storage VM that serves both NFS and iSCSI, all as nested VMs on this
machine via qemu:///system. Intended for testing software that drives a
Proxmox cluster.
pve-net (NAT 10.10.10.0/24, gw .1)
├── pve1 10.10.10.11 PVE node 4 vCPU / 8 GB / 48 GB
├── pve2 10.10.10.12 PVE node 4 vCPU / 8 GB / 48 GB
└── pvestore 10.10.10.13 Debian 13 2 vCPU / 2 GB (NFS + iSCSI target)
Shared storage exposed to the cluster:
- lab-nfs — NFS share
/srv/nfs(images, ISOs, backups, containers) - lab-lvm — shared LVM volume group
pve_sharedon an iSCSI LUN
Requirements
- Linux host with KVM + nested virtualization enabled.
libvirt,virt-install,qemu-img,genisoimage,docker,sshpass.sudo(the0*/teardownscripts manage the system libvirt instance).- Internet access to
*.proxmox.comandcloud.debian.org.
Usage
Run in order from this directory:
./00-prereqs.sh # libvirtd, KVM checks, SSH key, dirs
./01-network.sh # define + start the pve-net network
./02-download-iso.sh # fetch + verify the Proxmox ISO
./03-build-autoinstall-isos.sh # bake per-node unattended-install ISOs (docker)
./04-install-nodes.sh # unattended-install pve1 + pve2 (several minutes)
./05-storage-vm.sh # provision the NFS + iSCSI storage VM
./06-form-cluster.sh # create the cluster + join pve2
./07-add-shared-storage.sh # wire lab-nfs + lab-lvm into the datacenter
./verify.sh # end-to-end checks incl. a cross-node migration
Config (IPs, sizing, password, ISO version) lives in lab.env.
Access
- Web UI: https://10.10.10.11:8006 and https://10.10.10.12:8006
- Login:
root/ value ofROOT_PASSWORDinlab.env - SSH:
ssh -i .ssh/id_lab root@10.10.10.11(key auto-generated by00)
Reset / rebuild
./teardown.sh # remove VMs, network, images, build artifacts
./teardown.sh --keep-iso # keep the downloaded ISOs for a faster rebuild
Notes
- The PVE nodes power off after install (
reboot-mode = "power-off") sovirt-installcleanly hands off to disk-boot; they are then started normally. proxmox-auto-install-assistantisn't packaged for Fedora, so03runs it inside adebian:trixiecontainer against the Proxmoxpve-no-subscriptionrepo. Docker only needs the user to be in thedockergroup (no sudo).
Troubleshooting
- Storage VM can't install packages / no internet in guests. On firewalld
hosts, libvirt's NAT network frequently lacks FORWARD-accept rules, so guests
reach the host gateway (
10.10.10.1) but nothing beyond.01-network.shnow adds explicitiptablesforward + masquerade rules for the subnet to fix this;teardown.shremoves them. The storage VM's apt is also forced to IPv4 (mirrors resolve to unreachable IPv6 on this NAT). Verify from the host:ssh -i .ssh/id_lab root@10.10.10.13 ping -c2 1.1.1.1. - Never run
virsh net-destroyon a network with running VMs. It tears down the bridge and orphans the VMs' tap interfaces; you must then restart the domains (virsh destroy <dom> && virsh start <dom>) to re-attach them.
License & genAI
This project is licensed under the terms of the MIT license. See LICENSE for
details.
I believe it is important to disclose when generative AI ("genAI") was used in the creation of a work, as is the case here. Much of this was authored using Claude Sonnet 5, though I have reviewed and tested by hand.
Description