]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Add lun number (0) to model_update in HpSanDriver
authorJohn Griffith <john.griffith@solidfire.com>
Thu, 20 Sep 2012 23:27:13 +0000 (17:27 -0600)
committerJohn Griffith <john.griffith@solidfire.com>
Fri, 21 Sep 2012 03:23:02 +0000 (21:23 -0600)
The HpSanDriver was not setting the lun number in model_update
and as a result default value of 1 was being used.  Trouble is the
Lun number used by LeftHand is 0, so the connect info would be
wrong and fail when trying to attach the volume.

Fixes bug #1053717

Change-Id: If82a66c6a78ab03da09223a7b79abe559a6f702f
(cherry picked from commit f55198570fd59b7a2a4ddd2f5e77b3d03d0a3d64)

cinder/tests/test_HpSanISCSIDriver.py
cinder/volume/san.py

index 151f0a21af52b0e1e7279350e52dc2df76838cfe..e2b802ffe6a443f0bdbb1a026230ee9abcbb1eb9 100644 (file)
@@ -175,7 +175,7 @@ class HpSanISCSITestCase(test.TestCase):
     def test_create_volume(self):
         volume = {'name': self.volume_name, 'size': 1}
         model_update = self.driver.create_volume(volume)
-        expected_iqn = "iqn.2003-10.com.lefthandnetworks:group01:25366:fakev"
+        expected_iqn = "iqn.2003-10.com.lefthandnetworks:group01:25366:fakev 0"
         expected_location = "10.0.1.6:3260,1 %s" % expected_iqn
         self.assertEqual(model_update['provider_location'], expected_location)
 
index fe98d50cac5d89f1c53eb3340003bb633e447422..7c06d859fbcd03f98d0c1eff3d628250a2e8c928 100644 (file)
@@ -581,9 +581,12 @@ class HpSanISCSIDriver(SanISCSIDriver):
         iscsi_portal = cluster_vip + ":3260," + cluster_interface
 
         model_update = {}
-        model_update['provider_location'] = ("%s %s" %
+
+        # NOTE(jdg): LH volumes always at lun 0 ?
+        model_update['provider_location'] = ("%s %s %s" %
                                              (iscsi_portal,
-                                              iscsi_iqn))
+                                              iscsi_iqn,
+                                              0))
 
         return model_update