Alex Lourie has uploaded a new change for review. Change subject: packaging: setup: disable AIO on CPUs without VT ......................................................................
packaging: setup: disable AIO on CPUs without VT Change-Id: I6f5d1edf045fdfb878e6cf2d2cfa8a2e74b10db8 Bug-Url: https://bugzilla.redhat.com/1010691 Signed-off-by: Alex Lourie <[email protected]> (cherry picked from commit e9023e7f92fc33c331db30dd2ce13217fb6d14ba) --- M packaging/setup/ovirt_engine_setup/constants.py M packaging/setup/plugins/ovirt-engine-setup/all-in-one/core.py M packaging/setup/plugins/ovirt-engine-setup/all-in-one/cpu.py 3 files changed, 51 insertions(+), 13 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/85/20385/1 diff --git a/packaging/setup/ovirt_engine_setup/constants.py b/packaging/setup/ovirt_engine_setup/constants.py index 9a04d5f..c385672 100644 --- a/packaging/setup/ovirt_engine_setup/constants.py +++ b/packaging/setup/ovirt_engine_setup/constants.py @@ -1056,6 +1056,7 @@ @osetupattrsclass class AIOEnv(object): ENABLE = 'OVESETUP_AIO/enable' + CONTINUE_WITHOUT_AIO = 'OVESETUP_AIO/continueWithoutAIO' @osetupattrs( answerfile=True, @@ -1069,6 +1070,7 @@ LOCAL_CLUSTER = 'OVESETUP_AIO/localCluster' LOCAL_HOST = 'OVESETUP_AIO/localHost' VDSM_CPU = 'OVESETUP_AIO/vdsmCpu' + SUPPORTED = 'OVESETUP_AIO/supported' STORAGE_DOMAIN_SD_UUID = 'OVESETUP_AIO/storageDomainSdUuid' STORAGE_DOMAIN_DEFAULT_DIR = 'OVESETUP_AIO/storageDomainDefaultDir' diff --git a/packaging/setup/plugins/ovirt-engine-setup/all-in-one/core.py b/packaging/setup/plugins/ovirt-engine-setup/all-in-one/core.py index c527cbe..4efe38d 100644 --- a/packaging/setup/plugins/ovirt-engine-setup/all-in-one/core.py +++ b/packaging/setup/plugins/ovirt-engine-setup/all-in-one/core.py @@ -56,6 +56,10 @@ osetupcons.AIOEnv.CONFIGURE, None ) + self.environment.setdefault( + osetupcons.AIOEnv.CONTINUE_WITHOUT_AIO, + None + ) @plugin.event( stage=plugin.Stages.STAGE_SETUP, @@ -68,6 +72,48 @@ @plugin.event( stage=plugin.Stages.STAGE_CUSTOMIZATION, + condition=lambda self: ( + self._enabled and + self.environment[ + osetupcons.AIOEnv.SUPPORTED + ] is False + ), + name=osetupcons.Stages.AIO_CONFIG_NOT_AVAILABLE, + before=( + osetupcons.Stages.AIO_CONFIG_AVAILABLE, + ), + ) + def _continueSetupWithoutAIO(self): + if self.environment[ + osetupcons.AIOEnv.CONTINUE_WITHOUT_AIO + ] is None: + self.environment[ + osetupcons.AIOEnv.CONTINUE_WITHOUT_AIO + ] = dialog.queryBoolean( + dialog=self.dialog, + name='OVESETUP_CONTINUE_WITHOUT_AIO', + note=_( + 'Disabling all-in-one plugin because hardware ' + 'supporting virtualization could not be detected. ' + 'Do you want to continue setup without AIO plugin? ' + '(@VALUES@) [@DEFAULT@]: ' + ), + prompt=True, + default=False, + ) + + if self.environment[ + osetupcons.AIOEnv.CONTINUE_WITHOUT_AIO + ]: + self._enabled = False + self.environment[osetupcons.AIOEnv.CONFIGURE] = False + else: + raise RuntimeError( + _('Aborted by user.') + ) + + @plugin.event( + stage=plugin.Stages.STAGE_CUSTOMIZATION, condition=lambda self: self._enabled, name=osetupcons.Stages.AIO_CONFIG_AVAILABLE, before=( diff --git a/packaging/setup/plugins/ovirt-engine-setup/all-in-one/cpu.py b/packaging/setup/plugins/ovirt-engine-setup/all-in-one/cpu.py index 2f9481c..66daae1 100644 --- a/packaging/setup/plugins/ovirt-engine-setup/all-in-one/cpu.py +++ b/packaging/setup/plugins/ovirt-engine-setup/all-in-one/cpu.py @@ -94,6 +94,7 @@ ) def _init(self): self.environment[osetupcons.AIOEnv.VDSM_CPU] = None + self.environment[osetupcons.AIOEnv.SUPPORTED] = False @plugin.event( stage=plugin.Stages.STAGE_SETUP, @@ -106,20 +107,9 @@ from ovirt_host_deploy import hardware virtualization = hardware.Virtualization() result = virtualization.detect() - if result == virtualization.DETECT_RESULT_UNSUPPORTED: - self.logger.warning( - _( - 'Disabling all-in-one plugin because hardware ' - 'does not support virtualization' - ) - ) - self.environment[osetupcons.AIOEnv.ENABLE] = False - elif result == virtualization.DETECT_RESULT_SUPPORTED: + if result == virtualization.DETECT_RESULT_SUPPORTED: self.logger.info(_('Hardware supports virtualization')) - else: - self.logger.warning( - _('Cannot detect if hardware supports virtualization') - ) + self.environment[osetupcons.AIOEnv.SUPPORTED] = True @plugin.event( stage=plugin.Stages.STAGE_VALIDATION, -- To view, visit http://gerrit.ovirt.org/20385 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6f5d1edf045fdfb878e6cf2d2cfa8a2e74b10db8 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.3 Gerrit-Owner: Alex Lourie <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
