DaanHoogland commented on a change in pull request #4895:
URL: https://github.com/apache/cloudstack/pull/4895#discussion_r608454039



##########
File path: 
plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -4839,6 +4852,11 @@ private Answer migrateVolume(MigrateVolumeCommand cmd) {
         String path = cmd.getVolumePath();
 
         VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext());
+        VmwareHypervisorHost hyperHostInTargetCluster = null;
+        if (cmd.getHostGuidInTargetCluster() != null) {
+            hyperHostInTargetCluster = 
VmwareHelper.getHostMOFromHostName(getServiceContext(), 
cmd.getHostGuidInTargetCluster());
+        }
+        VmwareHypervisorHost targetDSHost = hyperHostInTargetCluster != null ? 
hyperHostInTargetCluster : hyperHost;

Review comment:
       something like 
   
   ```suggestion
           VmwareHypervisorHost targetDSHost = 
getTargetHostFromTargetCluster(cmd);
   ```
   
   and
   
   ```suggestion
       private VmwareHypervisorHost 
getTargetHostFromTargetCluster(MigrateVolumeCmd cmd) {
           VmwareHypervisorHost hyperHostInTargetCluster = null;
           if (cmd.getHostGuidInTargetCluster() != null) {
               hyperHostInTargetCluster = 
VmwareHelper.getHostMOFromHostName(getServiceContext(), 
cmd.getHostGuidInTargetCluster());
           }
           return hyperHostInTargetCluster != null ? hyperHostInTargetCluster : 
hyperHost;
       }
   ```




-- 
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.

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


Reply via email to