[Trivial] Hyper-V: accept Glance vhdx images

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 f022d431e1)
This commit is contained in:
Lucian Petrut 2017-05-23 22:45:20 +03:00 committed by Lee Yarwood
parent 47774935ac
commit 94a3ea56fa
2 changed files with 4 additions and 0 deletions

View 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')

View 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'