use of org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters in project ovirt-engine by oVirt.
the class BackendTemplateDiskResource method copy.
@Override
public Response copy(Action action) {
validateParameters(action, "storageDomain.id|name");
Guid storageDomainId = getStorageDomainId(action);
Disk disk = getDisk();
Guid imageId = asGuid(disk.getImageId());
MoveOrCopyImageGroupParameters params = new MoveOrCopyImageGroupParameters(imageId, Guid.Empty, storageDomainId, ImageOperation.Copy);
params.setImageGroupID(asGuid(disk.getId()));
return doAction(ActionType.MoveOrCopyDisk, params, action);
}
use of org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters in project ovirt-engine by oVirt.
the class MoveOrCopyDiskModel method addMoveOrCopyParameters.
protected void addMoveOrCopyParameters(ArrayList<ActionParametersBase> parameters, Guid sourceStorageDomainGuid, Guid destStorageDomainGuid, DiskImage disk) {
MoveOrCopyImageGroupParameters params = createParameters(sourceStorageDomainGuid, destStorageDomainGuid, disk);
params.setQuotaId(disk.getQuotaId());
params.setDiskProfileId(disk.getDiskProfileId());
params.setNewAlias(disk.getDiskAlias());
parameters.add(params);
}
use of org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters in project ovirt-engine by oVirt.
the class ExportVmCommand method buildMoveOrCopyImageGroupParametersForMemoryDumpImage.
private MoveOrCopyImageGroupParameters buildMoveOrCopyImageGroupParametersForMemoryDumpImage(Guid containerID, DiskImage disk) {
MoveOrCopyImageGroupParameters params = new MoveOrCopyImageGroupParameters(containerID, disk.getId(), disk.getImageId(), getParameters().getStorageDomainId(), ImageOperation.Copy);
StorageDomainStatic sourceDomain = storageDomainStaticDao.get(disk.getStorageIds().get(0));
// so we need to use copy collapse in order to convert it to be sparsed in the export domain
if (sourceDomain.getStorageType().isBlockDomain()) {
params.setUseCopyCollapse(true);
params.setVolumeType(VolumeType.Sparse);
params.setVolumeFormat(VolumeFormat.RAW);
}
return params;
}
use of org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters in project ovirt-engine by oVirt.
the class ExportVmCommand method buildMoveOrCopyImageGroupParameters.
private MoveOrCopyImageGroupParameters buildMoveOrCopyImageGroupParameters(Guid containerID, DiskImage disk) {
MoveOrCopyImageGroupParameters params = new MoveOrCopyImageGroupParameters(containerID, disk.getId(), disk.getImageId(), getParameters().getStorageDomainId(), ImageOperation.Copy);
params.setParentCommand(getActionType());
params.setEntityInfo(getParameters().getEntityInfo());
params.setCopyVolumeType(CopyVolumeType.LeafVol);
params.setForceOverride(getParameters().getForceOverride());
params.setParentParameters(getParameters());
params.setSourceDomainId(disk.getStorageIds().get(0));
return params;
}
use of org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters in project ovirt-engine by oVirt.
the class ExportVmCommand method buildMoveOrCopyImageGroupParametersForDisk.
private MoveOrCopyImageGroupParameters buildMoveOrCopyImageGroupParametersForDisk(Guid containerID, DiskImage disk) {
MoveOrCopyImageGroupParameters params = new MoveOrCopyImageGroupParameters(containerID, disk.getId(), disk.getImageId(), getParameters().getStorageDomainId(), ImageOperation.Copy);
params.setParentCommand(getActionType());
params.setEntityInfo(getParameters().getEntityInfo());
params.setUseCopyCollapse(getParameters().getCopyCollapse());
DiskImage diskForVolumeInfo = getDiskForVolumeInfo(disk);
params.setVolumeFormat(diskForVolumeInfo.getVolumeFormat());
params.setVolumeType(diskForVolumeInfo.getVolumeType());
params.setCopyVolumeType(CopyVolumeType.LeafVol);
params.setForceOverride(getParameters().getForceOverride());
params.setParentParameters(getParameters());
return params;
}
Aggregations