From 0e429c71f34c5a7603854171c6843a67c61b9127 Mon Sep 17 00:00:00 2001 From: Adelina Tuvenie Date: Thu, 4 Sep 2014 16:00:19 +0300 Subject: [PATCH] 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 --- cinder/tests/windows/test_windows.py | 2 +- cinder/volume/drivers/windows/windows.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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) -- 2.45.2