Search in sources :

Example 6 with VdsmImageLocationInfo

use of org.ovirt.engine.core.common.businessentities.VdsmImageLocationInfo in project ovirt-engine by oVirt.

the class AmendVolumeCommand method attemptToFenceJob.

@Override
public void attemptToFenceJob() {
    VdsmImageLocationInfo info = (VdsmImageLocationInfo) getParameters().getVolInfo();
    FenceVolumeJobCommandParameters parameters = new FenceVolumeJobCommandParameters(info);
    parameters.setParentCommand(getActionType());
    parameters.setParentParameters(getParameters());
    parameters.setStoragePoolId(getParameters().getStoragePoolId());
    parameters.setEndProcedure(ActionParametersBase.EndProcedure.COMMAND_MANAGED);
    runInternalActionWithTasksContext(ActionType.FenceVolumeJob, parameters);
}
Also used : FenceVolumeJobCommandParameters(org.ovirt.engine.core.common.action.FenceVolumeJobCommandParameters) VdsmImageLocationInfo(org.ovirt.engine.core.common.businessentities.VdsmImageLocationInfo)

Example 7 with VdsmImageLocationInfo

use of org.ovirt.engine.core.common.businessentities.VdsmImageLocationInfo in project ovirt-engine by oVirt.

the class UpdateVolumeCommand method completeGenerationInfo.

private void completeGenerationInfo() {
    VdsmImageLocationInfo info = getParameters().getVolInfo();
    DiskImage image = imagesHandler.getVolumeInfoFromVdsm(getParameters().getStoragePoolId(), info.getStorageDomainId(), info.getImageGroupId(), info.getImageId());
    info.setGeneration(image.getImage().getGeneration());
    persistCommandIfNeeded();
}
Also used : VdsmImageLocationInfo(org.ovirt.engine.core.common.businessentities.VdsmImageLocationInfo) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage)

Example 8 with VdsmImageLocationInfo

use of org.ovirt.engine.core.common.businessentities.VdsmImageLocationInfo in project ovirt-engine by oVirt.

the class UpdateVolumeCommand method attemptToFenceJob.

@Override
public void attemptToFenceJob() {
    log.info("Command {} id: '{}': attempting to fence job {}", getActionType(), getCommandId(), getJobId());
    VdsmImageLocationInfo info = getParameters().getVolInfo();
    FenceVolumeJobCommandParameters p = new FenceVolumeJobCommandParameters(info);
    p.setParentCommand(getActionType());
    p.setParentParameters(getParameters());
    p.setStoragePoolId(getParameters().getStoragePoolId());
    p.setEndProcedure(ActionParametersBase.EndProcedure.COMMAND_MANAGED);
    runInternalActionWithTasksContext(ActionType.FenceVolumeJob, p);
}
Also used : FenceVolumeJobCommandParameters(org.ovirt.engine.core.common.action.FenceVolumeJobCommandParameters) VdsmImageLocationInfo(org.ovirt.engine.core.common.businessentities.VdsmImageLocationInfo)

Example 9 with VdsmImageLocationInfo

use of org.ovirt.engine.core.common.businessentities.VdsmImageLocationInfo in project ovirt-engine by oVirt.

the class ColdMergeCommand method attemptToFenceJob.

@Override
public void attemptToFenceJob() {
    SubchainInfo info = getParameters().getSubchainInfo();
    VdsmImageLocationInfo locationInfo = new VdsmImageLocationInfo(info.getStorageDomainId(), info.getImageGroupId(), info.getBaseImageId(), info.getBaseImageGeneration());
    FenceVolumeJobCommandParameters parameters = new FenceVolumeJobCommandParameters(locationInfo);
    parameters.setParentCommand(getActionType());
    parameters.setParentParameters(getParameters());
    parameters.setStoragePoolId(getParameters().getStoragePoolId());
    parameters.setEndProcedure(ActionParametersBase.EndProcedure.COMMAND_MANAGED);
    runInternalActionWithTasksContext(ActionType.FenceVolumeJob, parameters);
}
Also used : FenceVolumeJobCommandParameters(org.ovirt.engine.core.common.action.FenceVolumeJobCommandParameters) SubchainInfo(org.ovirt.engine.core.common.businessentities.SubchainInfo) VdsmImageLocationInfo(org.ovirt.engine.core.common.businessentities.VdsmImageLocationInfo)

Example 10 with VdsmImageLocationInfo

use of org.ovirt.engine.core.common.businessentities.VdsmImageLocationInfo in project ovirt-engine by oVirt.

the class CopyDataCommand method attemptToFenceJob.

@Override
public void attemptToFenceJob() {
    if (isDstVdsmImage()) {
        log.info("Command {} id: '{}': attempting to fence job {}", getActionType(), getCommandId(), getJobId());
        VdsmImageLocationInfo info = (VdsmImageLocationInfo) getParameters().getDstInfo();
        FenceVolumeJobCommandParameters p = new FenceVolumeJobCommandParameters(info);
        p.setParentCommand(getActionType());
        p.setParentParameters(getParameters());
        p.setStoragePoolId(getParameters().getStoragePoolId());
        p.setEndProcedure(EndProcedure.COMMAND_MANAGED);
        runInternalActionWithTasksContext(ActionType.FenceVolumeJob, p);
    }
}
Also used : FenceVolumeJobCommandParameters(org.ovirt.engine.core.common.action.FenceVolumeJobCommandParameters) VdsmImageLocationInfo(org.ovirt.engine.core.common.businessentities.VdsmImageLocationInfo)

Aggregations

VdsmImageLocationInfo (org.ovirt.engine.core.common.businessentities.VdsmImageLocationInfo)10 FenceVolumeJobCommandParameters (org.ovirt.engine.core.common.action.FenceVolumeJobCommandParameters)4 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)3 HashMap (java.util.HashMap)1 UpdateVolumeCommandParameters (org.ovirt.engine.core.common.action.UpdateVolumeCommandParameters)1 ExternalLocationInfo (org.ovirt.engine.core.common.businessentities.ExternalLocationInfo)1 HttpLocationInfo (org.ovirt.engine.core.common.businessentities.HttpLocationInfo)1 SubchainInfo (org.ovirt.engine.core.common.businessentities.SubchainInfo)1 AmendVolumeVDSCommandParameters (org.ovirt.engine.core.common.vdscommands.AmendVolumeVDSCommandParameters)1 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)1