LVM: Optimized migration doesn't work during retype

Bug #2104334 reported by Rajat Dhasmana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Low
Rajat Dhasmana

Bug Description

After change[1] merged, we allow optimized migration path even when retyping volumes.
However, when migrating a volume from one lvm backend to another, it doesn't work.

[1] https://review.opendev.org/c/openstack/cinder/+/938827

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

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/cinder/+/945680

Changed in cinder:
status: New → In Progress
Changed in cinder:
assignee: nobody → Rajat Dhasmana (whoami-rajat)
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.opendev.org/c/openstack/cinder/+/945680
Committed: https://opendev.org/openstack/cinder/commit/5f59436bfbbafd31cf291015113183f0902fc06c
Submitter: "Zuul (22348)"
Branch: master

commit 5f59436bfbbafd31cf291015113183f0902fc06c
Author: Rajat Dhasmana <email address hidden>
Date: Thu Mar 27 06:26:24 2025 +0000

    Fix: LVM optimized migration path during retype

    Change[1] enabled optimized migration during retype but it
    doesn't currently work when trying to retype from one LVM
    backend to another.
    This happens because of a status check[2] happening at the
    start of the operation which checks if the volume is in
    'available' state.
    This is not true in case of retype as the status changes to
    'retyping'[3].
    Adding the 'retyping' state in the check fixes the issue and
    results in the following workflow.

    1. Create new volume in destination backend (lvmdriver-2)

    Mar 27 06:35:18 devstack-lvm-multi sudo[103853]: stack : PWD=/ ; USER=root ; COMMAND=/opt/stack/data/venv/bin/cinder-rootwrap /etc/cinder/rootwrap.conf env LC_ALL=C lvcreate -T -V 1g -n volume-f009cc14-69da-418e-a734-a4d9d7be89db stack
    -volumes-lvmdriver-2/stack-volumes-lvmdriver-2-pool

    2. Copy data from source to destination (lvmdriver-1 -> lvmdriver-2)

    Mar 27 06:35:20 devstack-lvm-multi sudo[103884]: stack : PWD=/ ; USER=root ; COMMAND=/opt/stack/data/venv/bin/cinder-rootwrap /etc/cinder/rootwrap.conf dd if=/dev/mapper/stack--volumes--lvmdriver--1-volume--f009cc14--69da--418e--a734--
    a4d9d7be89db of=/dev/mapper/stack--volumes--lvmdriver--2-volume--f009cc14--69da--418e--a734--a4d9d7be89db count=1073741824 bs=1M iflag=count_bytes,direct oflag=direct conv=sparse

    3. Remove volume from source backend (lvmdriver-1)

    Mar 27 06:35:21 devstack-lvm-multi sudo[103893]: stack : PWD=/ ; USER=root ; COMMAND=/opt/stack/data/venv/bin/cinder-rootwrap /etc/cinder/rootwrap.conf lvremove --config 'activation { retry_deactivation = 1} ' -f stack-volumes-lvmdriver-1/volume-f009cc14-69da-418e-a734-a4d9d7be89db

    The above confirms that the retype with optimized migration works when
    using LVM.

    [1] https://review.opendev.org/c/openstack/cinder/+/938827
    [2] https://opendev.org/openstack/cinder/src/commit/689c88da61017c22529e66c4266e6b332cc16370/cinder/volume/drivers/lvm.py#L760-L761
    [3] https://opendev.org/openstack/cinder/src/commit/689c88da61017c22529e66c4266e6b332cc16370/cinder/volume/api.py#L1963-L1964

    Closes-Bug: #2104334
    Change-Id: I8a14f35a119493bf4d2f4068bc378533cc40a4a3

Changed in cinder:
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.