Libvirt driver ungracefully explodes if unsupported arch is found

Bug #1820125 reported by Dan Smith on 2019-03-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Medium
Dan Smith

Bug Description

If a new libvirt exposes an arch name that nova does not support, we fail to gracefully skip it during the instance capability gathering:

2019-03-14 19:11:31.709 6 ERROR nova.compute.manager [req-4e626631-fefc-4c58-a1cd-5207c9384a1b - - - - -] Error updating resources for node primary.: InvalidArchitectureName: Architecture name 'armv6l' is not recognised
2019-03-14 19:11:31.709 6 ERROR nova.compute.manager Traceback (most recent call last):
2019-03-14 19:11:31.709 6 ERROR nova.compute.manager File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/nova/compute/manager.py", line 7956, in _update_available_resource_for_node
2019-03-14 19:11:31.709 6 ERROR nova.compute.manager startup=startup)
2019-03-14 19:11:31.709 6 ERROR nova.compute.manager File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/nova/compute/resource_tracker.py", line 727, in update_available_resource
2019-03-14 19:11:31.709 6 ERROR nova.compute.manager resources = self.driver.get_available_resource(nodename)
2019-03-14 19:11:31.709 6 ERROR nova.compute.manager File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 7070, in get_available_resource
2019-03-14 19:11:31.709 6 ERROR nova.compute.manager data["supported_instances"] = self._get_instance_capabilities()
2019-03-14 19:11:31.709 6 ERROR nova.compute.manager File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 5943, in _get_instance_capabilities
2019-03-14 19:11:31.709 6 ERROR nova.compute.manager fields.Architecture.canonicalize(g.arch),
2019-03-14 19:11:31.709 6 ERROR nova.compute.manager File "/var/lib/kolla/venv/local/lib/python2.7/site-packages/nova/objects/fields.py", line 200, in canonicalize
2019-03-14 19:11:31.709 6 ERROR nova.compute.manager raise exception.InvalidArchitectureName(arch=name)
2019-03-14 19:11:31.709 6 ERROR nova.compute.manager InvalidArchitectureName: Architecture name 'armv6l' is not recognised
2019-03-14 19:11:31.709 6 ERROR nova.compute.manager

Changed in nova:
assignee: nobody → Dan Smith (danms)
status: New → In Progress
melanie witt (melwitt) on 2019-03-14
tags: added: libvirt
Changed in nova:
importance: Undecided → Medium

Reviewed: https://review.openstack.org/643458
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=71df650d0a390d2b6b19928db4379e723e9f5cde
Submitter: Zuul
Branch: master

commit 71df650d0a390d2b6b19928db4379e723e9f5cde
Author: Dan Smith <email address hidden>
Date: Thu Mar 14 14:07:31 2019 -0700

    Avoid crashing while getting libvirt capabilities with unknown arch names

    In _get_instance_capabilities() we get a list of host capabilities and then
    build a list of arches supported by the virt type of an instance to arrive
    at the list of possibilities for the instance. We check each of those
    against our enum, but fail to gracefully skip unsupported values should we
    encounter one.

    This patch makes that graceful, and also introduces an unsupported arch to
    the test stub to make sure we always skip it. Note that we do not warn
    because this happens once per instance in a periodic task, and since the
    situation is caused by a (somewhat permanent) mismatch of libvirt and
    nova version support, isn't something that needs to be remedied by an
    operator.

    Closes-Bug: #1820125
    Change-Id: I5d95bd50279a6bf903a5793ad5f3ae9d06f085f4

Changed in nova:
status: In Progress → Fix Released

This issue was fixed in the openstack/nova 19.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers