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
This commit is contained in:
parent
9090f99986
commit
e088c73b18
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue