[openstack-dev] Detach a volume when it's under migration
hao wang
sxmatch1986 at gmail.com
Mon Aug 10 06:55:56 UTC 2015
I think cinder allow detach volume when it's under migration, but the
volume status will not become 'detaching' or 'available'.
See the code of begin_detaching in cinder:
# If we are in the middle of a volume migration, we don't want the
user
# to see that the volume is 'detaching'. Having 'migration_status'
set
# will have the same effect internally.
if volume['migration_status']:
return
The volume status should be updated correctly when migration is finish.
There is a routine in _migrate_volume_generic to update the new volume
status after driver.copy_volume_data is done.
2015-08-10 13:09 GMT+08:00 liuxinguo <liuxinguo at huawei.com>:
> Detach a volume when it's under migration, volume status is still “in-use”:
>
> 1. create vol-1
>
> 2. attach vol-1 to a vm
>
> 3. migrate vol-1
>
> 4. when vol-1 is under migration, detach vol-1
>
> 5. after vol-1 is detached, command “cinder list” show that the
> Status of vol-1 is still “in-use”.
>
>
>
> If 'migration_status' of the volume is not None, detach process won’t
> update the status of the volume to 'available':
>
>
>
> volume_ref = _volume_get(context, volume_id, session=session)
>
> if not remain_attachment:
>
> # Hide status update from user if we're performing volume
> migration
>
> # or uploading it to image
>
> if (*not volume_ref['migration_status']* and
>
> not (volume_ref[*'status'*] == *'uploading'*)):
>
> volume_ref[*'status'*] = *'available'*
>
>
>
> So how to deal with this? Dose it means that we should not detach a volume
> when it’s under migration?
>
>
>
> Thanks for any input!
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
--
Best Wishes For You!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150810/ee9173e3/attachment.html>
More information about the OpenStack-dev
mailing list