SEV enabled instance unable to hard reboot

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

Bug Description

Description
===========

Hard rebooting a SEV enabled instance fails with a NotImplementedError raised as the image_meta stashed in the system_metadata of the instance doesn't contain the image name or id:

2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server File "/usr/lib/python3.6/site-packages/nova/compute/manager.py", line 3739, in _reboot_instance
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server bad_volumes_callback=bad_volumes_callback)
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server File "/usr/lib/python3.6/site-packages/nova/virt/libvirt/driver.py", line 3292, in reboot
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server block_device_info)
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server File "/usr/lib/python3.6/site-packages/nova/virt/libvirt/driver.py", line 3386, in _hard_reboot
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server mdevs=mdevs)
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server File "/usr/lib/python3.6/site-packages/nova/virt/libvirt/driver.py", line 6331, in _get_guest_xml
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server context, mdevs)
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server File "/usr/lib/python3.6/site-packages/nova/virt/libvirt/driver.py", line 5949, in _get_guest_config
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server flavor, image_meta)
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server File "/usr/lib/python3.6/site-packages/nova/virt/libvirt/driver.py", line 5504, in _get_guest_memory_backing_config
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server if self._sev_enabled(flavor, image_meta):
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server File "/usr/lib/python3.6/site-packages/nova/virt/libvirt/driver.py", line 6117, in _sev_enabled
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server mach_type)
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server File "/usr/lib/python3.6/site-packages/nova/virt/hardware.py", line 1271, in get_mem_encryption_constraint
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server image_meta.name)
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server File "/usr/lib/python3.6/site-packages/oslo_versionedobjects/base.py", line 67, in getter
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server self.obj_load_attr(name)
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server File "/usr/lib/python3.6/site-packages/oslo_versionedobjects/base.py", line 603, in obj_load_attr
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server _("Cannot load '%s' in the base class") % attrname)
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server NotImplementedError: Cannot load 'name' in the base class
2021-05-10 16:50:24.847 7 ERROR oslo_messaging.rpc.server

Steps to reproduce
==================

Hard reboot a SEV enabled instance.

Expected result
===============

Instance hard reboots as expected.

Actual result
=============

Instance fails to reboot with a NotImplementedError exception raised.

Environment
===========
1. Exact version of OpenStack you are running. See the following
  list for all releases: http://docs.openstack.org/releases/

   stable/train but likely the same on master.

2. Which hypervisor did you use?
   (For example: Libvirt + KVM, Libvirt + XEN, Hyper-V, PowerKVM, ...)
   What's the version of that?

   libvirt + KVM

2. Which storage type did you use?
   (For example: Ceph, LVM, GPFS, ...)
   What's the version of that?

   N/A

3. Which networking type did you use?
   (For example: nova-network, Neutron with OpenVSwitch, ...)

   N/A

Logs & Configs
==============

Tags: libvirt
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/nova/+/790658

Changed in nova:
status: New → In Progress
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/c/openstack/nova/+/790660

Revision history for this message
Lee Yarwood (lyarwood) wrote :
Download full text (4.6 KiB)

Also seeing this in create flows in the API:

2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi [req-96c7fe95-326f-4742-9ff0-8f1aa9e0f5b5 ad8e0419ec17425899194c504fef9379 9f5bceda6a6c48738009dd7bb3d8b8da - default default] Unexpected exception in API method: NotImplementedError: Cannot load 'name' in the base class
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi Traceback (most recent call last):
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi File "/usr/lib/python3.6/site-packages/nova/api/openstack/wsgi.py", line 671, in wrapped
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi return f(*args, **kwargs)
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi File "/usr/lib/python3.6/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi return func(*args, **kwargs)
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi File "/usr/lib/python3.6/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi return func(*args, **kwargs)
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi File "/usr/lib/python3.6/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi return func(*args, **kwargs)
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi [Previous line repeated 9 more times]
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi File "/usr/lib/python3.6/site-packages/nova/api/openstack/compute/servers.py", line 712, in create
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi **create_kwargs)
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi File "/usr/lib/python3.6/site-packages/nova/hooks.py", line 154, in inner
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi rv = f(*args, **kwargs)
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi File "/usr/lib/python3.6/site-packages/nova/compute/api.py", line 1932, in create
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi requested_hypervisor_hostname=requested_hypervisor_hostname)
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi File "/usr/lib/python3.6/site-packages/nova/compute/api.py", line 1411, in _create_instance
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi block_device_mapping.root_bdm(), validate_numa=False)
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi File "/usr/lib/python3.6/site-packages/nova/compute/api.py", line 912, in _checks_for_create_and_rebuild
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi validate_numa=validate_numa)
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi File "/usr/lib/python3.6/site-packages/nova/compute/api.py", line 577, in _validate_flavor_image
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi root_bdm, validate_numa)
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi File "/usr/lib/python3.6/site-packages/nova/compute/api.py", line 723, in _validate_flavor_image_nostatus
2021-05-19 13:17:58.453 12 ERROR nova.api.openstack.wsgi validate_pci=valid...

Read more...

Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to nova (master)

Reviewed: https://review.opendev.org/c/openstack/nova/+/790658
Committed: https://opendev.org/openstack/nova/commit/e1cc0ed978d40596d368ba19063fb5b51e96421e
Submitter: "Zuul (22348)"
Branch: master

commit e1cc0ed978d40596d368ba19063fb5b51e96421e
Author: Lee Yarwood <email address hidden>
Date: Tue May 11 11:05:48 2021 +0100

    Add regression test for bug #1928063

    Related-Bug: #1928063
    Change-Id: Ieb19b4e5ffde56b7f72805aa231f595f45989e60

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.opendev.org/c/openstack/nova/+/790659
Committed: https://opendev.org/openstack/nova/commit/9d037f7d199443da0f2c6c1755704e589d52e730
Submitter: "Zuul (22348)"
Branch: master

commit 9d037f7d199443da0f2c6c1755704e589d52e730
Author: Lee Yarwood <email address hidden>
Date: Wed May 12 13:11:50 2021 +0100

    image_meta: Provide image_ref as the id when fetching from instance

    At present various users of instance.image_meta expect it to be a fully
    populated ImageMeta object. However when the instance is pulled from the
    database the ImageMeta object is only partially populated via
    instance.system_metadata with a limited set of attributes such as
    min_ram, min_disk, disk_format and container_format. This can result in
    NotImplementedErrors being raised by o.vo as seen in bug #1928063 when
    an attempt is made to access common attributes such as id or name.

    To avoid this the id is now provided by instance.image_ref when
    available.

    The majority of the change is test fallout and ensuring that valid UUIDs
    are provided as instance.image_ref and used by instance.image_meta.

    Related-Bug: #1928063
    Change-Id: I55d66c3a6cbd50da90065f4a58f77b5cd29ce9ea

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (stable/wallaby)

Related fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/nova/+/792902

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (stable/victoria)

Related fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/nova/+/792903

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (stable/wallaby)

Related fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/nova/+/793354

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (stable/victoria)

Related fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/nova/+/793357

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (stable/ussuri)

Related fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/nova/+/793372

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Related fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/nova/+/793374

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.opendev.org/c/openstack/nova/+/790660
Committed: https://opendev.org/openstack/nova/commit/e98994027f0af0b22277bcfaed4ab6e6f4a2c74e
Submitter: "Zuul (22348)"
Branch: master

commit e98994027f0af0b22277bcfaed4ab6e6f4a2c74e
Author: Lee Yarwood <email address hidden>
Date: Tue May 11 11:37:22 2021 +0100

    hardware: Use image_meta.id within get_mem_encryption_constraint

    This change resolves bug #1928063 by replacing the use of
    image_meta.name with image_meta.id as
    I55d66c3a6cbd50da90065f4a58f77b5cd29ce9ea should ensure it is always
    available. The removal of other references to image_meta.name within
    virt.hardware is left for follow ups to keep this change small and
    backportable.

    Closes-Bug: #1928063
    Change-Id: I66299e97bdb5b95e149b1780231a1c1bbdbd9865

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

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/nova/+/793956

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/nova/+/793957

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/nova/+/793958

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (stable/train)

Related fix proposed to branch: stable/train
Review: https://review.opendev.org/c/openstack/nova/+/794042

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/c/openstack/nova/+/794043

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 24.0.0.0rc1

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

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

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/train
Review: https://review.opendev.org/c/openstack/nova/+/794042
Reason: stable/train branch of nova projects' have been tagged as End of Life. All open patches have to be abandoned in order to be able to delete the branch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/train
Review: https://review.opendev.org/c/openstack/nova/+/794043
Reason: stable/train branch of nova projects' have been tagged as End of Life. All open patches have to be abandoned in order to be able to delete the branch.

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

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/nova/+/793958
Reason: stable/ussuri branch of openstack/nova transitioned to End of Life and is about to be deleted. To be able to do that, all open patches need to be abandoned.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/nova/+/793374
Reason: stable/ussuri branch of openstack/nova transitioned to End of Life and is about to be deleted. To be able to do that, all open patches need to be abandoned.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/nova/+/793372
Reason: stable/ussuri branch of openstack/nova transitioned to End of Life and is about to be deleted. To be able to do that, all open patches need to be abandoned.

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

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/victoria
Review: https://review.opendev.org/c/openstack/nova/+/793957
Reason: stable/victoria branch of openstack/nova is about to be deleted. To be able to do that, all open patches need to be abandoned. Please cherry pick the patch to unmaintained/victoria if you want to further work on this patch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/victoria
Review: https://review.opendev.org/c/openstack/nova/+/792903
Reason: stable/victoria branch of openstack/nova is about to be deleted. To be able to do that, all open patches need to be abandoned. Please cherry pick the patch to unmaintained/victoria if you want to further work on this patch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/victoria
Review: https://review.opendev.org/c/openstack/nova/+/793357
Reason: stable/victoria branch of openstack/nova is about to be deleted. To be able to do that, all open patches need to be abandoned. Please cherry pick the patch to unmaintained/victoria if you want to further work on this patch.

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

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/nova/+/793354
Reason: stable/wallaby branch of openstack/nova is about to be deleted. To be able to do that, all open patches need to be abandoned. Please cherry pick the patch to unmaintained/wallaby if you want to further work on this patch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/nova/+/793956
Reason: stable/wallaby branch of openstack/nova is about to be deleted. To be able to do that, all open patches need to be abandoned. Please cherry pick the patch to unmaintained/wallaby if you want to further work on this patch.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by "Elod Illes <email address hidden>" on branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/nova/+/792902
Reason: stable/wallaby branch of openstack/nova is about to be deleted. To be able to do that, all open patches need to be abandoned. Please cherry pick the patch to unmaintained/wallaby if you want to further work on this patch.

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.