use of org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters in project ovirt-engine by oVirt.
the class UpgradeModel method onUpgrade.
private void onUpgrade() {
if (!validate(true)) {
return;
}
UpgradeHostParameters params = new UpgradeHostParameters(getVds().getId());
params.setoVirtIsoFile(getOVirtISO().getSelectedItem().getRpmName());
invokeHostUpgrade(params);
}
use of org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters in project ovirt-engine by oVirt.
the class HostUpgradeCallback method evaluateMaintenanceHostCommandProgress.
/**
* Evaluates the host status in regards to maintenance status: The host must move to {@code VDSStatus.Maintenance}
* in order to proceed with the upgrade process.
*
* @param childCmdIds
* child command IDs list to search if {@code MaintenanceNumberOfVdss} exists in it
* @param rootCommand
* The root command
*/
private void evaluateMaintenanceHostCommandProgress(List<Guid> childCmdIds, CommandBase<?> rootCommand) {
UpgradeHostParameters parameters = (UpgradeHostParameters) rootCommand.getParameters();
VdsDynamic host = DbFacade.getInstance().getVdsDynamicDao().get(parameters.getVdsId());
switch(host.getStatus()) {
// Wait till moving to maintenance ends
case PreparingForMaintenance:
break;
// Invoke the upgrade action
case Maintenance:
log.info("Host '{}' is on maintenance mode. Proceeding with Upgrade process.", getHostName(parameters.getVdsId()));
invokeHostUpgrade(rootCommand, parameters);
break;
// Any other status implies maintenance action failed, and the callback cannot proceed with the upgrade
default:
if (isMaintenanceCommandExecuted(childCmdIds)) {
log.error("Host '{}' failed to move to maintenance mode. Upgrade process is terminated.", getHostName(parameters.getVdsId()));
auditLogDirector.log(rootCommand, AuditLogType.VDS_MAINTENANCE_FAILED);
rootCommand.setCommandStatus(CommandStatus.FAILED);
}
break;
}
}
use of org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters in project ovirt-engine by oVirt.
the class HostUpgradeCallback method createUpgradeParameters.
private ActionParametersBase createUpgradeParameters(UpgradeHostParameters parameters) {
UpgradeHostParameters upgradeParams = new UpgradeHostParameters(parameters.getVdsId());
upgradeParams.setSessionId(parameters.getSessionId());
upgradeParams.setCorrelationId(parameters.getCorrelationId());
upgradeParams.setInitialStatus(parameters.getInitialStatus());
upgradeParams.setoVirtIsoFile(parameters.getoVirtIsoFile());
upgradeParams.setParentCommand(ActionType.UpgradeHost);
upgradeParams.setParentParameters(parameters);
upgradeParams.setReboot(parameters.isReboot());
return upgradeParams;
}
use of org.ovirt.engine.core.common.action.hostdeploy.UpgradeHostParameters in project ovirt-engine by oVirt.
the class UpgradeConfirmationModel method onUpgrade.
private void onUpgrade() {
if (getProgress() != null) {
return;
}
UpgradeHostParameters params = new UpgradeHostParameters(host.getId(), getReboot().getEntity().booleanValue());
invokeHostUpgrade(params);
}
Aggregations