live migration failed no CPU model specified

Bug #1433933 reported by Eli Qiao
26
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Incomplete
Low
Eli Qiao

Bug Description

1" threads="1"/>\n</cpu>\n',) from (pid=2305) to_xml /opt/stack/nova/nova/virt/libvirt/config.py:82
<cpu match="exact">
  <topology sockets="1" cores="1" threads="1"/>
</cpu>

2015-03-19 15:35:37.697 DEBUG nova.virt.libvirt.config [req-b2abf15d-cb2c-4af9-8356-181e16ee091a admin admin] Generated XML ('<cpu match="exact">\n <topology sockets="1" cores="1" threads="1"/>\n</cpu>\n',) from (pid=2305) to_xml /opt/stack/nova/nova/virt/libvirt/config.py:82
2015-03-19 15:35:37.699 ERROR nova.virt.libvirt.driver [req-b2abf15d-cb2c-4af9-8356-181e16ee091a admin admin] CPU doesn't have compatibility.

Requested operation is not valid: no CPU model specified

Refer to http://libvirt.org/html/libvirt-libvirt-host.html#virCPUCompareResult
2015-03-19 15:35:37.702 DEBUG oslo_messaging._drivers.amqpdriver [req-b2abf15d-cb2c-4af9-8356-181e16ee091a admin admin] MSG_ID is 374d071984dd497ba58b9c0fe6ad0ea1 from (pid=2305) _send /usr/local/lib/python2.7/dist-packages/oslo_messaging/_drivers/amqpdriver.py:310
2015-03-19 15:35:37.702 DEBUG oslo_messaging._drivers.amqp [req-b2abf15d-cb2c-4af9-8356-181e16ee091a admin admin] UNIQUE_ID is f11d04094b1d4614b06a17fe7ffe3fae. from (pid=2305) _add_unique_id /usr/local/lib/python2.7/dist-packages/oslo_messaging/_drivers/amqp.py:226
2015-03-19 15:35:37.747 ERROR oslo_messaging.rpc.dispatcher [req-b2abf15d-cb2c-4af9-8356-181e16ee091a admin admin] Exception during message handling: Migration pre-check error: CPU doesn't have compatibility.

Requested operation is not valid: no CPU model specified

Eli Qiao (taget-9)
Changed in nova:
assignee: nobody → Eli Qiao (taget-9)
Revision history for this message
Eli Qiao (taget-9) wrote :

in nova.conf

[libvirt]
cpu_mode = none
virt_type = kvm

by checking libvirt driver

    def _get_guest_cpu_model_config(self):
        mode = CONF.libvirt.cpu_mode
        model = CONF.libvirt.cpu_model

        if (CONF.libvirt.virt_type == "kvm" or
            CONF.libvirt.virt_type == "qemu"):
            if mode is None:
                mode = "host-model"
            if mode == "none":
                return vconfig.LibvirtConfigGuestCPU()

if mode is set to none, then return vconfig.LibvirtConfigGuestCPU()
but it doesn't has cpu_model at all.

Changed in nova:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Joe Gordon (jogo) wrote :

I am not sure this is actually valid, if you are live migrating across two different types of CPUs, you will get this error.

tags: added: libvirt
Changed in nova:
status: Confirmed → Incomplete
Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote :

I made the same observation on a setup where both nodes have the same
CPU type. The missing <model> element causes an XML parser error.

    $ cat cpu_without_model.xml
    <cpu match="exact">
     <topology sockets="1" cores="1" threads="1"/>
    </cpu>
    $ virsh cpu-compare cpu_without_model.xml
    error: Failed to compare host CPU with cpu_without_model.xml
    error: Requested operation is not valid: no CPU model specified

The model is not saved in the database [1]. But this database entry is
loaded into the "instance.vcpu_model" property and used to query the
cpu [2]:

    def check_can_live_migrate_destination([...]):
        [...]
        if not instance.vcpu_model:
            [...]
        else:
            self._compare_cpu(instance.vcpu_model, None)

    def _compare_cpu(self, guest_cpu, host_cpu_str):
        [...]

        if guest_cpu is None:
            [...]
        else:
            cpu = self._vcpu_model_to_cpu_config(guest_cpu)

The VirtCPUModel was introduced with [3] but I don't know if this
introduced the described issue.

[1] http://paste.openstack.org/show/193858/
[2] https://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py
[3] Gerrit; Add VirtCPUModel nova objects;
    https://review.openstack.org/#/c/148138/

Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote :

It seems that this issue was also discovered by Tony Walker in https://bugs.launchpad.net/nova/+bug/1082414/comments/29

His patch set seems to solve the problem: https://review.openstack.org/#/c/161944/2

tags: added: live-migrate
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.