use of org.ovirt.engine.core.common.vdscommands.MoveImageGroupVDSCommandParameters in project ovirt-engine by oVirt.
the class CopyImageGroupCommand method performStorageOperation.
private boolean performStorageOperation() {
Guid sourceDomainId = getParameters().getSourceDomainId() != null ? getParameters().getSourceDomainId() : getDiskImage().getStorageIds().get(0);
if (isUsingSPDMFlow()) {
CopyImageGroupWithDataCommandParameters p = new CopyImageGroupWithDataCommandParameters(getStorageDomain().getStoragePoolId(), sourceDomainId, getParameters().getStorageDomainId(), getParameters().getImageGroupID(), getParameters().getImageId(), getParameters().getImageGroupID(), getParameters().getImageId(), getVolumeFormatForDomain(), getParameters().getUseCopyCollapse());
p.setParentParameters(getParameters());
p.setParentCommand(getActionType());
p.setEndProcedure(EndProcedure.COMMAND_MANAGED);
p.setJobWeight(getParameters().getJobWeight());
runInternalAction(ActionType.CopyImageGroupWithData, p);
return true;
} else {
VDSReturnValue vdsReturnValue;
Guid taskId = persistAsyncTaskPlaceHolder(getParameters().getParentCommand());
if (getParameters().getUseCopyCollapse()) {
vdsReturnValue = runVdsCommand(VDSCommandType.CopyImage, postDeleteActionHandler.fixParameters(new CopyImageVDSCommandParameters(getStorageDomain().getStoragePoolId(), sourceDomainId, getParameters().getContainerId(), getParameters().getImageGroupID(), getParameters().getImageId(), getParameters().getDestImageGroupId(), getParameters().getDestinationImageId(), "", getParameters().getStorageDomainId(), getParameters().getCopyVolumeType(), getVolumeFormatForDomain(), getParameters().getVolumeType(), isWipeAfterDelete(), getStorageDomain().getDiscardAfterDelete(), getParameters().getForceOverride())));
} else {
vdsReturnValue = runVdsCommand(VDSCommandType.MoveImageGroup, postDeleteActionHandler.fixParameters(new MoveImageGroupVDSCommandParameters(getDiskImage() != null ? getDiskImage().getStoragePoolId() : getStorageDomain().getStoragePoolId(), sourceDomainId, getDiskImage() != null ? getDiskImage().getId() : getParameters().getImageGroupID(), getParameters().getStorageDomainId(), getParameters().getContainerId(), ImageOperation.Copy, isWipeAfterDelete(), storageDomainDao.get(sourceDomainId).getDiscardAfterDelete(), getParameters().getForceOverride())));
}
if (vdsReturnValue.getSucceeded()) {
AsyncTaskCreationInfo taskCreationInfo = vdsReturnValue.getCreationInfo();
getTaskIdList().add(createTask(taskId, taskCreationInfo, getParameters().getParentCommand(), VdcObjectType.Storage, sourceDomainId, getParameters().getStorageDomainId()));
}
return vdsReturnValue.getSucceeded();
}
}
Aggregations