Search in sources :

Example 1 with RemoveSnapshotParameters

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

the class GlusterStorageSyncCommand method removeDRSnapshots.

private void removeDRSnapshots() {
    for (Map.Entry<Guid, Guid> entry : getParameters().getVmIdSnapshotIds().entrySet()) {
        RemoveSnapshotParameters removeSnapshotParameters = new RemoveSnapshotParameters(entry.getValue(), entry.getKey());
        removeSnapshotParameters.setParentCommand(getActionType());
        removeSnapshotParameters.setEndProcedure(EndProcedure.COMMAND_MANAGED);
        removeSnapshotParameters.setParentParameters(getParameters());
        removeSnapshotParameters.setNeedsLocking(false);
        commandCoordinatorUtil.executeAsyncCommand(ActionType.RemoveSnapshot, removeSnapshotParameters, cloneContextAndDetachFromParent());
    }
}
Also used : RemoveSnapshotParameters(org.ovirt.engine.core.common.action.RemoveSnapshotParameters) Guid(org.ovirt.engine.core.compat.Guid) HashMap(java.util.HashMap) Map(java.util.Map)

Example 2 with RemoveSnapshotParameters

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

the class LiveMigrateDiskCommand method removeAutogeneratedSnapshot.

private void removeAutogeneratedSnapshot() {
    RemoveSnapshotParameters removeSnapshotParameters = new RemoveSnapshotParameters(getParameters().getAutoGeneratedSnapshotId(), getVmId());
    removeSnapshotParameters.setEndProcedure(EndProcedure.COMMAND_MANAGED);
    removeSnapshotParameters.setParentCommand(getActionType());
    removeSnapshotParameters.setParentParameters(getParameters());
    removeSnapshotParameters.setNeedsLocking(false);
    // This is required to prevent the freeLock() in RemoveSnapshotCommand#execute
    // from being called and prematurely freeing the lock
    removeSnapshotParameters.setFreeLockNeeded(false);
    runInternalAction(ActionType.RemoveSnapshot, removeSnapshotParameters, ExecutionHandler.createInternalJobContext(createStepsContext(StepEnum.MERGE_SNAPSHOTS), liveStorageMigrationEngineLock));
}
Also used : RemoveSnapshotParameters(org.ovirt.engine.core.common.action.RemoveSnapshotParameters)

Example 3 with RemoveSnapshotParameters

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

the class VmSnapshotListModel method onRemove.

private void onRemove() {
    Snapshot snapshot = getSelectedItem();
    if (snapshot == null) {
        cancel();
        return;
    }
    VM vm = getEntity();
    if (vm != null) {
        Frontend.getInstance().runAction(ActionType.RemoveSnapshot, new RemoveSnapshotParameters(snapshot.getId(), vm.getId()), null, null);
    }
    getCanSelectSnapshot().setEntity(false);
    cancel();
}
Also used : Snapshot(org.ovirt.engine.core.common.businessentities.Snapshot) RemoveSnapshotParameters(org.ovirt.engine.core.common.action.RemoveSnapshotParameters) VM(org.ovirt.engine.core.common.businessentities.VM)

Aggregations

RemoveSnapshotParameters (org.ovirt.engine.core.common.action.RemoveSnapshotParameters)3 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Snapshot (org.ovirt.engine.core.common.businessentities.Snapshot)1 VM (org.ovirt.engine.core.common.businessentities.VM)1 Guid (org.ovirt.engine.core.compat.Guid)1