]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Volume status management during migration
authorVincent Hou <sbhou@cn.ibm.com>
Thu, 28 May 2015 03:18:09 +0000 (11:18 +0800)
committerVincent Hou <sbhou@cn.ibm.com>
Fri, 28 Aug 2015 01:54:28 +0000 (09:54 +0800)
commit21bc0537e04c666f99d7ee0d5eca6fcb5e589523
tree8ac05ff6b9b6d4de47d27ab81009b691eb75c8f2
parente7c6d6d0cc954cdbfe18a07ad09aaf133ba1b089
Volume status management during migration

This patch proposes a new implementation for the status and
the migration_status for volumes.

* The initial migration_status is None, meaning no migration has been
done; Migration_status 'error' means the previous migration failed.
Migration_status 'success' means the previous migration succeeded.

* If the key 'lock_volume' is set to True from the request, the volume
status should be set to 'maintenance' during migration and goes
back to its original status after migration. Otherwise, if the
key 'lock_volume' is set to False, the volume status will remain the
same as its original status. The default value for lock_volume is
False and it applies to the available volume.

* From the REST's perspectives, all the create, update and delete
actions are not allowed if the volume is in 'maintenance', because
it means the volume is out of service. If it is not in maintenance
mode, the migration can be interrupted if other requests are
issued, e.g. attach. For the termination of migration, another
patch will target to resolve it.

DocImpact
APIImpact The key 'lock_volume' has been added into the API,
telling the volume to change the status to 'maintenance' or not.
The migration_status has been added into results returned
from volume list command, if the request is from an admin.

Change-Id: Ia86421f2d6fce61dcfeb073f8e7b9c9dde517373
Partial-implements: blueprint migration-improvement
13 files changed:
cinder/api/contrib/admin_actions.py
cinder/api/v2/views/volumes.py
cinder/api/v2/volume_metadata.py
cinder/db/sqlalchemy/api.py
cinder/scheduler/manager.py
cinder/tests/unit/api/v1/test_volume_metadata.py
cinder/tests/unit/api/v2/test_volume_metadata.py
cinder/tests/unit/api/v2/test_volumes.py
cinder/tests/unit/scheduler/test_scheduler.py
cinder/tests/unit/test_volume.py
cinder/utils.py
cinder/volume/api.py
cinder/volume/manager.py