Search in sources :

Example 6 with FenceVdsActionParameters

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());
}
Also used : FenceVdsActionParameters(org.ovirt.engine.core.common.action.FenceVdsActionParameters)

Example 7 with FenceVdsActionParameters

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);
    });
}
Also used : FenceVdsActionParameters(org.ovirt.engine.core.common.action.FenceVdsActionParameters)

Example 8 with FenceVdsActionParameters

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);
}
Also used : FenceVdsActionParameters(org.ovirt.engine.core.common.action.FenceVdsActionParameters)

Aggregations

FenceVdsActionParameters (org.ovirt.engine.core.common.action.FenceVdsActionParameters)8 VDS (org.ovirt.engine.core.common.businessentities.VDS)5 ArrayList (java.util.ArrayList)3 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)3 JsSingleValueStringObject (org.ovirt.engine.ui.frontend.utils.JsSingleValueStringObject)3 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)2 HostMaintenanceConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.HostMaintenanceConfirmationModel)2 MaintenanceNumberOfVdssParameters (org.ovirt.engine.core.common.action.MaintenanceNumberOfVdssParameters)1 VdsActionParameters (org.ovirt.engine.core.common.action.VdsActionParameters)1 VdsPowerDownParameters (org.ovirt.engine.core.common.action.VdsPowerDownParameters)1 VDSStatus (org.ovirt.engine.core.common.businessentities.VDSStatus)1 Guid (org.ovirt.engine.core.compat.Guid)1