]> xenbits.xensource.com Git - osstest/openstack-nova.git/commitdiff
[Trivial] Hyper-V: accept Glance vhdx images
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Tue, 23 May 2017 19:45:20 +0000 (22:45 +0300)
committerLee Yarwood <lyarwood@redhat.com>
Thu, 8 Jun 2017 14:30:53 +0000 (14:30 +0000)
Although the Hyper-V driver is used with VHDX images most of the
time, it rejects Glance images marked as VHDX.

Note that for legacy reasons, people usually just mark them as vhd
at he moment, which is misleading and unsafe.

This change ensures that such images are handled properly.

Closes-Bug: #1693470

Change-Id: I1441304bd5a83b04877c1662e6e9d463ba629ed0
(cherry picked from commit f022d431e1f844a8faa7ab55597c83179c13022c)

nova/tests/unit/virt/hyperv/test_block_device_manager.py
nova/virt/hyperv/block_device_manager.py

index 939666e87b7130ec6e081376691cd28bfcc96f0e..cfeb6698f4145b6cd2f672cd1a7b5db68503c9aa 100644 (file)
@@ -216,6 +216,9 @@ class BlockDeviceManagerTestCase(test_base.HyperVBaseTestCase):
     def test_check_and_update_root_device_gen1(self):
         self._test_check_and_update_root_device(disk_format='vhd')
 
+    def test_check_and_update_root_device_gen1_vhdx(self):
+        self._test_check_and_update_root_device(disk_format='vhdx')
+
     def test_check_and_update_root_device_gen1_iso(self):
         self._test_check_and_update_root_device(disk_format='iso')
 
index 3f2ff7d3fee83b107db291ea8deee87470701502..9323da09f547c40135a00468fe5ee984ea0a8a01 100644 (file)
@@ -41,6 +41,7 @@ class BlockDeviceInfoManager(object):
     _DEFAULT_BUS = constants.CTRL_TYPE_SCSI
 
     _TYPE_FOR_DISK_FORMAT = {'vhd': constants.DISK,
+                             'vhdx': constants.DISK,
                              'iso': constants.DVD}
 
     _DEFAULT_ROOT_DEVICE = '/dev/sda'