]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Allow upgrade from Grizzly with ThinLVMVolumeDriver
authorEric Harney <eharney@redhat.com>
Wed, 25 Sep 2013 19:43:32 +0000 (15:43 -0400)
committerEric Harney <eharney@redhat.com>
Wed, 25 Sep 2013 19:55:58 +0000 (15:55 -0400)
In Grizzly, LVM thin provisioning was used by setting
volume_driver=...ThinLVMVolumeDriver.  In Havana this
functionality has moved under the standard LVM driver
with the option "lvm_type=thin" used to enable it.

We should account for the old volume_driver class path
so that the volume service behaves as expected for users
upgrading from Grizzly ThinLVM configurations.

Closes-Bug: #1231116
Change-Id: Ic29f0e5c1036232078af5c6d83c61c75a35cccd4

cinder/volume/manager.py

index 34b4357ab999af27ee60691f191185117312c8d7..2cbee59287af041fa8f64fe560405f8e8fcae757 100644 (file)
@@ -152,6 +152,14 @@ class VolumeManager(manager.SchedulerDependentManager):
             LOG.warn(_("Driver path %s is deprecated, update your "
                        "configuration to the new path."), volume_driver)
             volume_driver = MAPPING[volume_driver]
+        if volume_driver == 'cinder.volume.drivers.lvm.ThinLVMVolumeDriver':
+            # Deprecated in Havana
+            # Not handled in MAPPING because it requires setting a conf option
+            LOG.warn(_("ThinLVMVolumeDriver is deprecated, please configure "
+                       "LVMISCSIDriver and lvm_type=thin.  Continuing with "
+                       "those settings."))
+            volume_driver = 'cinder.volume.drivers.lvm.LVMISCSIDriver'
+            self.configuration.lvm_type = 'thin'
         self.driver = importutils.import_object(
             volume_driver,
             configuration=self.configuration,