]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Adds extend volume to Dell EqualLogic Driver
authorJacob M. Jacob <jacob_jacob@dell.com>
Thu, 14 Nov 2013 00:02:37 +0000 (18:02 -0600)
committerJacob M. Jacob <jacob_jacob@dell.com>
Thu, 14 Nov 2013 01:28:16 +0000 (19:28 -0600)
Adds extend_volume support to the Dell EqualLogic Driver

Change-Id: I416c73248f1813a805dcca4d70ad6cbc91d78f7d
Implements: blueprint eql-extend-vol-support

cinder/tests/test_eqlx.py
cinder/volume/drivers/eqlx.py

index f85b89a950d6deed4312b5a575fcb2bc8ff9f3d2..433989374c2d2145841004ad7c09969fb13e0153 100644 (file)
@@ -168,6 +168,16 @@ class DellEQLSanISCSIDriverTestCase(test.TestCase):
         self.mox.ReplayAll()
         self.driver.delete_snapshot(snapshot)
 
+    def test_extend_volume(self):
+        new_size = '200'
+        self.driver._eql_execute = self.mox.\
+            CreateMock(self.driver._eql_execute)
+        volume = {'name': self.volume_name, 'size': 100}
+        self.driver._eql_execute('volume', 'select', volume['name'],
+                                 'size', "%sG" % new_size)
+        self.mox.ReplayAll()
+        self.driver.extend_volume(volume, new_size)
+
     def test_initialize_connection(self):
         self.driver._eql_execute = self.mox.\
             CreateMock(self.driver._eql_execute)
index 74d952c5baf7dd03684f894469b444fd10a42e80..92cdef642f340ff9f547764c2f7135458ebfcfb2 100644 (file)
@@ -449,5 +449,18 @@ class DellEQLSanISCSIDriver(SanISCSIDriver):
         """
         pass
 
+    def extend_volume(self, volume, new_size):
+        """Extend the size of the volume"""
+        try:
+            self._eql_execute('volume', 'select', volume['name'],
+                              'size', "%sG" % new_size)
+        except Exception:
+            with excutils.save_and_reraise_exception():
+                LOG.error(_('Failed to extend_volume %(name)s from '
+                            '%(current_size)sGB to %(new_size)sGB'),
+                          {'name': volume['name'],
+                           'current_size': volume['size'],
+                           'new_size': new_size})
+
     def local_path(self, volume):
         raise NotImplementedError()