diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-04-25 16:56:23 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-04-25 16:56:23 +0000 |
| commit | f8dfde8e83be795fe04c4cc9687ad0cf460abb23 (patch) | |
| tree | f657ece454538b530f1af74476dc729c298b9985 /nova/virt | |
| parent | 923bcb72eac497d454f7ed6f22372557a9c83c71 (diff) | |
| parent | 5643bd5d9bf17335e109d4b2d93e161f4d12c6f9 (diff) | |
Merge "Fix powervm driver resize instance error"
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/powervm/operator.py | 24 |
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']) |
