]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Eseries warn if multipath is not set for img xfer
authorTom Barron <tbarron@netapp.com>
Tue, 23 Sep 2014 22:05:40 +0000 (18:05 -0400)
committerTom Barron <tpb@dyncloud.net>
Wed, 8 Oct 2014 19:41:40 +0000 (15:41 -0400)
Warn at driver startup if the configuration option
"use_multipath_for_image_xfer" has not been set to "True".  Eseries filers
require appropriate multipath/DMMP configuration on the host running the
cinder volume process for image transfers to work reliably.

Change-Id: Ib79a23a5a9527b254f155a9f4ea022d4387a4a13
Closes-Bug: #1376349

cinder/volume/drivers/netapp/eseries/iscsi.py

index bfb08d79ff37edca9c4b48d688773d9bff1c3493..6b339c01891067dc81603ce1688a36b4f0738144 100644 (file)
@@ -66,6 +66,8 @@ class Driver(driver.ISCSIDriver):
         self.configuration.append_config_values(netapp_connection_opts)
         self.configuration.append_config_values(netapp_transport_opts)
         self.configuration.append_config_values(netapp_eseries_opts)
+        self._backend_name = self.configuration.safe_get("volume_backend_name")\
+            or "NetApp_ESeries"
         self._objects = {'disk_pool_refs': [], 'pools': [],
                          'volumes': {'label_ref': {}, 'ref_vol': {}},
                          'snapshots': {'label_ref': {}, 'ref_snap': {}}}
@@ -89,6 +91,13 @@ class Driver(driver.ISCSIDriver):
             if not getattr(self.configuration, flag, None):
                 msg = _('%s is not set.') % flag
                 raise exception.InvalidInput(reason=msg)
+        if not self.configuration.use_multipath_for_image_xfer:
+            msg = _('Production use of "%(backend)s" backend requires the '
+                    'Cinder controller to have multipathing properly set up '
+                    'and the configuration option "%(mpflag)s" to be set to '
+                    '"True".') % {'backend': self._backend_name,
+                                  'mpflag': 'use_multipath_for_image_xfer'}
+            LOG.warning(msg)
 
     def check_for_setup_error(self):
         self._check_storage_system()
@@ -684,9 +693,7 @@ class Driver(driver.ISCSIDriver):
         """Update volume statistics."""
         LOG.debug("Updating volume stats.")
         data = dict()
-        netapp_backend = "NetApp_ESeries"
-        backend_name = self.configuration.safe_get("volume_backend_name")
-        data["volume_backend_name"] = (backend_name or netapp_backend)
+        data["volume_backend_name"] = self._backend_name
         data["vendor_name"] = "NetApp"
         data["driver_version"] = self.VERSION
         data["storage_protocol"] = "iSCSI"