Help Needed: Converting Debian Cloud Image for KVM Hypervisor

0
1
Asked By TechyGiraffe25 On

Hey everyone! I'm trying to set up a Debian 12 VM template for KVM hypervisors and I'm turning to cloud images and cloud-init for that flexibility. I've downloaded the right cloud image and done some initial customization using virt-customize, which has been great. However, I've hit a snag: the generic cloud image seems to lack support for SATA CD-ROM drives, which KVM uses. Consequently, my cloud-init ISO isn't being recognized, and it's preventing the initialization process. I tested switching the kernel to a standard one, which allows the ISO to mount, but it causes the VM to hang for over two minutes during boot, and feels overly complicated. I think the missing module might be ahci. Is there a way to compile and include that module into the cloud image using virt-customize, or am I tackling this the wrong way? Also, just as a heads up, I learned that I should actually be using the Debian generic cloud image, not the genericcloud version, since the latter doesn't include ahci support. Any insights?

1 Answer

Answered By DevWizard9 On

Here's a thought: try using a preseed ISO with Debian for network configuration after installation. In our environment, we spin up a bunch of VMs for testing using Packer. Once the VM is up, we pull in the custom ISO that has the same IP every time. Then, we use Ansible to handle the rest, setting up IPs, passwords, and configurations based on the VM's intended purpose. It’s all automated! I suggest checking how cloud-init could fit into this process; it might simplify things instead of going through preseeding for each VM.

CloudDancer42 -

That sounds useful! Actually, I managed to get my setup working by switching to the generic cloud image which has the ahci module. I used virt-customize to put a systemd-networkd config in the base image for automated IP configuration. I avoided pre-set IPs since I aim to deploy multiple VMs simultaneously with Terraform. Now it’s all working great, but I’d appreciate any tips on how to make LVM wipe and recreate logical volumes with preseed if you have them!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.