From 2e51da875aceeb21d5bde9ab844c3882178ccd99 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Wed, 3 Jan 2018 08:08:29 -0800 Subject: [PATCH] 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. Change-Id: I223dabbc012092c4e89d6f6e655f989c54065996 --- nova/tests/unit/virt/hyperv/test_driver.py | 9 ++++++++- nova/virt/hyperv/driver.py | 9 ++++++++- ...-server-2012-support-deprecated-02a956e3926351d6.yaml | 6 ++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/hyper-v-server-2012-support-deprecated-02a956e3926351d6.yaml diff --git a/nova/tests/unit/virt/hyperv/test_driver.py b/nova/tests/unit/virt/hyperv/test_driver.py index 24bcd3b3b76c..48cfed5a8654 100644 --- a/nova/tests/unit/virt/hyperv/test_driver.py +++ b/nova/tests/unit/virt/hyperv/test_driver.py @@ -51,14 +51,21 @@ class HyperVDriverTestCase(test_base.HyperVBaseTestCase): self.driver._serialconsoleops = mock.MagicMock() self.driver._imagecache = 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 diff --git a/nova/virt/hyperv/driver.py b/nova/virt/hyperv/driver.py index e4045943ada2..a36aee1b2b8b 100644 --- a/nova/virt/hyperv/driver.py +++ b/nova/virt/hyperv/driver.py @@ -118,7 +118,8 @@ class HyperVDriver(driver.ComputeDriver): self._imagecache = imagecache.ImageCache() 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. @@ -127,6 +128,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): diff --git a/releasenotes/notes/hyper-v-server-2012-support-deprecated-02a956e3926351d6.yaml b/releasenotes/notes/hyper-v-server-2012-support-deprecated-02a956e3926351d6.yaml new file mode 100644 index 000000000000..0b6395bf96e4 --- /dev/null +++ b/releasenotes/notes/hyper-v-server-2012-support-deprecated-02a956e3926351d6.yaml @@ -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.