From 549092a5483d1e6e5693b3cec79d3dca20905717 Mon Sep 17 00:00:00 2001 From: Vipin Balachandran Date: Thu, 2 Mar 2017 22:08:27 +0530 Subject: [PATCH] VMware: Enforce min vCenter server version 5.5 Support for vCenter server 5.1 was deprecated in the Ocata release. Changing the minimum supported vCenter server version to 5.5. Also updating the version to reflect this change. DocImpact Change-Id: Ia33eccc088b76ca66be4d60ec32caa8f84076d2d --- .../unit/volume/drivers/vmware/test_vmware_vmdk.py | 14 +++++++++----- cinder/volume/drivers/vmware/vmdk.py | 8 ++++---- ...vmware_vmdk_enforce_vc_55-7e1b3ede9bf2129b.yaml | 3 +++ 3 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 releasenotes/notes/vmware_vmdk_enforce_vc_55-7e1b3ede9bf2129b.yaml diff --git a/cinder/tests/unit/volume/drivers/vmware/test_vmware_vmdk.py b/cinder/tests/unit/volume/drivers/vmware/test_vmware_vmdk.py index c07720ff5fe..ebc239d6bc1 100644 --- a/cinder/tests/unit/volume/drivers/vmware/test_vmware_vmdk.py +++ b/cinder/tests/unit/volume/drivers/vmware/test_vmware_vmdk.py @@ -20,6 +20,7 @@ Test suite for VMware vCenter VMDK driver. import ddt import mock from oslo_utils import units +from oslo_utils import versionutils from oslo_vmware import api from oslo_vmware import exceptions from oslo_vmware import image_transfer @@ -1592,12 +1593,15 @@ class VMwareVcVmdkDriverTestCase(test.TestCase): get_vc_version.assert_not_called() @mock.patch('cinder.volume.drivers.vmware.vmdk.LOG') - @ddt.data('5.1', '5.5') + @ddt.data('5.5', '6.0') def test_validate_vcenter_version(self, version, log): - # vCenter versions 5.1 and above should pass validation. + # vCenter versions 5.5 and above should pass validation. self._driver._validate_vcenter_version(version) - # Deprecation warning should be logged for vCenter version 5.1. - if version == '5.1': + # Deprecation warning should be logged for vCenter versions which are + # incompatible with next minimum supported version. + if not versionutils.is_compatible( + self._driver.NEXT_MIN_SUPPORTED_VC_VERSION, version, + same_major=False): log.warning.assert_called_once() else: log.warning.assert_not_called() @@ -1607,7 +1611,7 @@ class VMwareVcVmdkDriverTestCase(test.TestCase): # Validation should fail for vCenter version less than 5.1. self.assertRaises(exceptions.VMwareDriverException, self._driver._validate_vcenter_version, - '5.0') + '5.1') @mock.patch.object(VMDK_DRIVER, '_validate_params') @mock.patch.object(VMDK_DRIVER, '_get_vc_version') diff --git a/cinder/volume/drivers/vmware/vmdk.py b/cinder/volume/drivers/vmware/vmdk.py index b1ef9cab92b..2e4f0a1abe2 100644 --- a/cinder/volume/drivers/vmware/vmdk.py +++ b/cinder/volume/drivers/vmware/vmdk.py @@ -223,13 +223,14 @@ class VMwareVcVmdkDriver(driver.VolumeDriver): # 1.5.0 - restrict volume placement to specific vCenter clusters # 1.6.0 - support for manage existing # 1.7.0 - new config option 'vmware_connection_pool_size' - VERSION = '1.7.0' + # 1.7.1 - enforce vCenter server version 5.5 + VERSION = '1.7.1' # ThirdPartySystems wiki page CI_WIKI_NAME = "VMware_CI" # Minimum supported vCenter version. - MIN_SUPPORTED_VC_VERSION = '5.1' + MIN_SUPPORTED_VC_VERSION = '5.5' NEXT_MIN_SUPPORTED_VC_VERSION = '5.5' # PBM is enabled only for vCenter versions 5.5 and above @@ -1866,11 +1867,10 @@ class VMwareVcVmdkDriver(driver.VolumeDriver): elif not versionutils.is_compatible(self.NEXT_MIN_SUPPORTED_VC_VERSION, vc_version, same_major=False): - # TODO(vbala): enforce vCenter version 5.5 in Pike release. LOG.warning('Running Cinder with a VMware vCenter version ' 'less than %(ver)s is deprecated. The minimum ' 'required version of vCenter server will be raised' - ' to %(ver)s in the 11.0.0 release.', + ' to %(ver)s in a future release.', {'ver': self.NEXT_MIN_SUPPORTED_VC_VERSION}) def do_setup(self, context): diff --git a/releasenotes/notes/vmware_vmdk_enforce_vc_55-7e1b3ede9bf2129b.yaml b/releasenotes/notes/vmware_vmdk_enforce_vc_55-7e1b3ede9bf2129b.yaml new file mode 100644 index 00000000000..38bdcb47e1e --- /dev/null +++ b/releasenotes/notes/vmware_vmdk_enforce_vc_55-7e1b3ede9bf2129b.yaml @@ -0,0 +1,3 @@ +--- +upgrade: + - The VMware VMDK driver now enforces minimum vCenter version of 5.5.