hyper-v: Deprecates support for Windows / Hyper-V Server 2012

Starting with Rocky, we will support only Windows / Hyper-V Server
2012 R2 or newer.

(cherry-picked from 2e51da875aceeb21d5bde9ab844c3882178ccd99)

Change-Id: I6844a0664860d09ecd259cea7715fe50814b5362
This commit is contained in:
Claudiu Belu 2018-01-28 05:31:07 -08:00
parent 269db011e8
commit c9629cf984
3 changed files with 22 additions and 2 deletions

View File

@ -127,7 +127,8 @@ class HyperVDriver(driver.ComputeDriver):
self._pathutils = pathutils.PathUtils()
def _check_minimum_windows_version(self):
if not utilsfactory.get_hostutils().check_min_windows_version(6, 2):
hostutils = utilsfactory.get_hostutils()
if not hostutils.check_min_windows_version(6, 2):
# the version is of Windows is older than Windows Server 2012 R2.
# Log an error, letting users know that this version is not
# supported any longer.
@ -136,6 +137,12 @@ class HyperVDriver(driver.ComputeDriver):
'Server 2012). The support for this version of '
'Windows has been removed in Mitaka.')
raise exception.HypervisorTooOld(version='6.2')
elif not hostutils.check_min_windows_version(6, 3):
# TODO(claudiub): replace the warning with an exception in Rocky.
LOG.warning('You are running nova-compute on Windows / Hyper-V '
'Server 2012. The support for this version of Windows '
'has been deprecated In Queens, and will be removed '
'in Rocky.')
@property
def need_legacy_block_device_info(self):

View File

@ -54,14 +54,21 @@ class HyperVDriverTestCase(test_base.HyperVBaseTestCase):
self.driver._image_api = mock.MagicMock()
self.driver._pathutils = mock.MagicMock()
@mock.patch.object(driver.LOG, 'warning')
@mock.patch.object(driver.utilsfactory, 'get_hostutils')
def test_check_minimum_windows_version(self, mock_get_hostutils):
def test_check_minimum_windows_version(self, mock_get_hostutils,
mock_warning):
mock_hostutils = mock_get_hostutils.return_value
mock_hostutils.check_min_windows_version.return_value = False
self.assertRaises(exception.HypervisorTooOld,
self.driver._check_minimum_windows_version)
mock_hostutils.check_min_windows_version.side_effect = [True, False]
self.driver._check_minimum_windows_version()
self.assertTrue(mock_warning.called)
def test_public_api_signatures(self):
# NOTE(claudiub): wrapped functions do not keep the same signature in
# Python 2.7, which causes this test to fail. Instead, we should

View File

@ -0,0 +1,6 @@
---
deprecations:
- |
Support for Windows / Hyper-V Server 2012 has been deprecated in Queens
in nova and will be removed in Rocky. The supported versions are Windows /
Hyper-V Server 2012 R2 or newer.