Instance is under rebuilding status always when use 'arm64' architecture image

Bug #1861749 reported by Eric Xie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Eric Xie

Bug Description

Description
===========
Got 'Unexpected API Error' when i use new image with property 'hw_architecture=arm64' to rebuild instance.
And the status of instance stay 'REBUILD' always.

Steps to reproduce
==================
1. On x86 env, boot instance 'test'
2. Set new image with 'hw_architecture=arm64'
openstack image set --property hw_architecture=arm64 cirros-test
3. Use the image to rebuild instance
openstack server rebuild --image cirros-test test

Expected result
===============
Got badrequest, the status of instance rollback to active

Actual result
=============
Got 'Unexpected API Error', the status of instance stay rebuild

Environment
===========
$ git log
commit ee6af34437069a23284f4521330057a95f86f9b7 (HEAD -> stable/rocky, origin/stable/rocky)
Author: Luigi Toscano <email address hidden>
Date: Wed Dec 18 00:28:15 2019 +0100

    Zuul v3: use devstack-plugin-nfs-tempest-full

    ... and replace its legacy ancestor.

    Change-Id: Ifd4387a02b3103e1258e146e63c73be1ad10030c
    (cherry picked from commit e7e39b8c2e20f5d7b5e70020f0e42541dc772e68)
    (cherry picked from commit e82e1704caa1c2baea29f05e8d426337e8de7a3c)
    (cherry picked from commit 99aa8ebc12949f9bba76f22e877b07d02791bf5b)

Logs & Configs
==============
# openstack server rebuild --image cirros-test sjt-test-1
Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<type 'exceptions.ValueError'> (HTTP 500) (Request-ID: req-383bbffc-5a85-40e7-86ff-ac7c8d563dfa)

2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi [req-383bbffc-5a85-40e7-86ff-ac7c8d563dfa 40e7b8c3d59943e08a52acd24fe30652 d13f1690c08d41ac854d720ea510a710 - default default] Unexpected exception in API method: ValueError: Architecture name 'arm64' is not valid
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi Traceback (most recent call last):
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi File "/var/lib/openstack/local/lib/python2.7/site-packages/nova/api/openstack/wsgi.py", line 801, in wrapped
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi return f(*args, **kwargs)
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi File "/var/lib/openstack/local/lib/python2.7/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi return func(*args, **kwargs)
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi File "/var/lib/openstack/local/lib/python2.7/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi return func(*args, **kwargs)
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi File "/var/lib/openstack/local/lib/python2.7/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi return func(*args, **kwargs)
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi File "/var/lib/openstack/local/lib/python2.7/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi return func(*args, **kwargs)
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi File "/var/lib/openstack/local/lib/python2.7/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi return func(*args, **kwargs)
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi File "/var/lib/openstack/local/lib/python2.7/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi return func(*args, **kwargs)
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi File "/var/lib/openstack/local/lib/python2.7/site-packages/nova/api/openstack/compute/servers.py", line 954, in _action_rebuild
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi **kwargs)
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi File "/var/lib/openstack/local/lib/python2.7/site-packages/nova/compute/api.py", line 206, in inner
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi return function(self, context, instance, *args, **kwargs)
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi File "/var/lib/openstack/local/lib/python2.7/site-packages/nova/compute/api.py", line 214, in _wrapped
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi return fn(self, context, instance, *args, **kwargs)
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi File "/var/lib/openstack/local/lib/python2.7/site-packages/nova/compute/api.py", line 154, in inner
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi return f(self, context, instance, *args, **kw)
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi File "/var/lib/openstack/local/lib/python2.7/site-packages/nova/compute/api.py", line 3306, in rebuild
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi request_spec.image = objects.ImageMeta.from_dict(image)
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi File "/var/lib/openstack/local/lib/python2.7/site-packages/nova/objects/image_meta.py", line 98, in from_dict
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi image_meta.get("properties", {}))
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi File "/var/lib/openstack/local/lib/python2.7/site-packages/nova/objects/image_meta.py", line 591, in from_dict
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi obj._set_attr_from_current_names(image_props)
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi File "/var/lib/openstack/local/lib/python2.7/site-packages/nova/objects/image_meta.py", line 563, in _set_attr_from_current_names
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi setattr(self, key, image_props[key])
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi File "/var/lib/openstack/local/lib/python2.7/site-packages/oslo_versionedobjects/base.py", line 72, in setter
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi field_value = field.coerce(self, name, value)
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi File "/var/lib/openstack/local/lib/python2.7/site-packages/oslo_versionedobjects/fields.py", line 201, in coerce
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi return self._type.coerce(obj, attr, value)
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi File "/var/lib/openstack/local/lib/python2.7/site-packages/nova/objects/fields.py", line 209, in coerce
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi raise ValueError(msg)
2020-02-04 00:39:04.761 1 ERROR nova.api.openstack.wsgi ValueError: Architecture name 'arm64' is not valid

Tags: api
Eric Xie (eric-xie)
Changed in nova:
assignee: nobody → Eric Xie (eric-xie)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.opendev.org/711363

Changed in nova:
status: New → In Progress
melanie witt (melwitt)
tags: added: api
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.opendev.org/711363
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=8dada6d0f66f6c53a78725fb54f6a8e5d36fb127
Submitter: Zuul
Branch: master

commit 8dada6d0f66f6c53a78725fb54f6a8e5d36fb127
Author: ericxiett <eric_xiett@163.com>
Date: Thu Mar 5 07:49:38 2020 +0800

    Catch exception when use invalid architecture of image

    Currently, when attempting to rebuild an instance with an image with invalid
    architecture, the API raises a 500 error and leaves the instance stuck in
    the REBUILDING task state.This patch adds checking image's architecture
    before updating instance's task_state. And catches
    exception.InvalidArchitectureName then returns HTTPBadRequest.

    Change-Id: I25eff0271c856a8d3e83867b448e1dec6f6732ab
    Closes-Bug: #1861749

Changed in nova:
status: In Progress → Fix Released
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.