use of org.ovirt.engine.core.common.action.FenceVdsActionParameters in project ovirt-engine by oVirt.
the class RestartVdsCommand method executeVdsFenceAction.
private ActionReturnValue executeVdsFenceAction(final Guid vdsId, String sessionId, ActionType action) {
FenceVdsActionParameters params = new FenceVdsActionParameters(vdsId);
params.setParentCommand(ActionType.RestartVds);
params.setSessionId(sessionId);
params.setFencingPolicy(getParameters().getFencingPolicy());
// If Host was in Maintenance, and was restarted manually , it should preserve its status after reboot
if (getParameters().getParentCommand() != ActionType.VdsNotRespondingTreatment && getVds().getStatus() == VDSStatus.Maintenance) {
params.setChangeHostToMaintenanceOnStart(true);
}
return runInternalAction(action, params, cloneContext().withoutExecutionContext());
}
use of org.ovirt.engine.core.common.action.FenceVdsActionParameters in project ovirt-engine by oVirt.
the class VdsEventListener method vdsNotResponding.
@Override
public void vdsNotResponding(final VDS vds) {
executionHandler.updateSpecificActionJobCompleted(vds.getId(), ActionType.MaintenanceVds, false);
ThreadPoolUtil.execute(() -> {
log.info("ResourceManager::vdsNotResponding entered for Host '{}', '{}'", vds.getId(), vds.getHostName());
FenceVdsActionParameters params = new FenceVdsActionParameters(vds.getId());
backend.runInternalAction(ActionType.VdsNotRespondingTreatment, params, ExecutionHandler.createInternalJobContext());
moveBricksToUnknown(vds);
});
}
use of org.ovirt.engine.core.common.action.FenceVdsActionParameters in project ovirt-engine by oVirt.
the class VdsPowerDownCommand method executeCommand.
/**
* Try to shut down the host using a clean ssh poweroff method
*/
@Override
protected void executeCommand() {
setVds(null);
if (getVds() == null) {
handleError("SSH power down will not be executed on host {} ({}) since it doesn't exist anymore.");
return;
}
/* Try this only when the Host is in maintenance state */
if (getVds().getStatus() != VDSStatus.Maintenance) {
handleError("SSH power down will not be executed on host {} ({}) since it is not in Maintenance.");
return;
}
boolean result = executeSshPowerDown(getVds().getClusterCompatibilityVersion().toString());
if (result) {
// SSH powerdown executed without errors set the status to down
setVdsStatus(VDSStatus.Down);
// clear the automatic PM flag unless instructed otherwise
if (!getParameters().getKeepPolicyPMEnabled()) {
getVds().setPowerManagementControlledByPolicy(false);
vdsDynamicDao.updateVdsDynamicPowerManagementPolicyFlag(getVdsId(), getVds().getDynamicData().isPowerManagementControlledByPolicy());
}
} else if (getParameters().getFallbackToPowerManagement() && getVds().isPmEnabled()) {
FenceVdsActionParameters parameters = new FenceVdsActionParameters(getVds().getId());
parameters.setKeepPolicyPMEnabled(getParameters().getKeepPolicyPMEnabled());
runInternalAction(ActionType.StopVds, parameters, ExecutionHandler.createInternalJobContext());
}
setSucceeded(result);
}
Aggregations