Attachment info lost after migrating a in-use volume
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-
After migration:
\+-----
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+------
| b6273fdd-
And it leads following failure when detaching the volume:
nova volume-detach 0dd4615d-
ERROR (BadRequest): Invalid volume: Volume must be attached in order to detach. (HTTP 400) (Request-ID: req-6a666b79-
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.