@@ -363,6 +363,7 @@ protected Answer copyVolumeBetweenPools(DataObject srcData, DataObject destData)
363363
364364 if (cacheStore == null ) {
365365 if (bypassSecondaryStorage ) {
366+ logger .debug ("Secondary storage is bypassed, copy volume between pools directly" );
366367 CopyCommand cmd = new CopyCommand (srcData .getTO (), destData .getTO (), _copyvolumewait , VirtualMachineManager .ExecuteInSequence .value ());
367368 EndPoint ep = selector .select (srcData , destData , encryptionRequired );
368369 Answer answer = null ;
@@ -462,9 +463,8 @@ private boolean canBypassSecondaryStorage(DataObject srcData, DataObject destDat
462463 if (destData instanceof VolumeInfo ) {
463464 Scope srcDataStoreScope = srcData .getDataStore ().getScope ();
464465 Scope destDataStoreScope = destData .getDataStore ().getScope ();
465- logger .info ("srcDataStoreScope: {}, destDataStoreScope: {}" , srcDataStoreScope , destDataStoreScope );
466- logger .info ("srcData - pool type: {}, scope: {}; destData - pool type: {}, scope: {}" ,
467- ((VolumeInfo )srcData ).getStoragePoolType (), srcDataStoreScope != null ? srcDataStoreScope .getScopeType () : null , ((VolumeInfo )destData ).getStoragePoolType (), destDataStoreScope != null ? destDataStoreScope .getScopeType () : null );
466+ logger .info ("srcDataStoreScope: {}, srcData pool type: {}; destDataStoreScope: {}, destData pool type: {}" ,
467+ srcDataStoreScope , ((VolumeInfo )srcData ).getStoragePoolType (), destDataStoreScope , ((VolumeInfo )destData ).getStoragePoolType ());
468468
469469 if (srcDataStoreScope != null && destDataStoreScope != null &&
470470 SUPPORTED_POOL_TYPES_TO_BYPASS_SECONDARY_STORE .contains (((VolumeInfo )srcData ).getStoragePoolType ()) &&
@@ -474,16 +474,26 @@ private boolean canBypassSecondaryStorage(DataObject srcData, DataObject destDat
474474 return true ;
475475 }
476476
477- if (srcDataStoreScope .getScopeType () == ScopeType .CLUSTER &&
478- destDataStoreScope .getScopeType () == ScopeType .HOST &&
479- (Objects .equals (((ClusterScope ) srcDataStoreScope ).getScopeId (), ((HostScope ) destDataStoreScope ).getClusterId ()))) {
480- return true ;
477+ if (srcDataStoreScope .getScopeType () == ScopeType .HOST ) {
478+ if (destDataStoreScope .getScopeType () == ScopeType .CLUSTER &&
479+ (Objects .equals (((HostScope ) srcDataStoreScope ).getClusterId (), ((ClusterScope ) destDataStoreScope ).getScopeId ()))) {
480+ return true ;
481+ }
482+ if (destDataStoreScope .getScopeType () == ScopeType .ZONE &&
483+ (Objects .equals (((HostScope ) srcDataStoreScope ).getZoneId (), ((ZoneScope ) destDataStoreScope ).getScopeId ()))) {
484+ return true ;
485+ }
481486 }
482487
483- if (srcDataStoreScope .getScopeType () == ScopeType .HOST &&
484- destDataStoreScope .getScopeType () == ScopeType .CLUSTER &&
485- (Objects .equals (((HostScope ) srcDataStoreScope ).getClusterId (), ((ClusterScope ) destDataStoreScope ).getScopeId ()))) {
486- return true ;
488+ if (destDataStoreScope .getScopeType () == ScopeType .HOST ) {
489+ if (srcDataStoreScope .getScopeType () == ScopeType .CLUSTER &&
490+ (Objects .equals (((ClusterScope ) srcDataStoreScope ).getScopeId (), ((HostScope ) destDataStoreScope ).getClusterId ()))) {
491+ return true ;
492+ }
493+ if (srcDataStoreScope .getScopeType () == ScopeType .ZONE &&
494+ (Objects .equals (((ZoneScope ) srcDataStoreScope ).getScopeId (), ((HostScope ) destDataStoreScope ).getZoneId ()))) {
495+ return true ;
496+ }
487497 }
488498 }
489499 }
0 commit comments