EMC ScaleIO driver does not honor create from snapshot volume size
create_volume_from_snapshot can specify a volume size larger than the orginal snapshot. Current code does not appear to handle this size difference. This patch addresses the issue. Change-Id: Ifa247ef0eec00c23afe6f875107a06f756bc180e Closes-Bug: #1560649
This commit is contained in:
parent
1579981969
commit
e0b7c11535
@ -98,3 +98,8 @@ class TestCreateVolumeFromSnapShot(scaleio.TestScaleIODriver):
|
||||
def test_create_volume_from_snapshot(self):
|
||||
self.set_https_response_mode(self.RESPONSE_MODE.Valid)
|
||||
self.driver.create_volume_from_snapshot(self.volume, self.snapshot)
|
||||
|
||||
def test_create_volume_from_snapshot_larger(self):
|
||||
self.set_https_response_mode(self.RESPONSE_MODE.Valid)
|
||||
self.volume.size = 2
|
||||
self.driver.create_volume_from_snapshot(self.volume, self.snapshot)
|
||||
|
@ -788,7 +788,15 @@ class ScaleIODriver(driver.VolumeDriver):
|
||||
{'volname': volume_id,
|
||||
'snapname': snapname})
|
||||
|
||||
return self._snapshot_volume(volume_id, snapname)
|
||||
ret = self._snapshot_volume(volume_id, snapname)
|
||||
if volume.size > snapshot.volume_size:
|
||||
LOG.info("Extending volume %(vol)s to size %(size)s",
|
||||
{'vol': ret['provider_id'],
|
||||
'size': volume.size})
|
||||
self._extend_volume(ret['provider_id'],
|
||||
snapshot.volume_size, volume.size)
|
||||
|
||||
return ret
|
||||
|
||||
@staticmethod
|
||||
def _get_headers():
|
||||
|
7
releasenotes/notes/bug-1560649-d4f3ff71fe4ddb89.yaml
Normal file
7
releasenotes/notes/bug-1560649-d4f3ff71fe4ddb89.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Dell EMC Scale IO Driver: Fixes `bug 1560649
|
||||
<https://bugs.launchpad.net/cinder/+bug/1560649>`
|
||||
for creating volumes with sizes greater than that of the
|
||||
original snapshot.
|
Loading…
Reference in New Issue
Block a user