Search in sources :

Example 1 with GetVolumeInfoVDSCommandParameters

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

the class GetImageInfoVDSCommand method executeIrsBrokerCommand.

@Override
protected void executeIrsBrokerCommand() {
    GetVolumeInfoVDSCommandParameters p = new GetVolumeInfoVDSCommandParameters(getCurrentIrsProxy().getCurrentVdsId(), getParameters().getStoragePoolId(), getParameters().getStorageDomainId(), getParameters().getImageGroupId(), getParameters().getImageId());
    DiskImage di = (DiskImage) resourceManager.runVdsCommand(VDSCommandType.GetVolumeInfo, p).getReturnValue();
    // if couldn't parse image then succeeded should be false
    getVDSReturnValue().setSucceeded(di != null);
    if (!getVDSReturnValue().getSucceeded()) {
        log.error("Failed to get the volume information, marking as FAILED");
    }
    setReturnValue(di);
}
Also used : GetVolumeInfoVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.GetVolumeInfoVDSCommandParameters) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage)

Example 2 with GetVolumeInfoVDSCommandParameters

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

the class SPMGetVolumeInfoVDSCommand method executeIrsBrokerCommand.

@Override
protected void executeIrsBrokerCommand() {
    log.info("Executing GetVolumeInfo using the current SPM");
    GetVolumeInfoVDSCommandParameters params = new GetVolumeInfoVDSCommandParameters(getCurrentIrsProxy().getCurrentVdsId(), getParameters().getStoragePoolId(), getParameters().getStorageDomainId(), getParameters().getImageGroupId(), getParameters().getImageId());
    params.setExpectedEngineErrors(getParameters().getExpectedEngineErrors());
    setVDSReturnValue(resourceManager.runVdsCommand(VDSCommandType.GetVolumeInfo, params));
}
Also used : GetVolumeInfoVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.GetVolumeInfoVDSCommandParameters) SPMGetVolumeInfoVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.SPMGetVolumeInfoVDSCommandParameters)

Example 3 with GetVolumeInfoVDSCommandParameters

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

the class GetQemuImageInfoVDSCommand method executeVdsBrokerCommand.

@Override
protected void executeVdsBrokerCommand() {
    GetVolumeInfoVDSCommandParameters params = getParameters();
    result = getBroker().getQemuImageInfo(params.getStorageDomainId().toString(), params.getStoragePoolId().toString(), params.getImageGroupId().toString(), params.getImageId().toString());
    proceedProxyReturnValue();
    setReturnValue(buildImageEntity(result.getQemuImageInfo()));
    getVDSReturnValue().setSucceeded(getReturnValue() != null);
}
Also used : GetVolumeInfoVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.GetVolumeInfoVDSCommandParameters)

Example 4 with GetVolumeInfoVDSCommandParameters

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

the class VdsmImagePoller method pollImage.

protected HostJobStatus pollImage(Guid storagePoolId, Guid storageDomainId, Guid imageGroupId, Guid imageId, int executionGeneration, Guid cmdId, ActionType actionType) {
    Image imageInfo = ((DiskImage) vdsCommandsHelper.runVdsCommandWithoutFailover(VDSCommandType.GetVolumeInfo, new GetVolumeInfoVDSCommandParameters(storagePoolId, storageDomainId, imageGroupId, imageId), storagePoolId, null).getReturnValue()).getImage();
    if (imageInfo.getLeaseStatus() != null && !imageInfo.getLeaseStatus().isFree()) {
        log.info("Command {} id: '{}': the volume lease is not FREE - the job is running", actionType, cmdId);
        return HostJobStatus.running;
    }
    if (imageInfo.getGeneration() == executionGeneration + 1) {
        log.info("Command {} id: '{}': the volume lease is free and the generation was incremented - the " + "job execution has completed successfully", actionType, cmdId);
        return HostJobStatus.done;
    }
    if (imageInfo.getGeneration() == executionGeneration + StorageConstants.ENTITY_FENCING_GENERATION_DIFF) {
        log.info("Command {} id: '{}': the volume generation was incremented by the job fencing diff - the job " + "was fenced and its status can be considered as failed", actionType, cmdId);
        return HostJobStatus.failed;
    }
    log.info("Command {} id: '{}': couldn't determine the status of the job by entity polling", actionType, cmdId);
    return null;
}
Also used : DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage) Image(org.ovirt.engine.core.common.businessentities.storage.Image) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage) GetVolumeInfoVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.GetVolumeInfoVDSCommandParameters)

Example 5 with GetVolumeInfoVDSCommandParameters

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

the class GetVolumeInfoVDSCommand method executeVdsBrokerCommand.

@Override
protected void executeVdsBrokerCommand() {
    GetVolumeInfoVDSCommandParameters params = getParameters();
    result = getBroker().getVolumeInfo(params.getStorageDomainId().toString(), params.getStoragePoolId().toString(), params.getImageGroupId().toString(), params.getImageId().toString());
    proceedProxyReturnValue();
    setReturnValue(buildImageEntity(result.getVolumeInfo()));
    getVDSReturnValue().setSucceeded(getReturnValue() != null);
}
Also used : GetVolumeInfoVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.GetVolumeInfoVDSCommandParameters)

Aggregations

GetVolumeInfoVDSCommandParameters (org.ovirt.engine.core.common.vdscommands.GetVolumeInfoVDSCommandParameters)6 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)3 Image (org.ovirt.engine.core.common.businessentities.storage.Image)1 SPMGetVolumeInfoVDSCommandParameters (org.ovirt.engine.core.common.vdscommands.SPMGetVolumeInfoVDSCommandParameters)1 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)1