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

commit 6fd071b904282e106de7488a076d4f703636af21
Author: maaoyu <[email protected]>
Date:   Thu Sep 2 14:11:14 2021 +0800

    compute: Update volume_id within connection_info during swap_volume
    
    When Cinder orchestrates a volume migration between backends it
    initially creates a temporary volume on the destination before calling
    Nova to swap to that volume. When this is complete Nova calls back to
    Cinder and the temporary volume on the destination is renamed to the
    original volume UUID making the migration transparent to end users.
    
    Previously Nova would not account for this within the connection_info
    stahed when connecting the new volume and would continue to point to the
    original UUID of the temporary volume. For most codepaths in Nova this
    isn't an issue but when dealing with multiattach volumes the libvirt
    driver has a specific path that uses this stored volume_id within the
    connection_info when an attempt is made to detach the volume,
    nova.virt.libvirt.LibvirtDriver._should_disconnect_target. In this case
    this would lead to a failed lookup of the volume in Cinder and an
    eventual 500 returned by Nova.
    
    This change corrects this by ensuring any volume_id stashed in the
    new connection_info we gather during a swap_volume is overwritten with
    the correct id returned by the eventual call to Cinder's
    os-migrate_volume_completion API [1].
    
    [1] 
https://docs.openstack.org/api-ref/block-storage/v3/index.html?expanded=complete-migration-of-a-volume-detail#volumes-volumes
    
    Co-Authored-By: Lee Yarwood <[email protected]>
    Closes-Bug: #1943431
    Change-Id: I43612714b343d98320b19b5b38264afc700790e3


** 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/1943431

Title:
  swap ro multiattach volume, report an error VolumeNotFound

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  Description
  ===========
  If a ro multiattach volume has been swaped, nova will report an error 
VolumeNotFound during the next swap_volume.The reason is that table 
bdm.connection_info records the _name_id of the volume(if it's not empty), so 
func self._should_disconnect_target in libvirt driver get the volume by id(from 
bdm connection_info) report an error VolumeNotFound.

  Steps to reproduce
  ==================
  1. I swap a multiattach volume
  2. After migrated, the volume's _name_id is not empty
  3. Then continue to migrate the volume
  4. Report an error VolumeNotFound

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


-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to