Grow-on-first-boot, and a clean teardown
Two finishing touches make the recipe pleasant to live with.
Disks grow to fit. The template's disk is small. When you clone and resize the new VM's disk to, say, 250 GiB, cloud-init's growpart/resize on first boot expands the filesystem to fill it automatically. You never manually grow a partition.
Teardown is tidy. After first boot succeeds, the temporary per-VM cloud-init snippet is detached and deleted. Nothing machine-specific is left lying around on the host. And because every VM is just a clone plus a snippet, destroying one is genuinely clean — there's no hand-crafted state to mourn.
clone -> resize disk -> attach snippet -> boot (grows + configures)
-> verify -> detach + delete snippet (no leftovers)
Lesson learned: make provisioning and de-provisioning both boring. It's easy to automate creating a VM and forget that the throwaway bits (snippets, temp credentials) should be cleaned up too. A create flow that leaves no residue is what lets you treat VMs as cattle, not pets.
No comments to display
No comments to display