Bug #38081
openError 422 "unsupported configuration: unknown driver format value '' " while creating VM in Call to virDomainDefineXML
Description
We are running Foreman on Debian Bullseye and have installed foreman from the deb.theforeman.org mirror, pinned on minor Version 3.11.x.
After updating from 3.11.4 to 3.11.5 we encountered this Error while creating a VM.
HTTP POST "https://foreman.rz.babiel.com/api/v2/hosts": 422 Unprocessable Content: Failed to create a compute s099193 (Libvirt) instance s126043.rz.babiel.com: Error saving the server: Call to virDomainDefineXML failed: unsupported configuration: unknown driver format value ''
I pasted the production.log entry in the attached file below.
The POST Request to api/v2/hosts had following Parameters:
"host"=>{
"name"=>"s126043",
"hostgroup_id"=>901,
"root_pass"=>"[FILTERED]",
"compute_resource_id"=>134,
"compute_profile_id"=>3,
"compute_attributes"=>{
"cpus"=>4,
"memory"=>8589934592,
"volumes_attributes"=>{
"0"=>{
"capacity"=>"1G",
"allocation"=>"1G",
"pool_name"=>"vg1"
}
},
"start"=>"0"
},
"ip"=>"192.168.126.43",
"build"=>true,
"interfaces_attributes"=>[{
"compute_attributes"=>{
"bridge"=>"br126"
}
}]
},
"apiv"=>"v2"
So we do not change the volume.format_type. So the default Value 'raw' from foreman/vendor/ruby/2.7.0/gems/fog-libvirt-0.12.2/lib/fog/libvirt/models/compute/volume.rb should be used while generating the xml File for libvirts virDomainDefineXML API call.
But it seems like foreman version 3.11.5 and the XML-Creation changes in fog-libvirt 0.13.1 are incompatible.
3.11.4 works just fine, because of the offline shipped fog-libvirt version 0.12.2 in the .deb and the postinstall call to "bundle update" with the flag --local.
Files