From: Jacob M. Jacob Date: Thu, 14 Nov 2013 00:02:37 +0000 (-0600) Subject: Adds extend volume to Dell EqualLogic Driver X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=f7ca79ae1d02bc9babf8611164d3709374f66eec;p=openstack-build%2Fcinder-build.git Adds extend volume to Dell EqualLogic Driver Adds extend_volume support to the Dell EqualLogic Driver Change-Id: I416c73248f1813a805dcca4d70ad6cbc91d78f7d Implements: blueprint eql-extend-vol-support --- diff --git a/cinder/tests/test_eqlx.py b/cinder/tests/test_eqlx.py index f85b89a95..433989374 100644 --- a/cinder/tests/test_eqlx.py +++ b/cinder/tests/test_eqlx.py @@ -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) diff --git a/cinder/volume/drivers/eqlx.py b/cinder/volume/drivers/eqlx.py index 74d952c5b..92cdef642 100644 --- a/cinder/volume/drivers/eqlx.py +++ b/cinder/volume/drivers/eqlx.py @@ -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()