]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Add ability to modify volume type
authorAvishay Traeger <avishay@il.ibm.com>
Tue, 3 Sep 2013 13:06:27 +0000 (16:06 +0300)
committerAvishay Traeger <avishay@il.ibm.com>
Mon, 6 Jan 2014 20:02:09 +0000 (22:02 +0200)
commit3fd7857a36f90cc28f3869139511ec4e82b50d92
treeb9e82515b8df8577b171fefbfa15c8ae2fdee3a2
parent24d7e244133ddb46fc3de79b8222424db21672d1
Add ability to modify volume type

This patch adds the volume retype operation, which allows a user to
change a given volume's type.

When retyping, the scheduler checks if the volume's current host can
accept the new type (i.e., it checks if the host passes the filters when
using the new type). If the current host is suitable, its manager is
called which calls upon the driver to change the volume's type.

There are two cases where a retype operation may require migrating the
volume:
1. The volume's current host cannot accept the new type
2. The volume's driver cannot perform the retype operation

In case of a migration, a volume with the new type is created, and the
data is migrated to it.

Volume migrations resulting from retype can be controlled by passing a
policy, which can be either:
1. 'never': Never migrate (the retype fails if migration is required)
   (default)
2. 'on-demand': Migrate when necessary

This version will cause retype operations to fail if the current and
new volume types have different:
1. QoS settings that are enforced by the front-end for in-use volumes.
2. encryption settings.

Subsequent patches can address these cases.

DocImpact

Change-Id: I2dc99b4fa64d611d2bb936fc3890ca334e08bb55
Implements: blueprint volume-retype
26 files changed:
cinder/api/contrib/volume_actions.py
cinder/exception.py
cinder/quota_utils.py [new file with mode: 0644]
cinder/scheduler/chance.py
cinder/scheduler/driver.py
cinder/scheduler/filter_scheduler.py
cinder/scheduler/filters/capacity_filter.py
cinder/scheduler/manager.py
cinder/scheduler/rpcapi.py
cinder/scheduler/simple.py
cinder/tests/api/contrib/test_volume_actions.py
cinder/tests/policy.json
cinder/tests/scheduler/fakes.py
cinder/tests/scheduler/test_filter_scheduler.py
cinder/tests/scheduler/test_rpcapi.py
cinder/tests/scheduler/test_scheduler.py
cinder/tests/test_volume.py
cinder/tests/test_volume_rpcapi.py
cinder/tests/test_volume_types.py
cinder/tests/utils.py
cinder/volume/api.py
cinder/volume/driver.py
cinder/volume/manager.py
cinder/volume/rpcapi.py
cinder/volume/volume_types.py
etc/cinder/policy.json