From: Kurt Martin Date: Tue, 25 Feb 2014 16:30:01 +0000 (-0800) Subject: 3PAR: Fix extend volume GiB to MiB X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=e088c73b185073943d9b18b7ede0375c096ee8b3;p=openstack-build%2Fcinder-build.git 3PAR: Fix extend volume GiB to MiB Extend volume was sending GiB instead of MiB to the 3PAR array. This patch is now sending the growth size in MiBs instead of GiBs. Change-Id: Ib4903315a32e090e760883cc80c50f3698fe015f Closes-Bug: #1284368 --- diff --git a/cinder/tests/test_hp3par.py b/cinder/tests/test_hp3par.py index 820a880ae..f015b7354 100644 --- a/cinder/tests/test_hp3par.py +++ b/cinder/tests/test_hp3par.py @@ -24,6 +24,7 @@ from cinder import context from cinder import exception from cinder.openstack.common import log as logging from cinder import test +from cinder import units from cinder.volume.drivers.san.hp import hp_3par_fc as hpfcdriver from cinder.volume.drivers.san.hp import hp_3par_iscsi as hpdriver from cinder.volume import qos_specs @@ -773,9 +774,10 @@ class HP3PARBaseDriver(object): old_size = self.volume['size'] new_size = old_size + grow_size self.driver.extend_volume(self.volume, str(new_size)) + growth_size_mib = grow_size * units.KiB expected = [ - mock.call.growVolume(self.VOLUME_3PAR_NAME, grow_size)] + mock.call.growVolume(self.VOLUME_3PAR_NAME, growth_size_mib)] mock_client.assert_has_calls(expected) diff --git a/cinder/volume/drivers/san/hp/hp_3par_common.py b/cinder/volume/drivers/san/hp/hp_3par_common.py index 8bb6b434f..f3fb0bde8 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_common.py +++ b/cinder/volume/drivers/san/hp/hp_3par_common.py @@ -118,10 +118,11 @@ class HP3PARCommon(object): 2.0.2 - Add back-end assisted volume migrate 2.0.3 - Allow deleting missing snapshots bug #1283233 2.0.4 - Allow volumes created from snapshots to be larger bug #1279478 + 2.0.5 - Fix extend volume units bug #1284368 """ - VERSION = "2.0.4" + VERSION = "2.0.5" stats = {} @@ -248,8 +249,9 @@ class HP3PARCommon(object): growth_size = int(new_size) - old_size LOG.debug("Extending Volume %s from %s to %s, by %s GB." % (volume_name, old_size, new_size, growth_size)) + growth_size_mib = growth_size * units.KiB try: - self.client.growVolume(volume_name, growth_size) + self.client.growVolume(volume_name, growth_size_mib) except Exception: with excutils.save_and_reraise_exception(): LOG.error(_("Error extending volume %s") % volume)