Cpu model is not correct on Aarch64/Qemu/Custom mode

Bug #1864588 reported by Kevin Zhao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Unassigned

Bug Description

Background:
We'd like to setup Nova and Devstack Upstream CI. Should support launch vm via Qemu virt_type. But host-passthrough mode(default in Aarch64) doesn't work on Qemu. So we can just use "custom" and specify CPU-model.

But actually Aarch64 don't return available cpu models list from Libvirt side. Ref:https://libvirt.org/html/libvirt-libvirt-host.html#virConnectGetCPUModelNames

So we should use the specified ones from config file. And add default ones to it on Aarch64.

Nova-cpu.conf:
[libvirt]
live_migration_uri = qemu+ssh://stack@%s/system
cpu_mode = custom
virt_type = qemu
cpu_model = cortex-a57

WARNING nova.virt.libvirt.driver [-] The libvirt driver is not tested on qemu/aarch64 by the OpenStack project and thus its quality can not be ensured. For more information, see: https://docs.openstack.org/nova/latest/user/support-matrix.html
WARNING nova.virt.libvirt.driver [-] Running Nova with a libvirt version less than 5.0.0 is deprecated. The required minimum version of libvirt will be raised to 5.0.0 in the next release.
WARNING nova.virt.libvirt.driver [-] Running Nova with a QEMU version less than 4.0.0 is deprecated. The required minimum version of QEMU will be raised to 4.0.0 in the next release.
ERROR oslo_service.service [-] Error starting thread.: nova.exception.InvalidCPUInfo: Configured CPU model: cortex-a57 is not correct, or your host CPU arch does not suuport this model. Please correct your config and try again.
ERROR oslo_service.service Traceback (most recent call last):
ERROR oslo_service.service File "/usr/local/lib/python3.6/dist-packages/oslo_service/service.py", line 810, in run_service
ERROR oslo_service.service service.start()
ERROR oslo_service.service File "/opt/stack/nova/nova/service.py", line 158, in start
ERROR oslo_service.service self.manager.init_host()
ERROR oslo_service.service File "/opt/stack/nova/nova/compute/manager.py", line 1394, in init_host
ERROR oslo_service.service self.driver.init_host(host=self.host)
ERROR oslo_service.service File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 715, in init_host
ERROR oslo_service.service self._check_cpu_compatibility()
ERROR oslo_service.service File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 747, in _check_cpu_compatibility
ERROR oslo_service.service raise exception.InvalidCPUInfo(msg)
ERROR oslo_service.service nova.exception.InvalidCPUInfo: Configured CPU model: cortex-a57 is not correct, or your host CPU arch does not suuport this model. Please correct your config and try again.
ERROR oslo_service.service

Revision history for this message
Kevin Zhao (kevin-zhao) wrote :

libvirt+qemu

Changed in nova:
assignee: nobody → Kevin Zhao (kevin-zhao)
status: New → In Progress
Revision history for this message
Kevin Zhao (kevin-zhao) wrote :
Download full text (7.8 KiB)

Failed to build and run instance: libvirt.libvirtError: this function is not supported by the connection driver: cannot translate CPU model max to a supported model

ERROR nova.compute.manager [None req-e68c8d64-0346-472f-a928-a805794c0352 admin admin] [instance: e5ce7086-4fb1-4358-aa39-13a62bd33961] Failed to build and run instance: libvirt.libvirtError: this function is not supported by the connection driver: cannot translate CPU model max to a supported model ERROR nova.compute.manager [instance: e5ce7086-4fb1-4358-aa39-13a62bd33961] Traceback (most recent call last):
ERROR nova.compute.manager [instance: e5ce7086-4fb1-4358-aa39-13a62bd33961] File "/opt/stack/nova/nova/compute/manager.py", line 2371, in _build_and_run_instance ERROR nova.compute.manager [instance: e5ce7086-4fb1-4358-aa39-13a62bd33961] block_device_info=block_device_info) ERROR nova.compute.manager [instance: e5ce7086-4fb1-4358-aa39-13a62bd33961] File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 3411, in spawn ERROR nova.compute.manager [instance: e5ce7086-4fb1-4358-aa39-13a62bd33961] power_on=power_on) ERROR nova.compute.manager [instance: e5ce7086-4fb1-4358-aa39-13a62bd33961] File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 6215, in _create_domain_and_network ERROR nova.compute.manager [instance: e5ce7086-4fb1-4358-aa39-13a62bd33961] destroy_disks_on_failure) ERROR nova.compute.manager [instance: e5ce7086-4fb1-4358-aa39-13a62bd33961] File "/usr/local/lib/python3.6/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
ERROR nova.compute.manager [instance: e5ce7086-4fb1-4358-aa39-13a62bd33961] self.force_reraise() ERROR nova.compute.manager [instance: e5ce7086-4fb1-4358-aa39-13a62bd33961] File "/usr/local/lib/python3.6/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise ERROR nova.compute.manager [instance: e5ce7086-4fb1-4358-aa39-13a62bd33961] six.reraise(self.type_, self.value, self.tb)
ERROR nova.compute.manager [instance: e5ce7086-4fb1-4358-aa39-13a62bd33961] File "/usr/local/lib/python3.6/dist-packages/six.py", line 703, in reraise ERROR nova.compute.manager [instance: e5ce7086-4fb1...

Read more...

Revision history for this message
Kevin Zhao (kevin-zhao) wrote :

stack@devstack-test-2:~$ virsh --version
4.0.0

stack@devstack-test-2:~$ qemu-system-aarch64 --version
QEMU emulator version 2.11.1(Debian 1:2.11+dfsg-1ubuntu7.23)
Copyright (c) 2003-2017 Fabrice Bellard and the QEMU Project developers

Revision history for this message
Kevin Zhao (kevin-zhao) wrote :

Qemu 2.11 in Ubuntu Bionic can not offer the capabilty for CPU model: max.

Qemu 2.12 can support this type.

Changed in nova:
assignee: Kevin Zhao (kevin-zhao) → Marcin Juszkiewicz (hrw)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.opendev.org/709494
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=5d4f82a15c7bccc89f78a5a1f00a25cfafdbdde0
Submitter: Zuul
Branch: master

commit 5d4f82a15c7bccc89f78a5a1f00a25cfafdbdde0
Author: Kevin Zhao <email address hidden>
Date: Mon Mar 16 10:41:05 2020 +0800

    Add default cpu model for AArch64

    Unlike x86, AArch64 doesn't have a default model.
    Usually when using libvirt driver, set cpu mode to custom, nova
    will call libvirt to return the default models. But for aarch64,
    the support CPU models varies according to machine type.

    AArch64 use "virt" as the default machine type. In Qemu it support
    several models, and we should choose "max" as the by default one.

    Closes-Bug: #1864588
    Change-Id: Ib2df50bda991a659fe10ef1dd9e7ab56800c34fb
    Signed-off-by: Kevin Zhao <email address hidden>

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/723900

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (stable/train)

Change abandoned by Marcin Juszkiewicz (<email address hidden>) on branch: stable/train
Review: https://review.opendev.org/723900
Reason: better not change defaults after release

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.