Search in sources :

Example 1 with VdsAndVmIDVDSParametersBase

use of org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase in project ovirt-engine by oVirt.

the class FreezeVmCommand method perform.

@Override
protected void perform() {
    VDSReturnValue returnValue = runVdsCommand(VDSCommandType.Freeze, new VdsAndVmIDVDSParametersBase(getVdsId(), getVmId()));
    setActionReturnValue(returnValue.getReturnValue());
    setSucceeded(returnValue.getSucceeded());
}
Also used : VdsAndVmIDVDSParametersBase(org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Example 2 with VdsAndVmIDVDSParametersBase

use of org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase in project ovirt-engine by oVirt.

the class RebootVmCommand method perform.

@Override
protected void perform() {
    if (isColdReboot()) {
        ActionReturnValue returnValue = runInternalAction(ActionType.ShutdownVm, new ShutdownVmParameters(getVmId(), false));
        setReturnValue(returnValue);
        setSucceeded(returnValue.getSucceeded());
        if (getSucceeded()) {
            resourceManager.getVmManager(getVmId()).setColdReboot(true);
        }
    } else {
        final VDSReturnValue returnValue = runVdsCommand(VDSCommandType.RebootVm, new VdsAndVmIDVDSParametersBase(getVdsId(), getVmId()));
        setActionReturnValue(returnValue.getReturnValue());
        setSucceeded(returnValue.getSucceeded());
    }
}
Also used : VdsAndVmIDVDSParametersBase(org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) ShutdownVmParameters(org.ovirt.engine.core.common.action.ShutdownVmParameters) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Example 3 with VdsAndVmIDVDSParametersBase

use of org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase in project ovirt-engine by oVirt.

the class CreateSnapshotForVmCommand method freezeVm.

/**
 * Freezing the VM is needed for live snapshot with Cinder disks.
 */
private void freezeVm() {
    if (!shouldFreezeOrThawVm()) {
        return;
    }
    VDSReturnValue returnValue;
    try {
        auditLogDirector.log(this, AuditLogType.FREEZE_VM_INITIATED);
        returnValue = runVdsCommand(VDSCommandType.Freeze, new VdsAndVmIDVDSParametersBase(getVds().getId(), getVmId()));
    } catch (EngineException e) {
        handleFreezeVmFailure(e);
        return;
    }
    if (returnValue.getSucceeded()) {
        auditLogDirector.log(this, AuditLogType.FREEZE_VM_SUCCESS);
    } else {
        handleFreezeVmFailure(new EngineException(EngineError.freezeErr));
    }
}
Also used : VdsAndVmIDVDSParametersBase(org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase) EngineException(org.ovirt.engine.core.common.errors.EngineException) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Example 4 with VdsAndVmIDVDSParametersBase

use of org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase in project ovirt-engine by oVirt.

the class CancelConvertVmCommand method executeVmCommand.

@Override
protected void executeVmCommand() {
    VDSReturnValue retVal = runVdsCommand(VDSCommandType.CancelConvertVm, new VdsAndVmIDVDSParametersBase(getVdsId(), getVmId()));
    setSucceeded(retVal.getSucceeded());
}
Also used : VdsAndVmIDVDSParametersBase(org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Example 5 with VdsAndVmIDVDSParametersBase

use of org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase in project ovirt-engine by oVirt.

the class ThawVmCommand method perform.

@Override
protected void perform() {
    VDSReturnValue returnValue = runVdsCommand(VDSCommandType.Thaw, new VdsAndVmIDVDSParametersBase(getVdsId(), getVmId()));
    setActionReturnValue(returnValue.getReturnValue());
    setSucceeded(returnValue.getSucceeded());
}
Also used : VdsAndVmIDVDSParametersBase(org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

Aggregations

VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)5 VdsAndVmIDVDSParametersBase (org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase)5 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 ShutdownVmParameters (org.ovirt.engine.core.common.action.ShutdownVmParameters)1 EngineException (org.ovirt.engine.core.common.errors.EngineException)1