← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2041511] Re: nova api returns 500 when creating a volume booted instance with memory enryption enabled

 

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

commit e6f8bf5ff5c0a7ae811e4635e947d58e60d13c06
Author: songjie <songjie_yewu@xxxxxxxxxxxxxxxxxxxx>
Date:   Fri Jan 5 17:25:58 2024 +0800

    hardware: Fix image_meta.id within get_mem_encryption_constraint
    
    In get_mem_encryption_constraint, image_meta.id may not exist.
    For example, a volume booted instance. So we check whether the
    id exists. If there is no value, we set it to a sentinel value
    that can be detected later. i.e. '<no id>', as Sean suggested.
    Closes-Bug: #2041511
    Related-Bug: #2047399
    Change-Id: Id4a9d3972589ed7f1c21ffbe0a13d61136b73470
    Signed-off-by: songjie <songjie_yewu@xxxxxxxxxxxxxxxxxxxx>


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/2041511

Title:
  nova api returns 500 when creating a volume booted instance with
  memory enryption enabled

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  Description
  ===========

  When creating an instance with an volume created from an image with
  hw_mem_encryption: true, nova-api returns 500 and the creation request
  is not accepted.

  Steps to reproduce
  ==================
  * Create an image with hw_mem_encryption=True
   $ openstack image create encrypted ...
   $ openstack image set encrypted --property hw_mem_encryption=True

  * Create a volume from the image
   $ openstack volume create bootvolume --image encrypted ...

  * Create an instance
   $ openstack server create --volume bootvolume ...

  Expected result
  ===============
  Instance creation is accepted and processed by nova, without errors

  Actual result
  =============
  Nova api returns 500 error and does not accept the request

  Environment
  ===========

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

  Ubuntu 22.04 and UCA bobcat.

  # dpkg -l | grep nova
  ii  nova-api                                    3:28.0.0-0ubuntu1~cloud0                             all          OpenStack Compute - API frontend
  ii  nova-common                                 3:28.0.0-0ubuntu1~cloud0                             all          OpenStack Compute - common files
  ii  nova-compute                                3:28.0.0-0ubuntu1~cloud0                             all          OpenStack Compute - compute node base
  ii  nova-compute-kvm                            3:28.0.0-0ubuntu1~cloud0                             all          OpenStack Compute - compute node (KVM)
  ii  nova-compute-libvirt                        3:28.0.0-0ubuntu1~cloud0                             all          OpenStack Compute - compute node libvirt support
  ii  nova-conductor                              3:28.0.0-0ubuntu1~cloud0                             all          OpenStack Compute - conductor service
  ii  nova-novncproxy                             3:28.0.0-0ubuntu1~cloud0                             all          OpenStack Compute - NoVNC proxy
  ii  nova-scheduler                              3:28.0.0-0ubuntu1~cloud0                             all          OpenStack Compute - virtual machine scheduler
  ii  python3-nova                                3:28.0.0-0ubuntu1~cloud0                             all          OpenStack Compute Python 3 libraries
  ii  python3-novaclient                          2:18.4.0-0ubuntu1~cloud0                             all          client library for OpenStack Compute API - 3.x

  2. Which hypervisor did you use?
  Libvirt + KVM

  3. Which storage type did you use?
  LVM

  4. Which networking type did you use?
  ml2 + ovs

  Logs & Configs
  ==============
  The following traceback is found in nova-api.log

  ```
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi [None req-f55255c7-5829-4f89-bee9-ab34a6c02faf 69d6ccfef7e240398970c80f0be8ccf7 5a2803c4cdb1412fa1e83738d7821904 - - default default] Unexpected exception in API method: NotImplementedError: Cannot load 'id' in the base class
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi Traceback (most recent call last):
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi   File "/usr/lib/python3/dist-packages/nova/api/openstack/wsgi.py", line 658, in wrapped
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi     return f(*args, **kwargs)
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi   File "/usr/lib/python3/dist-packages/nova/api/validation/__init__.py", line 110, in wrapper
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi     return func(*args, **kwargs)
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi   File "/usr/lib/python3/dist-packages/nova/api/validation/__init__.py", line 110, in wrapper
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi     return func(*args, **kwargs)
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi   File "/usr/lib/python3/dist-packages/nova/api/validation/__init__.py", line 110, in wrapper
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi     return func(*args, **kwargs)
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi   [Previous line repeated 11 more times]
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi   File "/usr/lib/python3/dist-packages/nova/api/openstack/compute/servers.py", line 786, in create
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi     instances, resv_id = self.compute_api.create(
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi   File "/usr/lib/python3/dist-packages/nova/compute/api.py", line 2207, in create
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi     return self._create_instance(
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi   File "/usr/lib/python3/dist-packages/nova/compute/api.py", line 1725, in _create_instance
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi     self._checks_for_create_and_rebuild(context, image_id, boot_meta,
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi   File "/usr/lib/python3/dist-packages/nova/compute/api.py", line 1020, in _checks_for_create_and_rebuild
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi     self._validate_flavor_image(context, image_id, image,
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi   File "/usr/lib/python3/dist-packages/nova/compute/api.py", line 684, in _validate_flavor_image
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi     self._validate_flavor_image_nostatus(
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi   File "/usr/lib/python3/dist-packages/nova/compute/api.py", line 830, in _validate_flavor_image_nostatus
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi     API._validate_flavor_image_numa_pci(
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi   File "/usr/lib/python3/dist-packages/nova/compute/api.py", line 880, in _validate_flavor_image_numa_pci
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi     hardware.get_mem_encryption_constraint(flavor, image_meta)
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi   File "/usr/lib/python3/dist-packages/nova/virt/hardware.py", line 1195, in get_mem_encryption_constraint
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi     image_meta.id)
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi   File "/usr/lib/python3/dist-packages/oslo_versionedobjects/base.py", line 67, in getter
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi     self.obj_load_attr(name)
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi   File "/usr/lib/python3/dist-packages/oslo_versionedobjects/base.py", line 600, in obj_load_attr
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi     raise NotImplementedError(
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi NotImplementedError: Cannot load 'id' in the base class
  2023-10-27 07:46:56.878 381436 ERROR nova.api.openstack.wsgi
  ```

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/2041511/+subscriptions



References