Retype a "None" type volume to a "replication" type will always be failed

Bug #1369815 reported by yixuan zhang
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
TaoBai

Bug Description

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

Revision history for this message
Jay Bryant (jsbryant) wrote :

Adding Tao for investigation.

tags: added: drivers storwize
TaoBai (baitao2020)
Changed in cinder:
assignee: nobody → TaoBai (baitao2020)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/122365

Changed in cinder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/122365
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=ea32e07f36781c2c0c7a0aa28817cc2df23df32d
Submitter: Jenkins
Branch: master

commit ea32e07f36781c2c0c7a0aa28817cc2df23df32d
Author: TaoBai <email address hidden>
Date: Thu Sep 18 11:49:47 2014 +0300

    IBM Storwize:Failed to retype from non-type to replication enable

    It used none as volume type to create replication. Storwize Driver
    did not check whether it's none.
    Change to use new type to create replication.

    Closes-bug: #1369815

    Change-Id: I78501e1d3558bd6c3e6e1abb0c312cec7d11efd4

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → juno-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: juno-rc1 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.