@@ -363,6 +363,7 @@ protected Answer copyVolumeBetweenPools(DataObject srcData, DataObject destData)
363
363
364
364
if (cacheStore == null ) {
365
365
if (bypassSecondaryStorage ) {
366
+ logger .debug ("Secondary storage is bypassed, copy volume between pools directly" );
366
367
CopyCommand cmd = new CopyCommand (srcData .getTO (), destData .getTO (), _copyvolumewait , VirtualMachineManager .ExecuteInSequence .value ());
367
368
EndPoint ep = selector .select (srcData , destData , encryptionRequired );
368
369
Answer answer = null ;
@@ -462,9 +463,8 @@ private boolean canBypassSecondaryStorage(DataObject srcData, DataObject destDat
462
463
if (destData instanceof VolumeInfo ) {
463
464
Scope srcDataStoreScope = srcData .getDataStore ().getScope ();
464
465
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 ());
468
468
469
469
if (srcDataStoreScope != null && destDataStoreScope != null &&
470
470
SUPPORTED_POOL_TYPES_TO_BYPASS_SECONDARY_STORE .contains (((VolumeInfo )srcData ).getStoragePoolType ()) &&
@@ -474,16 +474,26 @@ private boolean canBypassSecondaryStorage(DataObject srcData, DataObject destDat
474
474
return true ;
475
475
}
476
476
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
+ }
481
486
}
482
487
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
+ }
487
497
}
488
498
}
489
499
}
0 commit comments