fog / fog-libvirt

libvirt provider for fog
MIT License
16 stars 42 forks source link

Q35 machine type does not support IDE #136

Open bmagistro opened 3 months ago

bmagistro commented 3 months ago

When trying to use a cloud-init image based deployment with Foreman, the VM provisioning fails as the Q35 machine type does not support the IDE bus. This was broken by #127 a change similar to this fix was mentioned as part of #76 but does not look like it made it into the final set. I haven't been able to figure out the conditional check yet so do not have a pr but the beloow changes have been confirmed to work under q35. I have not looked to see if i440 supports sata allowing the logic to be skipped/deferred for now. If you have suggestions to query the machine, I can try to finish turning this into a pr.

xml.target(:dev => "hdc", :bus => "ide") --> xml.target(:dev => "sr0", :bus => "sata")
xml.address(:type => "drive", :controller => 0, :bus => 1, :unit => 0) --> xml.address(:type => "drive", :controller => 0, :bus => 0, :unit => 0)

This issue is mentioned in serval places

smirta commented 1 month ago

Hi @bmagistro, we ran into the same issue. I added a PR #137 but chose SCSI instead of SATA. Cheers