From: apoorvad Date: Wed, 9 Dec 2015 17:42:21 +0000 (-0800) Subject: Retype functionality in Tintri driver X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=918d33eee9fdeedb143f316fd7df42c3ae23cab6;p=openstack-build%2Fcinder-build.git Retype functionality in Tintri driver 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 --- diff --git a/cinder/tests/unit/test_tintri.py b/cinder/tests/unit/test_tintri.py index e9781f53b..c4abe165d 100644 --- a/cinder/tests/unit/test_tintri.py +++ b/cinder/tests/unit/test_tintri.py @@ -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) diff --git a/cinder/volume/drivers/tintri.py b/cinder/volume/drivers/tintri.py index 4ca21b088..099766830 100644 --- a/cinder/volume/drivers/tintri.py +++ b/cinder/volume/drivers/tintri.py @@ -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."""