Attachment info lost after migrating a in-use volume

Bug #1614371 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 2016/8/18,

Create two lvm pools with two backend storages, start volume service.

Create a volume and attach it to an instance.

Migrate the volume to the other backend.

After migration finishes, the attachment info lost.

Before migration,
+--------------------------------------+-----------+------+------+-------------+----------+--------------------------------------+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+------+------+-------------+----------+--------------------------------------+
| b6273fdd-c9ad-4be7-a48a-81d0894df57b | in-use | - | 1 | tet | false | 0dd4615d-b144-47ff-8540-855849e58b2b |

After migration:

\+--------------------------------------+--------+------+------+-------------+----------+--------------------------------------+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+--------+------+------+-------------+----------+--------------------------------------+
| b6273fdd-c9ad-4be7-a48a-81d0894df57b | in-use | - | 1 | tet | false | |

And it leads following failure when detaching the volume:

nova volume-detach 0dd4615d-b144-47ff-8540-855849e58b2b b6273fdd-c9ad-4be7-a48a-81d0894df57b
ERROR (BadRequest): Invalid volume: Volume must be attached in order to detach. (HTTP 400) (Request-ID: req-6a666b79-f311-4ece-b716-21de0dd04153)

Revision history for this message
Lisa Li (lisali) wrote :

The problem is that in Nova, it detaches the old volume, and attaches the new volume.

https://github.com/openstack/nova/blob/master/nova/compute/api.py#L3296-L3299

But later in cinder, it changes the new volume id with old volume id.

Revision history for this message
Lisa Li (lisali) wrote :

Please ignore the above comments.
Real problem exists in migrate_volume_completion

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/356992

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/356992
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=7a8daa5c61cb7b8349bfb12e20304084e0118309
Submitter: Jenkins
Branch: master

commit 7a8daa5c61cb7b8349bfb12e20304084e0118309
Author: lisali <email address hidden>
Date: Thu Aug 18 15:48:01 2016 +0800

    Attachment lost after migrating in-use volume

    Without proper refresh, attachment info are lost after
    migrating in-use volumes. This is to fix the problem.

    Change-Id: I31012a1871b85e038e6595097ad25224488d72a1
    Closes-bug: #1614371

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/cinder 9.0.0.0b3

This issue was fixed in the openstack/cinder 9.0.0.0b3 development milestone.

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.