def _check_cinder(self): """Checks to see that the cinder API is available at a given minimum microversion. """ # Check to see if nova is even configured for Cinder yet (fresh install # or maybe not using Cinder at all). if CONF.cinder.auth_type is None: return upgradecheck.Result(upgradecheck.Code.SUCCESS) try: # TODO(mriedem): Eventually use get_ksa_adapter here when it # supports cinder. cinder.is_microversion_supported(nova_context.get_admin_context(), MIN_CINDER_MICROVERSION) except exception.CinderAPIVersionNotAvailable: return upgradecheck.Result( upgradecheck.Code.FAILURE, _('Cinder API %s or greater is required. Deploy at least ' 'Cinder 12.0.0 (Queens).') % MIN_CINDER_MICROVERSION) except Exception as ex: # Anything else trying to connect, like bad config, is out of our # hands so just return a warning. return upgradecheck.Result( upgradecheck.Code.WARNING, _('Unable to determine Cinder API version due to error: %s') % six.text_type(ex)) return upgradecheck.Result(upgradecheck.Code.SUCCESS)
def _check_cinder(self): """Checks to see that the cinder API is available at a given minimum microversion. """ # Check to see if nova is even configured for Cinder yet (fresh install # or maybe not using Cinder at all). if CONF.cinder.auth_type is None: return upgradecheck.Result(upgradecheck.Code.SUCCESS) try: # TODO(mriedem): Eventually use get_ksa_adapter here when it # supports cinder. cinder.is_microversion_supported( nova_context.get_admin_context(), MIN_CINDER_MICROVERSION) except exception.CinderAPIVersionNotAvailable: return upgradecheck.Result( upgradecheck.Code.FAILURE, _('Cinder API %s or greater is required. Deploy at least ' 'Cinder 12.0.0 (Queens).') % MIN_CINDER_MICROVERSION) except Exception as ex: # Anything else trying to connect, like bad config, is out of our # hands so just return a warning. return upgradecheck.Result( upgradecheck.Code.WARNING, _('Unable to determine Cinder API version due to error: %s') % six.text_type(ex)) return upgradecheck.Result(upgradecheck.Code.SUCCESS)
def _perform_external_api_checks(self): """Performs checks on external service APIs for support. * Checks that the neutron port binding-extended API is available * Checks that the 3.44 volume attachments API is available :raises: MigrationPreCheckError if any checks fail """ LOG.debug('Making sure cinder and neutron are new enough for ' 'cross-cell resize.') # Check that the port binding-extended API extension is available in # neutron because if it's not we can just fail fast. if not self.network_api.supports_port_binding_extension(self.context): raise exception.MigrationPreCheckError( reason=_("Required networking service API extension '%s' " "not found.") % neutron_constants.PORT_BINDING_EXTENDED) # Check that Cinder API 3.44 is available otherwise we can't use the # volume attachments API. try: cinder.is_microversion_supported(self.context, '3.44') except exception.CinderAPIVersionNotAvailable as ex: raise exception.MigrationPreCheckError(reason=ex.format_message())