]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Retype functionality in Tintri driver
authorapoorvad <apps.desh@gmail.com>
Wed, 9 Dec 2015 17:42:21 +0000 (09:42 -0800)
committerapoorvad <apps.desh@gmail.com>
Wed, 9 Dec 2015 19:25:28 +0000 (11:25 -0800)
At this point default retype behavior is as follows. If a volume changes
type on the same backend then that volume will be migrated. Since Tintri
VMstore does not differentiate between volume types, we can avoid this
migration by implementing retype functionality.

Change-Id: I40b28327e13821d6fb45f89b15267b21ed4c2e8c
closes-bug: 1524435

cinder/tests/unit/test_tintri.py
cinder/volume/drivers/tintri.py

index e9781f53b7d11c21f1d9ebfdf38689b4d634f79f..c4abe165db19fb52710f1f4e18f4d660e82f49cb 100644 (file)
@@ -245,3 +245,9 @@ class TintriDriverTestCase(test.TestCase):
         volume = fake_volume.fake_volume_obj(self.context)
         volume.provider_location = self._provider_location
         self._driver.unmanage(volume)
+
+    def test_retype(self):
+        volume = fake_volume.fake_volume_obj(self.context)
+        retype, update = self._driver.retype(None, volume, None, None, None)
+        self.assertTrue(retype)
+        self.assertIsNone(update)
index 4ca21b0885a41eea6f3584ad1d0a3f9051b9841f..0997668303ff6410be51eb1f79d757c8e4123a79 100644 (file)
@@ -704,6 +704,14 @@ class TintriDriver(driver.ManageableVD,
         raise exception.ManageExistingInvalidReference(
             existing_ref=vol_ref, reason=_('Volume not found.'))
 
+    def retype(self, context, volume, new_type, diff, host):
+        """Retype from one volume type to another.
+
+        At this point Tintri VMstore does not differentiate between
+        volume types on the same array. This is a no-op for us.
+        """
+        return True, None
+
 
 class TClient(object):
     """REST client for Tintri storage."""