backup/restore: do not shrink volumes on restore
This operation is blocked in current storage pool implementations.
This commit is contained in:
parent
7211c7daff
commit
2861d46dfa
@ -476,7 +476,7 @@ class ExtractWorker3(Process):
|
|||||||
else:
|
else:
|
||||||
match = _tar_file_size_re.match(line)
|
match = _tar_file_size_re.match(line)
|
||||||
if match:
|
if match:
|
||||||
file_size = match.groups()[0]
|
file_size = int(match.groups()[0])
|
||||||
size_func(file_size)
|
size_func(file_size)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
@ -1708,10 +1708,11 @@ class BackupRestore(object):
|
|||||||
def _handle_volume_size(self, vm, volume, size):
|
def _handle_volume_size(self, vm, volume, size):
|
||||||
'''Wrap volume resize with logging'''
|
'''Wrap volume resize with logging'''
|
||||||
try:
|
try:
|
||||||
volume.resize(size)
|
if volume.size < size:
|
||||||
|
volume.resize(size)
|
||||||
except Exception as err: # pylint: disable=broad-except
|
except Exception as err: # pylint: disable=broad-except
|
||||||
self.log.error('Failed to resize volume %s of VM %s: %s',
|
self.log.error('Failed to resize volume %s of VM %s to %d: %s',
|
||||||
volume.name, vm.name, err)
|
volume.name, vm.name, size, err)
|
||||||
|
|
||||||
def restore_do(self, restore_info):
|
def restore_do(self, restore_info):
|
||||||
'''
|
'''
|
||||||
|
Loading…
Reference in New Issue
Block a user