migrate in-use volume results in residual src volume in storage and dest volume with "attaching" status
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
In Progress
|
Undecided
|
haruka tanizawa |
Bug Description
The Nova hypervisor driver is libvirt/qemu.
Set up multi-backend (LVM and NFS) Cinder-volume with the same backend_name, then migrate in-use volume from one backend to the other, the results as follows:
1. Log of cinder-volume will contains error info:
Failed to delete migration source vol 04012d12-
And it will cause the src volume be residual after migration.
2. After migration, the volume's status will keep "attaching". Indeed, checking the instance configuration with "virsh dumpxml" comamnd, the src volume has already swapped by dest volume.
I have some analysis about it, the information as follows:
1. When migrating in-use volume, cinder will first create a new volume as the dest volume, and then call Nova API (update_
2. After Nova has done the migrate work, it will call Cinder API (migrate_
::
#cinder.
# Delete the source volume (if it fails, don't fail the migration)
try:
except Exception as ex:
msg = _("Failed to delete migration source vol %(vol)s: %(err)s")
::
3. Then Cinder will copy the info of dest volume to src volume in database, and then destroy the dest volume record in database:
::
#cinder.
::
4. After migrate_
description: | updated |
tags: | added: migrate |
I think the solution is to allow delete_volume to succeed in this case, by checking volume_ ref['migration_ status' ].
Could you please try the following fix: ref['attach_ status' ] == "attached": ref['attach_ status' ] == "attached" and not volume_ ref['migration_ status' ]:
In delete_volume, change:
if volume_
To:
if volume_