Search in sources :

Example 6 with GetVolumeInfoVDSCommandParameters

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

the class CreateOvaCommand method fillDiskApparentSize.

private void fillDiskApparentSize(Collection<DiskImage> disks) {
    disks.forEach(destination -> {
        VDSReturnValue vdsReturnValue = vdsCommandsHelper.runVdsCommandWithFailover(VDSCommandType.GetVolumeInfo, new GetVolumeInfoVDSCommandParameters(destination.getStoragePoolId(), destination.getStorageIds().get(0), destination.getId(), destination.getImageId()), destination.getStoragePoolId(), null);
        if (vdsReturnValue != null && vdsReturnValue.getSucceeded()) {
            DiskImage fromVdsm = (DiskImage) vdsReturnValue.getReturnValue();
            destination.setActualSizeInBytes(fromVdsm.getApparentSizeInBytes());
        }
    });
}
Also used : GetVolumeInfoVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.GetVolumeInfoVDSCommandParameters) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue)

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