Test Step:
1. Create a type-1, backend IBM storwize SVC, without replication .
2. Create a type-2, backend IBM storwize SVC, with replication = TRUE.
3. Create a volume without type information:
command : cinder create 1
check the volume status, the information of the volume :
+--------------------------------------+-----------+------+------+-------------+----------+--------------------------------------+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+------+------+-------------+----------+--------------------------------------+
| ffd8f99a-9e17-4943-ac56-eee2e060a86a | available | None | 1 | None | false | |
The volume type is none.
4. Do Retype to enable replication for the volume with command :
cinder retype ffd8f99a-9e17-4943-ac56-eee2e060a86a type-2
It will always be failed, check the c-vol.log, it was found :
2014-09-16 09:16:01.664 ^[[01;31mERROR cinder.volume.manager [^[[01;36mreq-97d04d55-3d12-4317-bce1-ba61b0edb8d7 ^[[00;36m22e6c0f1cabc4e0ea8a7191e6942500a e83fd5b227c64ca3be40186d35670b3e^[[01;31m] ^[[01;35m^[[01;31mVolume ffd8f99a-9e17-4943-ac56-eee2e060a86a: driver error when trying to retype, falling back to generic mechanism.^[[00m
2014-09-16 09:16:01.665 ^[[01;31mERROR cinder.volume.manager [^[[01;36mreq-97d04d55-3d12-4317-bce1-ba61b0edb8d7 ^[[00;36m22e6c0f1cabc4e0ea8a7191e6942500a e83fd5b227c64ca3be40186d35670b3e^[[01;31m] ^[[01;35m^[[01;31mInvalid volume type: id cannot be None^[[00m
^[[01;31m2014-09-16 09:16:01.665 TRACE cinder.volume.manager ^[[01;35m^[[00mTraceback (most recent call last):
^[[01;31m2014-09-16 09:16:01.665 TRACE cinder.volume.manager ^[[01;35m^[[00m File "/opt/stack/cinder/cinder/volume/manager.py", line 1410, in retype
^[[01;31m2014-09-16 09:16:01.665 TRACE cinder.volume.manager ^[[01;35m^[[00m host)
^[[01;31m2014-09-16 09:16:01.665 TRACE cinder.volume.manager ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 105, in wrapper
^[[01;31m2014-09-16 09:16:01.665 TRACE cinder.volume.manager ^[[01;35m^[[00m return f(*args, **kwargs)
^[[01;31m2014-09-16 09:16:01.665 TRACE cinder.volume.manager ^[[01;35m^[[00m File "/opt/stack/cinder/cinder/volume/drivers/ibm/storwize_svc/__init__.py", line 926, in retype
^[[01;31m2014-09-16 09:16:01.665 TRACE cinder.volume.manager ^[[01;35m^[[00m model_update = self.replication.create_replica(ctxt, volume)
^[[01;31m2014-09-16 09:16:01.665 TRACE cinder.volume.manager ^[[01;35m^[[00m File "/opt/stack/cinder/cinder/volume/drivers/ibm/storwize_svc/replication.py", line 73, in create_replica
^[[01;31m2014-09-16 09:16:01.665 TRACE cinder.volume.manager ^[[01;35m^[[00m vol_type = volume_types.get_volume_type(ctxt, vol_type)
^[[01;31m2014-09-16 09:16:01.665 TRACE cinder.volume.manager ^[[01;35m^[[00m File "/opt/stack/cinder/cinder/volume/volume_types.py", line 103, in get_volume_type
^[[01;31m2014-09-16 09:16:01.665 TRACE cinder.volume.manager ^[[01;35m^[[00m raise exception.InvalidVolumeType(reason=msg)
^[[01;31m2014-09-16 09:16:01.665 TRACE cinder.volume.manager ^[[01;35m^[[00mInvalidVolumeType: Invalid volume type: id cannot be None
^[[01;31m2014-09-16 09:16:01.665 TRACE cinder.volume.manager ^[[01;35m^[[00m
2014-09-16 09:16:01.737 ^[[01;31mERROR oslo.messaging.rpc.dispatcher [^[[01;36mreq-97d04d55-3d12-4317-bce1-ba61b0edb8d7 ^[[00;36m22e6c0f1cabc4e0ea8a7191e6942500a e83fd5b227c64ca3be40186d35670b3e^[[01;31m] ^[[01;35m^[[01;31mException during message handling: Volume migration failed: Retype requires migration but is not allowed.^[[00m
^[[01;31m2014-09-16 09:16:01.737 TRACE oslo.messaging.rpc.dispatcher ^[[01;35m^[[00mTraceback (most recent call last):
^[[01;31m2014-09-16 09:16:01.737 TRACE oslo.messaging.rpc.dispatcher ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 134, in _dispatch_and_reply
^[[01;31m2014-09-16 09:16:01.737 TRACE oslo.messaging.rpc.dispatcher ^[[01;35m^[[00m incoming.message))
^[[01;31m2014-09-16 09:16:01.737 TRACE oslo.messaging.rpc.dispatcher ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 177, in _dispatch
^[[01;31m2014-09-16 09:16:01.737 TRACE oslo.messaging.rpc.dispatcher ^[[01;35m^[[00m return self._do_dispatch(endpoint, method, ctxt, args)
^[[01;31m2014-09-16 09:16:01.737 TRACE oslo.messaging.rpc.dispatcher ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 123, in _do_dispatch
^[[01;31m2014-09-16 09:16:01.737 TRACE oslo.messaging.rpc.dispatcher ^[[01;35m^[[00m result = getattr(endpoint, method)(ctxt, **new_args)
^[[01;31m2014-09-16 09:16:01.737 TRACE oslo.messaging.rpc.dispatcher ^[[01;35m^[[00m File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 105, in wrapper
^[[01;31m2014-09-16 09:16:01.737 TRACE oslo.messaging.rpc.dispatcher ^[[01;35m^[[00m return f(*args, **kwargs)
^[[01;31m2014-09-16 09:16:01.737 TRACE oslo.messaging.rpc.dispatcher ^[[01;35m^[[00m File "/opt/stack/cinder/cinder/volume/manager.py", line 1434, in retype
^[[01;31m2014-09-16 09:16:01.737 TRACE oslo.messaging.rpc.dispatcher ^[[01;35m^[[00m raise exception.VolumeMigrationFailed(reason=msg)
^[[01;31m2014-09-16 09:16:01.737 TRACE oslo.messaging.rpc.dispatcher ^[[01;35m^[[00mVolumeMigrationFailed: Volume migration failed: Retype requires migration but is not allowed.
^[[01;31m2014-09-16 09:16:01.737 TRACE oslo.messaging.rpc.dispatcher ^[[01;35m^[[00m
It looks the volume type can't be "none" if retype to a volume with replication=TRUE.
5. Do retype to try if all the retype are disabled for the "none" type volume with command :
cinder retype ffd8f99a-9e17-4943-ac56-eee2e060a86a type-1
Since type-1 replication =false, the operation was successful.
+--------------------------------------+-----------+------+------+-------------+----------+--------------------------------------+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+------+------+-------------+----------+--------------------------------------+
| ffd8f99a-9e17-4943-ac56-eee2e060a86a | available | None | 1 | type-1 | false | |
6. Do retype to enable replication again with command:
cinder retype ffd8f99a-9e17-4943-ac56-eee2e060a86a type-2
It will be success since the current operation is from type-1 to type-2.
+--------------------------------------+-----------+------+------+-------------+----------+--------------------------------------+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+------+------+-------------+----------+--------------------------------------+
| ffd8f99a-9e17-4943-ac56-eee2e060a86a | available | None | 1 | type-2 | false | |
From the front test, the retype to enable replication with "none" volume type have issues
Adding Tao for investigation.