Problem:
If I try to create a new host via Foreman on a libvirt kvm hypervisor I get the following error message:
Unable to save
Failed to create a compute srv01-02 (Libvirt) instance test01-03: Error saving the server: Call to virDomainDefineXML failed: unsupported configuration: unknown driver format value ''
in the debug log of libvirtd you can see that the type field in the disk driver is empty. I guess this could be related to the switch to the Nokogiri::XML::Builder which @ekohl has done.
Expected outcome:
Foreman should be able to generate a correct xml definition for the libvirt vm and create the new host.
Foreman and Proxy versions:
Foreman and Proxy version: 3.14.0
Foreman and Proxy plugin versions:
none or not relevant
Distribution and version:
Debian 12 (Bookworm)
Other relevant data:
libvirtd debug log snippet
2025-04-26 21:00:53.070+0000: 232708: debug : virNetServerProgramDispatch:280 : prog=536903814 ver=1 type=0 status=0 serial=114 proc=11
2025-04-26 21:00:53.070+0000: 232708: debug : virThreadJobSet:93 : Thread 232708 (rpc-libvirtd) is now running job remoteDispatchDomainDefineXML
2025-04-26 21:00:53.070+0000: 232708: debug : remoteDispatchDomainDefineXMLHelper:5246 : server=0x556ab6350080 client=0x556ab6370150 msg=0x556ab6373b10 rerr=0x7f9d68bfc9f0 args=0x7f9d54000e30 ret=0x7f9d54019af0
2025-04-26 21:00:53.070+0000: 232708: debug : virDomainDefineXML:6611 : conn=0x7f9d1c014990, xml=<?xml version="1.0"?>
<domain type="kvm">
<name>test01-03</name>
<memory>524288</memory>
<vcpu>1</vcpu>
<os>
<type arch="x86_64" machine="q35">hvm</type>
<boot dev="network"/>
<boot dev="hd"/>
</os>
<features>
<acpi/>
<apic/>
</features>
<cpu mode="host-passthrough" check="none" migratable="on"/>
<clock offset="utc">
<timer name="rtc" tickpolicy="catchup"/>
<timer name="pit" tickpolicy="delay"/>
<timer name="hpet" present="no"/>
</clock>
<devices>
<disk type="block" device="disk">
<driver name="qemu" type=""/> <---- type is empty
<source dev="/dev/vg01/test01-03-disk1"/>
<target dev="vda" bus="virtio"/>
</disk>
<interface type="bridge">
<source bridge="br91"/>
<model type="virtio"/>
</interface>
<channel type="unix">
<target type="virtio" name="org.qemu.guest_agent.0"/>
</channel>
<rng model="virtio">
<backend model="random"/>
</rng>
<serial type="pty">
<target port="0"/>
</serial>
<console type="pty">
<target port="0"/>
</console>
<input type="tablet" bus="usb"/>
<input type="mouse" bus="ps2"/>
<graphics type="vnc" port="-1" autoport="yes" listen="0.0.0.0"/>
<video>
<model type="cirrus" vram="9216" heads="1"/>
</video>
</devices>
</domain>
2025-04-26 21:00:53.070+0000: 232708: info : virObjectRef:400 : OBJECT_REF: obj=0x7f9d1c06e130
2025-04-26 21:00:53.070+0000: 232708: info : virObjectNew:256 : OBJECT_NEW: obj=0x7f9cf4014690 classname=qemuDomainVcpuPrivate
2025-04-26 21:00:53.070+0000: 232708: info : virObjectNew:256 : OBJECT_NEW: obj=0x7f9d5401c0a0 classname=virStorageSource
2025-04-26 21:00:53.070+0000: 232708: info : virObjectNew:256 : OBJECT_NEW: obj=0x7f9ca8003870 classname=qemuDomainDiskPrivate
2025-04-26 21:00:53.070+0000: 232708: error : virDomainDiskDefDriverSourceParseXML:7750 : unsupported configuration: unknown driver format value ''
2025-04-26 21:00:53.070+0000: 232708: info : vir_object_finalize:319 : OBJECT_DISPOSE: obj=0x7f9d5401c0a0
2025-04-26 21:00:53.070+0000: 232708: info : virObjectUnref:378 : OBJECT_UNREF: obj=0x7f9d5401c0a0
2025-04-26 21:00:53.070+0000: 232708: info : vir_object_finalize:319 : OBJECT_DISPOSE: obj=0x7f9ca8003870
2025-04-26 21:00:53.070+0000: 232708: info : virObjectUnref:378 : OBJECT_UNREF: obj=0x7f9ca8003870
2025-04-26 21:00:53.070+0000: 232708: info : vir_object_finalize:319 : OBJECT_DISPOSE: obj=0x7f9cf4014690
2025-04-26 21:00:53.070+0000: 232708: info : virObjectUnref:378 : OBJECT_UNREF: obj=0x7f9cf4014690
2025-04-26 21:00:53.070+0000: 232708: info : virObjectUnref:378 : OBJECT_UNREF: obj=0x7f9d1c06e130
2025-04-26 21:00:53.070+0000: 232708: debug : virThreadJobClear:118 : Thread 232708 (rpc-libvirtd) finished job remoteDispatchDomainDefineXML with ret=-1