Cloned from launchpad blueprint https://blueprints.launchpad.net/nova/+spec/libvirt-hardware-policy-from-libosinfo. Description: When launching an instance Nova needs to make decisions about how to configure the virtual hardware. Currently these decisions are often hardcoded, or driven by nova.conf settings, and sometimes by glance image properties. The goal of this feature is to allow the user to specify the guest OS type and then drive decisions from this fact, using the libosinfo database. Specification URL (additional information): http://specs.openstack.org/openstack/nova-specs/specs/mitaka/approved/libvirt-hardware-policy-from-libosinfo.html
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions
Do we need to add a dependency to bring in the gobject library?
Verified as follows, *********** VERSION *********** [root@serverX]# yum list installed | grep openstack-nova openstack-nova-api.noarch 1:13.1.1-2.el7ost @rhelosp-9.0-puddle openstack-nova-cert.noarch 1:13.1.1-2.el7ost @rhelosp-9.0-puddle openstack-nova-common.noarch 1:13.1.1-2.el7ost @rhelosp-9.0-puddle openstack-nova-compute.noarch 1:13.1.1-2.el7ost @rhelosp-9.0-puddle openstack-nova-conductor.noarch 1:13.1.1-2.el7ost @rhelosp-9.0-puddle openstack-nova-console.noarch 1:13.1.1-2.el7ost @rhelosp-9.0-puddle openstack-nova-novncproxy.noarch 1:13.1.1-2.el7ost @rhelosp-9.0-puddle openstack-nova-scheduler.noarch 1:13.1.1-2.el7ost @rhelosp-9.0-puddle [root@serverX]# ****** LOGS ****** [root@serverX]# glance image-create --container-format bare --disk-format qcow2 --file fedora.qcow2 --name myFedora22 +------------------+--------------------------------------+ | Property | Value | +------------------+--------------------------------------+ | checksum | 18abc933d17f69d55ecea0d19f8f5c71 | | container_format | bare | | created_at | 2016-08-18T15:39:22Z | | disk_format | qcow2 | | id | 9dc19c0d-a7ad-45f9-9b59-52b054bf2715 | | min_disk | 0 | | min_ram | 0 | | name | myFedora22 | | owner | 1e8409b372294934841eeb5e5ef5cde4 | | protected | False | | size | 228599296 | | status | active | | tags | [] | | updated_at | 2016-08-18T15:39:24Z | | virtual_size | None | | visibility | private | +------------------+--------------------------------------+ [root@serverX]# [root@serverX]# glance image-update --property os_distro=fedora22 9dc19c0d-a7ad-45f9-9b59-52b054bf2715 +------------------+--------------------------------------+ | Property | Value | +------------------+--------------------------------------+ | checksum | 18abc933d17f69d55ecea0d19f8f5c71 | | container_format | bare | | created_at | 2016-08-18T15:39:22Z | | disk_format | qcow2 | | id | 9dc19c0d-a7ad-45f9-9b59-52b054bf2715 | | min_disk | 0 | | min_ram | 0 | | name | myFedora22 | | os_distro | fedora22 | | owner | 1e8409b372294934841eeb5e5ef5cde4 | | protected | False | | size | 228599296 | | status | active | | tags | [] | | updated_at | 2016-08-18T15:40:24Z | | virtual_size | None | | visibility | private | +------------------+--------------------------------------+ [root@serverX]# [root@serverX]# nova boot --flavor 2 --image 9dc19c0d-a7ad-45f9-9b59-52b054bf2715 vm1 +--------------------------------------+---------------------------------------------------+ | Property | Value | +--------------------------------------+---------------------------------------------------+ | OS-DCF:diskConfig | MANUAL | | OS-EXT-AZ:availability_zone | | | OS-EXT-SRV-ATTR:host | - | | OS-EXT-SRV-ATTR:hypervisor_hostname | - | | OS-EXT-SRV-ATTR:instance_name | instance-00000044 | | OS-EXT-STS:power_state | 0 | | OS-EXT-STS:task_state | scheduling | | OS-EXT-STS:vm_state | building | | OS-SRV-USG:launched_at | - | | OS-SRV-USG:terminated_at | - | | accessIPv4 | | | accessIPv6 | | | adminPass | PSzxr4yhe4Yh | | config_drive | | | created | 2016-08-18T15:41:42Z | | flavor | m1.small (2) | | hostId | | | id | 1b1ad835-ae9f-42c4-8b7b-55495ea404b5 | | image | myFedora22 (9dc19c0d-a7ad-45f9-9b59-52b054bf2715) | | key_name | - | | metadata | {} | | name | vm1 | | os-extended-volumes:volumes_attached | [] | | progress | 0 | | security_groups | default | | status | BUILD | | tenant_id | 1e8409b372294934841eeb5e5ef5cde4 | | updated | 2016-08-18T15:41:42Z | | user_id | e62260f2a0b94f519e1e9cd9239c14b7 | +--------------------------------------+---------------------------------------------------+ [root@serverX]# nova list +--------------------------------------+------+--------+------------+-------------+---------------------+ | ID | Name | Status | Task State | Power State | Networks | +--------------------------------------+------+--------+------------+-------------+---------------------+ | 1b1ad835-ae9f-42c4-8b7b-55495ea404b5 | vm1 | ACTIVE | - | Running | public=172.24.4.228 | +--------------------------------------+------+--------+------------+-------------+---------------------+ Target-disk information for the instance below is similar to what is defined in /usr/share/libosinfo/db/install-scripts/fedora.xml /usr/share/libosinfo/db/oses/fedora.xml [root@serverX]# virsh dumpxml 1b1ad835-ae9f-42c4-8b7b-55495ea404b5 <domain type='kvm' id='61'> <name>instance-00000044</name> <uuid>1b1ad835-ae9f-42c4-8b7b-55495ea404b5</uuid> <metadata> <nova:instance xmlns:nova="http://openstack.org/xmlns/libvirt/nova/1.0"> <nova:package version="13.1.1-2.el7ost"/> <nova:name>vm1</nova:name> <nova:creationTime>2016-08-18 15:41:51</nova:creationTime> <nova:flavor name="m1.small"> <nova:memory>2048</nova:memory> <nova:disk>20</nova:disk> <nova:swap>0</nova:swap> <nova:ephemeral>0</nova:ephemeral> <nova:vcpus>1</nova:vcpus> </nova:flavor> <nova:owner> <nova:user uuid="e62260f2a0b94f519e1e9cd9239c14b7">admin</nova:user> <nova:project uuid="1e8409b372294934841eeb5e5ef5cde4">admin</nova:project> </nova:owner> <nova:root type="image" uuid="9dc19c0d-a7ad-45f9-9b59-52b054bf2715"/> </nova:instance> </metadata> <memory unit='KiB'>2097152</memory> <currentMemory unit='KiB'>2097152</currentMemory> <vcpu placement='static'>1</vcpu> <cputune> <shares>1024</shares> </cputune> <resource> <partition>/machine</partition> </resource> <sysinfo type='smbios'> <system> <entry name='manufacturer'>Red Hat</entry> <entry name='product'>OpenStack Nova</entry> <entry name='version'>13.1.1-2.el7ost</entry> <entry name='serial'>3e53c9fe-c095-4a51-99ee-2a365f242c41</entry> <entry name='uuid'>1b1ad835-ae9f-42c4-8b7b-55495ea404b5</entry> <entry name='family'>Virtual Machine</entry> </system> </sysinfo> <os> <type arch='x86_64' machine='pc-i440fx-rhel7.2.0'>hvm</type> <boot dev='hd'/> <smbios mode='sysinfo'/> </os> <features> <acpi/> <apic/> </features> <cpu mode='host-model'> <model fallback='allow'/> <topology sockets='1' cores='1' threads='1'/> </cpu> <clock offset='utc'> <timer name='pit' tickpolicy='delay'/> <timer name='rtc' tickpolicy='catchup'/> <timer name='hpet' present='no'/> </clock> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>destroy</on_crash> <devices> <emulator>/usr/libexec/qemu-kvm</emulator> <disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='none'/> <source file='/var/lib/nova/instances/1b1ad835-ae9f-42c4-8b7b-55495ea404b5/disk'/> <backingStore type='file' index='1'> <format type='raw'/> <source file='/var/lib/nova/instances/_base/ece399accf8ff7a8e00704c16dc3d6c1d5213c5c'/> <backingStore/> </backingStore> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </disk> <controller type='usb' index='0'> <alias name='usb'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> <controller type='pci' index='0' model='pci-root'> <alias name='pci.0'/> </controller> <interface type='bridge'> <mac address='fa:16:3e:18:58:cc'/> <source bridge='qbr0d285c50-7b'/> <target dev='tap0d285c50-7b'/> <model type='virtio'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <serial type='file'> <source path='/var/lib/nova/instances/1b1ad835-ae9f-42c4-8b7b-55495ea404b5/console.log'/> <target port='0'/> <alias name='serial0'/> </serial> <serial type='pty'> <source path='/dev/pts/5'/> <target port='1'/> <alias name='serial1'/> </serial> <console type='file'> <source path='/var/lib/nova/instances/1b1ad835-ae9f-42c4-8b7b-55495ea404b5/console.log'/> <target type='serial' port='0'/> <alias name='serial0'/> </console> <input type='tablet' bus='usb'> <alias name='input0'/> </input> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='5904' autoport='yes' listen='0.0.0.0' keymap='en-us'> <listen type='address' address='0.0.0.0'/> </graphics> <video> <model type='cirrus' vram='16384' heads='1'/> <alias name='video0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <stats period='10'/> <alias name='balloon0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </memballoon> </devices> <seclabel type='dynamic' model='selinux' relabel='yes'> <label>system_u:system_r:svirt_t:s0:c91,c256</label> <imagelabel>system_u:object_r:svirt_image_t:s0:c91,c256</imagelabel> </seclabel> </domain> ****************** NEGATIVE TESTING ****************** The above testing was repeated for Fedora24 and the following warning was display since Fedora 24 does not exist in libosinfo database ------------------------------------------------------------------------------------------------------------------------------------- nova-compute.log:2016-08-18 18:13:44.721 22948 WARNING nova.virt.osinfo [req-c6b6880f-8b29-4986-bd8d-07788b3c2aa7 e62260f2a0b94f519e1e9cd9239c14b7 1e8409b372294934841eeb5e5ef5cde4 - - -] Cannot find OS information - Reason: (No configuration information found for operating system fedora24) -------------------------------------------------------------------------------------------------------------------------------------
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHEA-2016-1761.html
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days