Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ public void copyAsync(DataObject srcData, DataObject destData, Host destHost, As

private Answer copyTemplateToVolume(DataObject srcData, DataObject destData, Host destHost) {
// Copy PowerFlex/ScaleIO template to volume
LOGGER.debug("Initiating copy from PowerFlex template volume on host " + destHost != null ? destHost.getId() : "");
LOGGER.debug(String.format("Initiating copy from PowerFlex template volume on host %s", destHost != null ? destHost.getId() : "<not specified>"));
int primaryStorageDownloadWait = StorageManager.PRIMARY_STORAGE_DOWNLOAD_WAIT.value();
CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), primaryStorageDownloadWait, VirtualMachineManager.ExecuteInSequence.value());

Expand All @@ -648,7 +648,7 @@ private Answer copyTemplateToVolume(DataObject srcData, DataObject destData, Hos

private Answer copyVolume(DataObject srcData, DataObject destData, Host destHost) {
// Copy PowerFlex/ScaleIO volume
LOGGER.debug("Initiating copy from PowerFlex volume on host " + destHost != null ? destHost.getId() : "");
LOGGER.debug(String.format("Initiating copy from PowerFlex template volume on host %s", destHost != null ? destHost.getId() : "<not specified>"));
String value = configDao.getValue(Config.CopyVolumeWait.key());
int copyVolumeWait = NumbersUtil.parseInt(value, Integer.parseInt(Config.CopyVolumeWait.getDefaultValue()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2136,6 +2136,7 @@ public Host findUpAndEnabledHostWithAccessToStoragePools(List<Long> poolIds) {
if (hostIds.isEmpty()) {
return null;
}
Collections.shuffle(hostIds);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could add some log to this method, about which host was selected (or not).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's logging elsewhere, where the returned value is used.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

@yadvr yadvr Dec 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logging is not of the randomised list but the selected host is logged by the deployment planner or during provisioning or volume operation.


for (Long hostId : hostIds) {
Host host = _hostDao.findById(hostId);
Expand Down