diff --git a/tempest/common/waiters.py b/tempest/common/waiters.py
index fe648a0..8303caf 100644
--- a/tempest/common/waiters.py
+++ b/tempest/common/waiters.py
@@ -189,6 +189,25 @@
             raise lib_exc.TimeoutException(message)
 
 
+def wait_for_volume_retype(client, volume_id, new_volume_type):
+    """Waits for a Volume to have a new volume type."""
+    body = client.show_volume(volume_id)['volume']
+    current_volume_type = body['volume_type']
+    start = int(time.time())
+
+    while current_volume_type != new_volume_type:
+        time.sleep(client.build_interval)
+        body = client.show_volume(volume_id)['volume']
+        current_volume_type = body['volume_type']
+
+        if int(time.time()) - start >= client.build_timeout:
+            message = ('Volume %s failed to reach %s volume type (current %s) '
+                       'within the required time (%s s).' %
+                       (volume_id, new_volume_type, current_volume_type,
+                        client.build_timeout))
+            raise exceptions.TimeoutException(message)
+
+
 def wait_for_snapshot_status(client, snapshot_id, status):
     """Waits for a Snapshot to reach a given status."""
     body = client.show_snapshot(snapshot_id)['snapshot']
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index 46949ad..8c930c3 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -248,6 +248,27 @@
         volume = self.volumes_client.show_volume(volume['id'])['volume']
         return volume
 
+    def create_volume_type(self, client=None, name=None, backend_name=None):
+        if not client:
+            client = self.admin_volume_types_client
+        if not name:
+            class_name = self.__class__.__name__
+            name = data_utils.rand_name(class_name + '-volume-type')
+        randomized_name = data_utils.rand_name('scenario-type-' + name)
+
+        LOG.debug("Creating a volume type: %s on backend %s",
+                  randomized_name, backend_name)
+        extra_specs = {}
+        if backend_name:
+            extra_specs = {"volume_backend_name": backend_name}
+
+        body = client.create_volume_type(name=randomized_name,
+                                         extra_specs=extra_specs)
+        volume_type = body['volume_type']
+        self.assertIn('id', volume_type)
+        self.addCleanup(client.delete_volume_type, volume_type['id'])
+        return volume_type
+
     def _create_loginable_secgroup_rule(self, secgroup_id=None):
         _client = self.compute_security_groups_client
         _client_rules = self.compute_security_group_rules_client
@@ -1246,19 +1267,6 @@
             cls.admin_encryption_types_client =\
                 cls.os_adm.encryption_types_client
 
-    def create_volume_type(self, client=None, name=None):
-        if not client:
-            client = self.admin_volume_types_client
-        if not name:
-            name = 'generic'
-        randomized_name = data_utils.rand_name('scenario-type-' + name)
-        LOG.debug("Creating a volume type: %s", randomized_name)
-        body = client.create_volume_type(
-            name=randomized_name)['volume_type']
-        self.assertIn('id', body)
-        self.addCleanup(client.delete_volume_type, body['id'])
-        return body
-
     def create_encryption_type(self, client=None, type_id=None, provider=None,
                                key_size=None, cipher=None,
                                control_location=None):
diff --git a/tempest/scenario/test_volume_migrate_attached.py b/tempest/scenario/test_volume_migrate_attached.py
new file mode 100644
index 0000000..dfda18d
--- /dev/null
+++ b/tempest/scenario/test_volume_migrate_attached.py
@@ -0,0 +1,128 @@
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
+#    not use this file except in compliance with the License. You may obtain
+#    a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+#    License for the specific language governing permissions and limitations
+#    under the License.
+
+from oslo_log import log as logging
+
+from tempest.common import waiters
+from tempest import config
+from tempest.scenario import manager
+from tempest import test
+
+CONF = config.CONF
+LOG = logging.getLogger(__name__)
+
+
+class TestVolumeMigrateRetypeAttached(manager.ScenarioTest):
+
+    """This test case attempts to reproduce the following steps:
+
+     * Create 2 volume types representing 2 different backends
+     * Create in Cinder some bootable volume importing a Glance image using
+     *   volume_type_1
+     * Boot an instance from the bootable volume
+     * Write to the volume
+     * Perform a cinder retype --on-demand of the volume to type of backend #2
+     * Check written content of migrated volume
+    """
+
+    credentials = ['primary', 'admin']
+
+    @classmethod
+    def setup_clients(cls):
+        super(TestVolumeMigrateRetypeAttached, cls).setup_clients()
+        if CONF.volume_feature_enabled.api_v1:
+            cls.admin_volume_types_client = cls.os_adm.volume_types_client
+        else:
+            cls.admin_volume_types_client = cls.os_adm.volume_types_v2_client
+
+    @classmethod
+    def skip_checks(cls):
+        super(TestVolumeMigrateRetypeAttached, cls).skip_checks()
+        if not CONF.volume_feature_enabled.multi_backend:
+            raise cls.skipException("Cinder multi-backend feature disabled")
+
+        if len(set(CONF.volume.backend_names)) < 2:
+            raise cls.skipException("Requires at least two different "
+                                    "backend names")
+
+    def _boot_instance_from_volume(self, vol_id, keypair, security_group):
+
+        key_name = keypair['name']
+        security_groups = [{'name': security_group['name']}]
+        block_device_mapping = [{'device_name': 'vda', 'volume_id': vol_id,
+                                 'delete_on_termination': False}]
+
+        return self.create_server(image_id='', wait_until='ACTIVE',
+                                  key_name=key_name,
+                                  security_groups=security_groups,
+                                  block_device_mapping=block_device_mapping)
+
+    def _create_volume_types(self):
+        backend_names = CONF.volume.backend_names
+
+        backend_source = backend_names[0]
+        backend_dest = backend_names[1]
+
+        source_body = self.create_volume_type(backend_name=backend_source)
+        dest_body = self.create_volume_type(backend_name=backend_dest)
+
+        LOG.info("Created Volume types: %(src)s -> %(src_backend)s, %(dst)s "
+                 "-> %(dst_backend)s", {'src': source_body['name'],
+                                        'src_backend': backend_source,
+                                        'dst': dest_body['name'],
+                                        'dst_backend': backend_dest})
+        return source_body['name'], dest_body['name']
+
+    def _volume_retype_with_migration(self, volume_id, new_volume_type):
+        migration_policy = 'on-demand'
+        self.volumes_client.retype_volume(
+            volume_id, new_type=new_volume_type,
+            migration_policy=migration_policy)
+        waiters.wait_for_volume_retype(self.volumes_client,
+                                       volume_id, new_volume_type)
+
+    @test.idempotent_id('deadd2c2-beef-4dce-98be-f86765ff311b')
+    @test.services('compute', 'volume')
+    def test_volume_migrate_attached(self):
+        LOG.info("Creating keypair and security group")
+        keypair = self.create_keypair()
+        security_group = self._create_security_group()
+
+        # create volume types
+        LOG.info("Creating Volume types")
+        source_type, dest_type = self._create_volume_types()
+
+        # create an instance from volume
+        LOG.info("Booting instance from volume")
+        volume_origin = self.create_volume(imageRef=CONF.compute.image_ref,
+                                           volume_type=source_type)
+
+        instance = self._boot_instance_from_volume(volume_origin['id'],
+                                                   keypair, security_group)
+
+        # write content to volume on instance
+        LOG.info("Setting timestamp in instance %s", instance['id'])
+        ip_instance = self.get_server_ip(instance)
+        timestamp = self.create_timestamp(ip_instance,
+                                          private_key=keypair['private_key'])
+
+        # retype volume with migration from backend #1 to backend #2
+        LOG.info("Retyping Volume %s to new type %s", volume_origin['id'],
+                 dest_type)
+        self._volume_retype_with_migration(volume_origin['id'], dest_type)
+
+        # check the content of written file
+        LOG.info("Getting timestamp in postmigrated instance %s",
+                 instance['id'])
+        timestamp2 = self.get_timestamp(ip_instance,
+                                        private_key=keypair['private_key'])
+        self.assertEqual(timestamp, timestamp2)
