]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fixes Cinder fails to upload volume to vhd image
authorAdelina Tuvenie <atuvenie@cloudbasesolutions.com>
Thu, 4 Sep 2014 13:00:19 +0000 (16:00 +0300)
committerAdelina Tuvenie <atuvenie@cloudbasesolutions.com>
Thu, 4 Sep 2014 13:11:10 +0000 (16:11 +0300)
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
cinder/volume/drivers/windows/windows.py

index d2de5d60481d93ad9f1e314c6acd3a50a78a6fba..055f4e80ce516474fe1eaf59b9ffc4211e7b4949 100644 (file)
@@ -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)
index 72044c062f96bd32526ddf38d56304d442513c20..571a7414bd1f9cd380a662f2e862f47a541edc56 100644 (file)
@@ -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)