I am currently using virt-install to create new VMs on KVM/QEMU and then using Terraform to configure software on them. I want to combine these steps and use a Terraform provider to automate VM creation but then be able to tear the whole system down with a single command. Can anyone suggest a suitable Terraform provider to achieve this?
I am currently using matchbox with dnsmasq to PXE boot my VMs so all my solution needs to do is create a VM using Terraform with the necessary flags, for example:
virt-install --name "test" --network=bridge=bridge0,mac=FF:FF:FF:FF:FF:FF --boot=hd,network --memory=1024 --vcpus=2 --pxe --disk pool=default,size=10 --os-type=linux --os-variant=generic --noautoconsole --events on_poweroff=preserve
and be able to simply run terraform destroy
to undo everything