From: Adelina Tuvenie Date: Thu, 4 Sep 2014 13:00:19 +0000 (+0300) Subject: Fixes Cinder fails to upload volume to vhd image X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=0e429c71f34c5a7603854171c6843a67c61b9127;p=openstack-build%2Fcinder-build.git Fixes Cinder fails to upload volume to vhd image The method copy_volume_to_image from windows.py specifies the wrong volume format, namely 'vpc'. In this case, the upload_volume method from image_utils will attempt to convert the volume to vhd which will result in an error from qemu as it does not recognize the format. This patch fixes this issue by using 'vhd' as a format when uploading volumes Change-Id: Ifa675316e19f9a795e103fd56fcdf4e3ed00aab7 Closes-Bug: #1365487 --- diff --git a/cinder/tests/windows/test_windows.py b/cinder/tests/windows/test_windows.py index d2de5d604..055f4e80c 100644 --- a/cinder/tests/windows/test_windows.py +++ b/cinder/tests/windows/test_windows.py @@ -326,7 +326,7 @@ class TestWindowsDriver(test.TestCase): vhdutils.VHDUtils.convert_vhd(temp_vhd_path, upload_image, constants.VHD_TYPE_DYNAMIC) - image_utils.upload_volume(None, None, image_meta, upload_image, 'vpc') + image_utils.upload_volume(None, None, image_meta, upload_image, 'vhd') fileutils.delete_if_exists(temp_vhd_path) fileutils.delete_if_exists(upload_image) diff --git a/cinder/volume/drivers/windows/windows.py b/cinder/volume/drivers/windows/windows.py index 72044c062..571a7414b 100644 --- a/cinder/volume/drivers/windows/windows.py +++ b/cinder/volume/drivers/windows/windows.py @@ -201,7 +201,7 @@ class WindowsDriver(driver.ISCSIDriver): constants.VHD_TYPE_DYNAMIC) image_utils.upload_volume(context, image_service, image_meta, - upload_image, 'vpc') + upload_image, 'vhd') finally: fileutils.delete_if_exists(temp_vhd_path) fileutils.delete_if_exists(upload_image)