Use this when creating a new VM for someone and you want it ready to use: right size, network, identity, monitoring and backup.
VM Provisioning
VM provisioning is creating a ready-to-use VM: choose host or cluster, clone or build from an image, size CPU, memory and disks, attach networks, apply guest customization, and hand it over with monitoring and backup enabled.
1. Provisioning: template + customisation + registration.
2. Automate naming, IPs, DNS, monitoring, backups.
3. Record owner.
4. Validate after creation.
5. Decommission path too.
request → automated build → registered → handed over
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
qm config <vmid>Primary Commands
Configuration and operational commands for this Topic.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Checks Verify boundary
- VM reachable and registered in DNS.
- Guest agent reporting IP.
- Added to monitoring and backup.
- Owner and environment tags set.
Step 2 Common mistakes Narrow the fault
- No check for name/IP conflicts before creating.
- VMs created without owner tags.
- Created VM ≠ delivered service.
- Right-size from requirements, not habit.
- Register in backup and monitoring at creation.
qm clone <tpl> <id> && qm set <id> --ipconfig0 ip=dhcp && qm start <id>— Proxmox clone + cloud-initNew-VM ... ; Start-VM— Hyper-V PowerShellterraform apply— IaC
ReferenceWhy it matters1 section · depth on demand
Method
VM provisioning flow that scales:
1. Template built and patched by Packer (or refreshed cloud image).
2. VM created from template via API/Terraform with name, CPU, memory, disks, network.
3. First-boot customisation: cloud-init or sysprep unattend (hostname, IP, users, SSH keys, domain join).
4. Configuration management applies roles (Ansible/DSC).
5. Registration: DNS, monitoring, backup policy, CMDB.
Each step should be idempotent and logged so a failed run can be retried safely.
ReferenceHow it works1 section · depth on demand
Example (Proxmox)
qm clone 9000 150 --name web05 --full
qm set 150 --memory 4096 --cores 2 --ipconfig0 ip=10.0.20.55/24,gw=10.0.20.1
qm start 150
Documented example, not captured output.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Provision a VM end to end from a template (Proxmox VE)
vmid=123
qm clone 9000 $vmid --name web01 # linked clone of the template
qm set $vmid --cores 2 --memory 4096 \
--ciuser admin --sshkeys /root/keys/admin.pub \
--ipconfig0 ip=10.0.20.51/24,gw=10.0.20.1 --nameserver 10.0.0.53 --searchdomain corp.example.com
qm resize $vmid scsi0 32G
qm set $vmid --tags 'web;prod' --description 'Owner: web team; ticket CHG-1234'
qm start $vmid
until qm agent $vmid ping 2>/dev/null; do sleep 5; done
qm agent $vmid network-get-interfaces | jq -r '.[].["ip-addresses"][]?.["ip-address"]'
The qm reference documents the clone, cloud-init (--ciuser, --ipconfig[n]) and agent subcommands used above.
Provisioning checklist
| Step | Why |
|---|---|
| Allocate IP and DNS name first (IPAM) | No duplicates; DNS ready before services start |
| Clone from a current template version | Patched baseline |
| Size CPU/RAM/disk from the request, not the template default | Right-sizing |
| Cloud-init for identity and access | No manual console work |
| Tags, owner, description | Inventory, cost allocation, cleanup later |
| Add to backup job and monitoring | Not discovered "unprotected" after an incident |
| HA if required | Explicit decision per VM |
| Wait for guest agent, then hand over | VM really booted and reachable |
Declarative alternatives
Terraform/OpenTofu providers for Proxmox, Ansible's community.general.proxmox_kvm module or the HTTPS API let the same steps be expressed as desired state. Whatever the tool, keep the template ID and cloud-init settings as variables, and make the process idempotent so re-running it converges instead of creating duplicates.
libvirt equivalent
virt-install --import --disk path=web01.qcow2 --cloud-init user-data=user-data,meta-data=meta-data --os-variant debian12 --network bridge=br0 --noautoconsole does clone-and-boot with NoCloud data on hosts without Proxmox.
Steps
1. Choose host/cluster and storage.
2. Clone template or cloud image.
3. Set CPU, memory, disks, network.
4. Inject identity (cloud-init, Sysprep answer file).
5. Power on and wait for guest readiness.
6. Register in DNS, monitoring and backup.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Automation → VM Provisioning. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://libvirt.org/html/index.html · confidence 94%