Search in sources :

Example 1 with FenceVdsManualyParameters

use of org.ovirt.engine.core.common.action.FenceVdsManualyParameters in project ovirt-engine by oVirt.

the class HostListModel method onManualFence.

public void onManualFence() {
    ConfirmationModel model = (ConfirmationModel) getWindow();
    if (model.getProgress() != null) {
        return;
    }
    if (!model.validate()) {
        return;
    }
    ArrayList<ActionParametersBase> list = new ArrayList<>();
    for (Object item : getSelectedItems()) {
        VDS vds = (VDS) item;
        FenceVdsManualyParameters parameters = new FenceVdsManualyParameters(true);
        parameters.setStoragePoolId(vds.getStoragePoolId());
        parameters.setVdsId(vds.getId());
        list.add(parameters);
    }
    model.startProgress();
    Frontend.getInstance().runMultipleAction(ActionType.FenceVdsManualy, list, result -> {
        ConfirmationModel localModel = (ConfirmationModel) result.getState();
        localModel.stopProgress();
        cancel();
    }, model);
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) ArrayList(java.util.ArrayList) JsSingleValueStringObject(org.ovirt.engine.ui.frontend.utils.JsSingleValueStringObject) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) HostMaintenanceConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.HostMaintenanceConfirmationModel) FenceVdsManualyParameters(org.ovirt.engine.core.common.action.FenceVdsManualyParameters) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase)

Example 2 with FenceVdsManualyParameters

use of org.ovirt.engine.core.common.action.FenceVdsManualyParameters in project ovirt-engine by oVirt.

the class BackendHostResource method fenceManually.

private Response fenceManually(Action action) {
    FenceVdsManualyParameters params = new FenceVdsManualyParameters(true);
    params.setVdsId(guid);
    params.setStoragePoolId(getEntity().getStoragePoolId());
    return doAction(ActionType.FenceVdsManualy, params, action);
}
Also used : FenceVdsManualyParameters(org.ovirt.engine.core.common.action.FenceVdsManualyParameters)

Example 3 with FenceVdsManualyParameters

use of org.ovirt.engine.core.common.action.FenceVdsManualyParameters in project ovirt-engine by oVirt.

the class RestartVdsCommand method executeFenceVdsManuallyAction.

private void executeFenceVdsManuallyAction(final Guid vdsId, String sessionId) {
    FenceVdsManualyParameters fenceVdsManuallyParams = new FenceVdsManualyParameters(true);
    fenceVdsManuallyParams.setStoragePoolId(getVds().getStoragePoolId());
    fenceVdsManuallyParams.setVdsId(vdsId);
    fenceVdsManuallyParams.setSessionId(sessionId);
    fenceVdsManuallyParams.setParentCommand(ActionType.RestartVds);
    // if fencing succeeded, call to reset irs in order to try select new spm
    runInternalAction(ActionType.FenceVdsManualy, fenceVdsManuallyParams, getContext());
}
Also used : FenceVdsManualyParameters(org.ovirt.engine.core.common.action.FenceVdsManualyParameters)

Example 4 with FenceVdsManualyParameters

use of org.ovirt.engine.core.common.action.FenceVdsManualyParameters in project ovirt-engine by oVirt.

the class VdsKdumpDetectionCommand method executeFenceVdsManuallyAction.

private void executeFenceVdsManuallyAction() {
    FenceVdsManualyParameters fenceVdsManuallyParams = new FenceVdsManualyParameters(false);
    fenceVdsManuallyParams.setStoragePoolId(getVds().getStoragePoolId());
    fenceVdsManuallyParams.setVdsId(getVdsId());
    fenceVdsManuallyParams.setSessionId(getParameters().getSessionId());
    fenceVdsManuallyParams.setParentCommand(ActionType.RestartVds);
    // if fencing succeeded, call to reset irs in order to try select new spm
    runInternalAction(ActionType.FenceVdsManualy, fenceVdsManuallyParams, getContext());
}
Also used : FenceVdsManualyParameters(org.ovirt.engine.core.common.action.FenceVdsManualyParameters)

Aggregations

FenceVdsManualyParameters (org.ovirt.engine.core.common.action.FenceVdsManualyParameters)4 ArrayList (java.util.ArrayList)1 ActionParametersBase (org.ovirt.engine.core.common.action.ActionParametersBase)1 VDS (org.ovirt.engine.core.common.businessentities.VDS)1 JsSingleValueStringObject (org.ovirt.engine.ui.frontend.utils.JsSingleValueStringObject)1 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)1 HostMaintenanceConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.HostMaintenanceConfirmationModel)1