You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/12/28 14:52:48 UTC

[GitHub] [cloudstack] GabrielBrascher commented on a change in pull request #5789: Randomize managed volume copy host

GabrielBrascher commented on a change in pull request #5789:
URL: https://github.com/apache/cloudstack/pull/5789#discussion_r775944212



##########
File path: server/src/main/java/com/cloud/storage/StorageManagerImpl.java
##########
@@ -2136,6 +2136,7 @@ public Host findUpAndEnabledHostWithAccessToStoragePools(List<Long> poolIds) {
         if (hostIds.isEmpty()) {
             return null;
         }
+        Collections.shuffle(hostIds);

Review comment:
       I might be wrong on this one, but I think that there are not many logs regarding the chosen host to migrate.
   Call hierarchy that I've taken a quick check does not present logs. Assuming your comment, this would be logged later on in the call hierarchy ( I haven't checked all the way). Even if it is, you can see that many exceptions can be thrown not too late after the host ID is retrieved.
   ```
   > StorageManagerImpl.findUpAndEnabledHostWithAccessToStoragePools(List<Long>)  (com.cloud.storage)
       > VolumeServiceImpl.copyManagedVolume(VolumeInfo, DataStore)  (org.apache.cloudstack.storage.volume)
           > VolumeServiceImpl.copyVolume(VolumeInfo, DataStore)  (org.apache.cloudstack.storage.volume)
               > VolumeOrchestrator.copyVolumeFromSecToPrimary(VolumeInfo, VirtualMachine, VirtualMachineTemplate, DataCenter, Pod, Long, ServiceOffering, ...)  (org.apache.cloudstack.engine.orchestration)
               ...
               > VolumeOrchestrator.migrateVolume(Volume, StoragePool)  (org.apache.cloudstack.engine.orchestration)
               ...
               > VolumeApiServiceImpl.orchestrateExtractVolume(long, long)  (com.cloud.storage)
               ...
   ```
   
   Additionally, the `canHostAccessStoragePools` called inside the `findUpAndEnabledHostWithAccessToStoragePools` can return false. If the host cannot access, not much is logged as well.
   
   Please, let us know in case we are missing something here.




-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org