sureshanaparti commented on code in PR #11625: URL: https://github.com/apache/cloudstack/pull/11625#discussion_r2348718416
########## engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java: ########## @@ -448,7 +452,54 @@ protected Answer copyVolumeBetweenPools(DataObject srcData, DataObject destData) } return answer; } + } + + private boolean canBypassSecondaryStorage(DataObject srcData, DataObject destData) { + if (srcData instanceof VolumeInfo) { + if (((VolumeInfo)srcData).isDirectDownload()) { + return true; + } + + if (destData instanceof VolumeInfo) { + Scope srcDataStoreScope = srcData.getDataStore().getScope(); + Scope destDataStoreScope = destData.getDataStore().getScope(); + logger.info("srcDataStoreScope: {}, srcData pool type: {}; destDataStoreScope: {}, destData pool type: {}", + srcDataStoreScope, ((VolumeInfo)srcData).getStoragePoolType(), destDataStoreScope, ((VolumeInfo)destData).getStoragePoolType()); + + if (srcDataStoreScope != null && destDataStoreScope != null && + SUPPORTED_POOL_TYPES_TO_BYPASS_SECONDARY_STORE.contains(((VolumeInfo)srcData).getStoragePoolType()) && + SUPPORTED_POOL_TYPES_TO_BYPASS_SECONDARY_STORE.contains(((VolumeInfo)destData).getStoragePoolType())) { + + if (srcDataStoreScope.isSameScope(destDataStoreScope)) { + return true; + } + + if (srcDataStoreScope.getScopeType() == ScopeType.HOST) { Review Comment: will check -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org