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 <liuxin...@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-requ...@lists.openstack.org?subject:unsubscribe > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev > > -- Best Wishes For You!
__________________________________________________________________________ OpenStack Development Mailing List (not for usage questions) Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev