sureshanaparti commented on code in PR #6483:
URL: https://github.com/apache/cloudstack/pull/6483#discussion_r904657910


##########
plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VMwareGuru.java:
##########
@@ -1104,13 +1124,22 @@ public List<Command> finalizeMigrate(VirtualMachine vm, 
Map<Volume, StoragePool>
             if (pool.getClusterId() != null) {
                 poolClusterId = pool.getClusterId();
             }
+            if (volume.getVolumeType().equals(Volume.Type.ROOT) && 
pool.isLocal()) {
+                isLocalStorageMigration = true;

Review Comment:
   Better to get the host guid for local storage here, using the pool id (no 
need to pass the entire volume/pool map).
   
   `getHostGuidForLocalStorage(Long poolId)`



##########
plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VMwareGuru.java:
##########
@@ -1104,13 +1124,22 @@ public List<Command> finalizeMigrate(VirtualMachine vm, 
Map<Volume, StoragePool>
             if (pool.getClusterId() != null) {
                 poolClusterId = pool.getClusterId();
             }
+            if (volume.getVolumeType().equals(Volume.Type.ROOT) && 
pool.isLocal()) {
+                isLocalStorageMigration = true;
+            }
             volumeToFilerTo.add(new Pair<VolumeTO, StorageFilerTO>(volumeTo, 
filerTo));
         }
         final Long destClusterId = poolClusterId;
         final Long srcClusterId = 
vmManager.findClusterAndHostIdForVm(vm.getId()).first();
         final boolean isInterClusterMigration = 
isInterClusterMigration(destClusterId, srcClusterId);
+        String targetHostGuid = null;
+        if (isLocalStorageMigration) {

Review Comment:
   ```suggestion
           if (!isLocalStorageMigration || targetHostGuid == null) {
               targetHostGuid = 
getHostGuidInTargetCluster(isInterClusterMigration, destClusterId);
           }
   ```
   
   @harikrishna-patnala See if `targetHostGuid == null` cond valid there or not 
(as getHostGuidForLocalStorage() can return null in some cases).



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to