Merge "EMC ScaleIO - fix bug in extend volume"
This commit is contained in:
commit
0f5e61bf6e
@ -29,7 +29,7 @@ class TestExtendVolume(scaleio.TestScaleIODriver):
|
|||||||
The 7 size should be either rounded up to 8 or raise an exception
|
The 7 size should be either rounded up to 8 or raise an exception
|
||||||
based on the round_volume_capacity config setting.
|
based on the round_volume_capacity config setting.
|
||||||
"""
|
"""
|
||||||
NEW_SIZE = 8
|
NEW_SIZE = 16
|
||||||
BAD_SIZE = 7
|
BAD_SIZE = 7
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
@ -557,10 +557,10 @@ class ScaleIODriver(driver.VolumeDriver):
|
|||||||
|
|
||||||
# Round up the volume size so that it is a granularity of 8 GBs
|
# Round up the volume size so that it is a granularity of 8 GBs
|
||||||
# because ScaleIO only supports volumes with a granularity of 8 GBs.
|
# because ScaleIO only supports volumes with a granularity of 8 GBs.
|
||||||
if new_size % 8 == 0:
|
volume_new_size = self._round_to_8_gran(new_size)
|
||||||
volume_new_size = new_size
|
volume_real_old_size = self._round_to_8_gran(volume.size)
|
||||||
else:
|
if volume_real_old_size == volume_new_size:
|
||||||
volume_new_size = new_size + 8 - (new_size % 8)
|
return
|
||||||
|
|
||||||
round_volume_capacity = self.configuration.sio_round_volume_capacity
|
round_volume_capacity = self.configuration.sio_round_volume_capacity
|
||||||
if (not round_volume_capacity and not new_size % 8 == 0):
|
if (not round_volume_capacity and not new_size % 8 == 0):
|
||||||
@ -586,6 +586,11 @@ class ScaleIODriver(driver.VolumeDriver):
|
|||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.VolumeBackendAPIException(data=msg)
|
raise exception.VolumeBackendAPIException(data=msg)
|
||||||
|
|
||||||
|
def _round_to_8_gran(self, size):
|
||||||
|
if size % 8 == 0:
|
||||||
|
return size
|
||||||
|
return size + 8 - (size % 8)
|
||||||
|
|
||||||
def create_cloned_volume(self, volume, src_vref):
|
def create_cloned_volume(self, volume, src_vref):
|
||||||
"""Creates a cloned volume."""
|
"""Creates a cloned volume."""
|
||||||
volume_id = src_vref['provider_id']
|
volume_id = src_vref['provider_id']
|
||||||
|
Loading…
Reference in New Issue
Block a user