Reviewed: https://review.opendev.org/c/openstack/nova/+/811716 Committed: https://opendev.org/openstack/nova/commit/cfd6c6b76f0d3bb271fdebf5c3d245603ccdf7e2 Submitter: "Zuul (22348)" Branch: master
commit cfd6c6b76f0d3bb271fdebf5c3d245603ccdf7e2 Author: Lee Yarwood <lyarw...@redhat.com> Date: Wed Sep 29 11:58:52 2021 +0100 nova-manage: Always get BDMs using get_by_volume_and_instance Previously the volume_attachments show command would incorrectly use the nova.objects.BlockDeviceMapping.get_by_volume helper to fetch the underlying BlockDeviceMapping object from the database that does not support multiattach volumes. This is corrected by switching to the get_by_volume_and_instance helper that can pick out unique BlockDeviceMapping objects using both of the supplied volume and instance UUIDs. Change-Id: Ifab05abf3775efb0f29f80c9300297208f60d5d9 Closes-Bug: #1945452 ** 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/1945452 Title: nova-manage volume_attachment show against a multiattach volume fails Status in OpenStack Compute (nova): Fix Released Bug description: Description =========== $subject $ openstack volume show 02a27e61-b242-460e-8cf6-8525c5353698 -f json -c multiattach { "multiattach": true } $ nova-manage volume_attachment show 74adb548-f3ed-4d68-b282-b278dd1ec3f2 02a27e61-b242-460e-8cf6-8525c5353698 --json --connection_info Unexpected error, see nova-manage.log for the full trace: Block Device Mapping 02a27e61-b242-460e-8cf6-8525c5353698 is a multi-attach volume and is not valid for this operation. ERROR nova.cmd.manage [None req-d989b05f-5747-4840-99b6-892443a3ac35 None None] Unexpected error: nova.exception.VolumeBDMIsMultiAttach: Block Device Mapping 02a27e61-b242-460e-8cf6-8525c5353698 is a multi-attach volume and is not valid for this operation. ERROR nova.cmd.manage Traceback (most recent call last): ERROR nova.cmd.manage File "/opt/stack/nova/nova/cmd/manage.py", line 2872, in show ERROR nova.cmd.manage bdm = objects.BlockDeviceMapping.get_by_volume( ERROR nova.cmd.manage File "/usr/local/lib/python3.8/site-packages/oslo_versionedobjects/base.py", line 184, in wrapper ERROR nova.cmd.manage result = fn(cls, context, *args, **kwargs) ERROR nova.cmd.manage File "/opt/stack/nova/nova/objects/block_device.py", line 294, in get_by_volume ERROR nova.cmd.manage raise exception.VolumeBDMIsMultiAttach(volume_id=volume_id) ERROR nova.cmd.manage nova.exception.VolumeBDMIsMultiAttach: Block Device Mapping 02a27e61-b242-460e-8cf6-8525c5353698 is a multi-attach volume and is not valid for this operation. ERROR nova.cmd.manage Steps to reproduce ================== * nova-manage volume_attachment show against a multiattach volume Expected result =============== Command completes successfully. Actual result ============= Command fails as the wrong DB BDM lookup method is used. Environment =========== 1. Exact version of OpenStack you are running. See the following list for all releases: http://docs.openstack.org/releases/ master 2. Which hypervisor did you use? (For example: Libvirt + KVM, Libvirt + XEN, Hyper-V, PowerKVM, ...) What's the version of that? libvirt 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 ============== To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1945452/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp