diff options
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']) |
