sureshanaparti commented on a change in pull request #4934:
URL: https://github.com/apache/cloudstack/pull/4934#discussion_r615812914



##########
File path: 
engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/DataMotionServiceImpl.java
##########
@@ -110,6 +111,7 @@ public void copyAsync(Map<VolumeInfo, DataStore> volumeMap, 
VirtualMachineTO vmT
             List<String> volumeIds = new LinkedList<String>();
             for (final VolumeInfo volumeInfo : volumeMap.keySet()) {
                 volumeIds.add(volumeInfo.getUuid());
+                volumeInfo.processEvent(Event.OperationFailed);
             }
 
             throw new CloudRuntimeException("Can't find strategy to move data. 
" + "Source Host: " + srcHost.getName() + ", Destination Host: " + 
destHost.getName() +

Review comment:
       ```suggestion
               String errorMsg = "Can't find strategy to move data. " + "Source 
Host: " + srcHost.getName() + ", Destination Host: " + destHost.getName() + ", 
Volume UUIDs: " + StringUtils.join(volumeIds, ",")
               s_logger.error(errorMsg);
               CopyCommandResult result = new CopyCommandResult(null, null);
               result.setResult(errorMsg);
               callback.complete(result);
   ```
   
   @slavkap you can also define a private method, and  call in both 
_copyAsync()_ methods as here: 
https://github.com/apache/cloudstack/blob/671d2044c9b6188f5ea2f6e24ea7e8cae596cf63/engine/storage/datamotion/src/main/java/org/apache/cloudstack/storage/motion/StorageSystemDataMotionStrategy.java#L438
 




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