libivrt machine types are case sensitive but we do not validate them in nova
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Amit Uniyal |
Bug Description
as seen in http://
however due to the way libvirt validates the xml it retruns a "No PCI buses available" error instead of a "incorrect machine type error" or similar that would be more intunitve.
021-06-20 02:37:39.795 7 ERROR nova.virt.
<uuid>
<name>
<memory>
<vcpu>4</vcpu>
<metadata>
<nova:instance xmlns:nova="http://
<nova:package version="23.0.2"/>
<
<
<nova:flavor name="test">
<
<nova:owner>
<nova:user uuid="329bf2535
</nova:owner>
<nova:root type="image" uuid="33269e7a-
<nova:ports>
<nova:port uuid="48be4df9-
<nova:ip type="fixed" address=
</nova:ports>
</nova:
</metadata>
<sysinfo type="smbios">
<system>
<entry name="manufactu
<entry name="product"
<entry name="version"
<entry name="serial"
<entry name="uuid"
<entry name="family"
</system>
</sysinfo>
<os>
<type machine=
<boot dev="hd"/>
<smbios mode="sysinfo"/>
</os>
<features>
<acpi/>
<apic/>
</features>
<cputune>
<shares>
</cputune>
<clock offset="utc">
<timer name="pit" tickpolicy=
<timer name="rtc" tickpolicy=
<timer name="hpet" present="no"/>
</clock>
<cpu mode="host-model" match="exact">
<topology sockets="4" cores="1" threads="1"/>
</cpu>
<devices>
<disk type="network" device="disk">
<driver type="raw" cache="writeback" discard="unmap"/>
<source protocol="rbd" name="vms/
<host name="192.168.1.10" port="6789"/>
</source>
<auth username="nova">
<secret type="ceph" uuid="d580b7e4-
</auth>
<target dev="sda" bus="scsi"/>
<address type="drive" controller="0" unit="0"/>
</disk>
<controller type="scsi" index="0" model="
<interface type="bridge">
<mac address=
<model type="virtio"/>
<source bridge="br-int"/>
<mtu size="2018"/>
<target dev="tap48be4df
<virtualport type="openvswitch">
<parameters interfaceid=
<
</interface>
<serial type="pty">
<log file="/
</serial>
<graphics type="vnc" autoport="yes" listen=
<video>
<model type="virtio"/>
</video>
<input type="tablet" bus="usb"/>
<rng model="virtio">
<backend model="
</rng>
<controller type="usb" index="0"/>
<memballoon model="virtio">
<stats period="10"/>
</memballoon>
</devices>
</domain>
: libvirt.
since the libvirt machine types are case sensitive we cannot assume we can just lowercase teh users input but we should still be able to normalise the machine types in the following way.
on startup we call virsh capablites to retrive info from libvirt regarding the capablities of the host.from that api we can retrieve the set of supported machine types.
we can then construct a dictionary of lower-case machine type name to correct case machine type names.
when booting a vm we should lowercase the user input and lookup the correct case form this dictonary. this will allow nova to continue to treat the input as case insensitive but still pass the correct value to libvirt.
Changed in nova: | |
assignee: | nobody → Amit Uniyal (auniyal) |
note if we dont find the machine type in the dict we shoudl raise an excption and fail the spawn with a error noting that it is not supportred.
long term it might be nice if we could schedule based on machine types using custom traits in placment but that is a feature not a bugfix and should be handeled seperatly.