remove_export after changing volume to available

Bug #1616719 reported by Lisa Li
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Lisa Li

Bug Description

In master branch with lvm as backend storage:

During detach_volume, Cinder at first sets volume in available status and then removes iscsi targets.

set volume in available: https://github.com/openstack/cinder/blob/master/cinder/volume/manager.py#L1093

remove export: https://github.com/openstack/cinder/blob/master/cinder/volume/manager.py#L1108

This leads following problem:
1. Attach volume to instance 1.
2. Detach volume from instance 1.
3. At the time (when volume becomes available, and before removing remove_export) attach the volume to instance 2.
4. Is is possible that when isci target is created for instance 2, but remove_export for instance 1 removes the just created iscsi target.

As a result, attach volume to intance 2 fails.

This ever leaded CI fails http://logs.openstack.org/92/355392/4/gate/gate-tempest-dsvm-postgres-full-ubuntu-xenial/582fbd7/logs/screen-c-vol.txt.gz?level=WARNING

This exists in LVM, I am not sure whether other backend storages have same problem.

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

Fix proposed to branch: master
Review: https://review.openstack.org/360211

Changed in cinder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/360211
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=c3b33b6a23c885853d28cb340a394d72cd18839a
Submitter: Jenkins
Branch: master

commit c3b33b6a23c885853d28cb340a394d72cd18839a
Author: lisali <email address hidden>
Date: Thu Aug 25 12:03:31 2016 +0800

    Recover volume status after remove_export

    Currently Cinder recover volume's status before remove_export,
    which leads that recreated iSCSI targets may be deleted and
    attachment fails.

    Let's consider the case: A volume is attached to instance A, and then
    detached. During detach, Cinder sets volume's status to available and
    remove iSCSI targets.
    At the exact time the volume is reset to
    available but targets are not removed, the volume is attached to
    instance 2 and targets are created again. And then former remove_export
    removed the recreated targets, and then it leads attachment fail.

    This patch is to move remove_export after changing volume's
    status.

    Change-Id: I914d4badd9b93e9dc8f4ebc4f74314afe95bf855
    Closes-Bug: #1616719

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 9.0.0.0rc1

This issue was fixed in the openstack/cinder 9.0.0.0rc1 release candidate.

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.