summaryrefslogtreecommitdiffstats
path: root/nova/virt
diff options
context:
space:
mode:
authorguohliu <guohliu@cn.ibm.com>2013-04-17 18:22:57 +0800
committerguohliu <guohliu@cn.ibm.com>2013-04-24 16:03:02 +0800
commit5643bd5d9bf17335e109d4b2d93e161f4d12c6f9 (patch)
tree69b814182f4d5352eaa15f5e489192b029a918d3 /nova/virt
parent5a604b5924dae368da4b6561550bb430e3239ca3 (diff)
Fix powervm driver resize instance error
During a resize operation in powervm, the logical volume of the instance will be copied and compressed to a file. Current logic decompresses it twice before copying this file to a new volume which will cause the new instance to not boot properly. Fixes bug #1169848 Change-Id: I91f536919511aafbf7dbe14abbee48dbceb189b2
Diffstat (limited to 'nova/virt')
-rw-r--r--nova/virt/powervm/operator.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/nova/virt/powervm/operator.py b/nova/virt/powervm/operator.py
index 0656f3972..518341910 100644
--- a/nova/virt/powervm/operator.py
+++ b/nova/virt/powervm/operator.py
@@ -415,23 +415,24 @@ class PowerVMOperator(object):
return disk_info
def deploy_from_migrated_file(self, lpar, file_path, size):
- # decompress file
- gzip_ending = '.gz'
- if file_path.endswith(gzip_ending):
- raw_file_path = file_path[:-len(gzip_ending)]
- else:
- raw_file_path = file_path
+ """Deploy the logical volume and attach to new lpar.
- self._operator._decompress_image_file(file_path, raw_file_path)
+ :param lpar: lar instance
+ :param file_path: logical volume path
+ :param size: new size of the logical volume
+ """
+ need_decompress = file_path.endswith('.gz')
try:
# deploy lpar from file
- self._deploy_from_vios_file(lpar, raw_file_path, size)
+ self._deploy_from_vios_file(lpar, file_path, size,
+ decompress=need_decompress)
finally:
# cleanup migrated file
- self._operator._remove_file(raw_file_path)
+ self._operator._remove_file(file_path)
- def _deploy_from_vios_file(self, lpar, file_path, size):
+ def _deploy_from_vios_file(self, lpar, file_path, size,
+ decompress=True):
self._operator.create_lpar(lpar)
lpar = self._operator.get_lpar(lpar['name'])
instance_id = lpar['lpar_id']
@@ -443,7 +444,8 @@ class PowerVMOperator(object):
self._operator.attach_disk_to_vhost(diskName, vhost)
# Copy file to device
- self._disk_adapter._copy_file_to_device(file_path, diskName)
+ self._disk_adapter._copy_file_to_device(file_path, diskName,
+ decompress)
self._operator.start_lpar(lpar['name'])