def test_get_vc_version(self): session = mock.Mock() expected_version = '6.0.1' session.vim.service_content.about.version = expected_version version = vim_util.get_vc_version(session) self.assertEqual(expected_version, version) expected_version = '5.5' session.vim.service_content.about.version = expected_version version = vim_util.get_vc_version(session) self.assertEqual(expected_version, version)
def _update_pbm_location(self): if CONF.vmware.pbm_wsdl_location: pbm_wsdl_loc = CONF.vmware.pbm_wsdl_location else: version = vim_util.get_vc_version(self._session) pbm_wsdl_loc = pbm.get_pbm_wsdl_location(version) self._session.pbm_wsdl_loc_set(pbm_wsdl_loc)
def _check_ovs_supported_version(session): # The port type 'ovs' is only support by the VC version 5.5 onwards min_version = versionutils.convert_version_to_int( constants.MIN_VC_OVS_VERSION) vc_version = versionutils.convert_version_to_int( vim_util.get_vc_version(session)) if vc_version < min_version: LOG.warning('VMware vCenter version less than %(version)s ' 'does not support the \'ovs\' port type.', {'version': constants.MIN_VC_OVS_VERSION})
def _check_min_version(self): min_version = utils.convert_version_to_int(constants.MIN_VC_VERSION) vc_version = vim_util.get_vc_version(self._session) LOG.info(_LI("VMware vCenter version: %s"), vc_version) if min_version > utils.convert_version_to_int(vc_version): # TODO(garyk): enforce this from M LOG.warning(_LW('Running Nova with a VMware vCenter version less ' 'than %(version)s is deprecated. The required ' 'minimum version of vCenter will be raised to ' '%(version)s in the 13.0.0 release.'), {'version': constants.MIN_VC_VERSION})
def _check_min_version(self): min_version = v_utils.convert_version_to_int(constants.MIN_VC_VERSION) next_min_ver = v_utils.convert_version_to_int( constants.NEXT_MIN_VC_VERSION) vc_version = vim_util.get_vc_version(self._session) LOG.info("VMware vCenter version: %s", vc_version) if v_utils.convert_version_to_int(vc_version) < min_version: raise exception.NovaException( _('Detected vCenter version %(version)s. Nova requires VMware ' 'vCenter version %(min_version)s or greater.') % { 'version': vc_version, 'min_version': constants.MIN_VC_VERSION}) elif v_utils.convert_version_to_int(vc_version) < next_min_ver: LOG.warning('Running Nova with a VMware vCenter version less ' 'than %(version)s is deprecated. The required ' 'minimum version of vCenter will be raised to ' '%(version)s in the 16.0.0 release.', {'version': constants.NEXT_MIN_VC_VERSION})