This is the multi-page printable view of this section. .
VM Definition (vms.csv)
Configure virtual machines as rows in vms.csv.
VMs are defined in vms.csv file. Each row represents a VM with the following fields:
| Field | Description | Example |
|---|---|---|
name |
VM name | win11-dev |
host |
KVM host (inventory name) | local |
type |
OS type: windows / linux / macos |
windows |
memory_mb |
Memory in MB | 8192 |
vcpus |
CPU cores | 4 |
os |
OS variant | win11 |
disk_gb |
System disk size | 80 |
data_disk_gb |
Data disk size (0 for none) | 10 |
base_image |
Base qcow2 image path | /path/to/base.qcow2 |
bridge |
Network bridge | br0 |
mac |
MAC address | 52:54:00:xx:xx:xx |
firmware |
efi or empty (BIOS) |
efi |
autostart |
Auto-start on boot (default: false) |
true |
storage_dir |
VM storage path (optional, default: /var/lib/libvirt/images) |
/data/vms |
ip |
Static IP address (optional, empty = DHCP). Linux: applied via cloud-init at create; macOS: applied later via configure-macos-network.yaml, see macOS VMs |
192.168.1.100 |
netmask |
Subnet CIDR (optional, default: 22) |
24 |
gateway |
Default gateway (required if ip is set) |
192.168.1.1 |
dns |
DNS servers, comma-separated (required if ip is set) |
8.8.8.8,8.8.4.4 |
Example vms.csv
Key Points
- MAC addresses: Each VM needs a unique MAC address for stable DHCP leases
- Autostart: Only debian12-01 is configured with
autostart=true(starts on host boot) - Storage: VMs can use custom storage paths or default
/var/lib/libvirt/images - Static IP: Linux VMs via cloud-init; macOS VMs via
configure-macos-network.yamlover SSH (no cloud-init on macOS) — see macOS VMs - Idempotent: The
create-vmplaybook checks if VM exists before creating, safe to run multiple times