slavkap opened a new pull request #4388: URL: https://github.com/apache/cloudstack/pull/4388
## Description If volume is migrated between storage pools and "volume.stats.interval" is set to more frequent interval for example 30 sec. NullPointerException is thrown, because the hypervisor is looking for volume on storage pool from which the volume was migrated. The statistics did not work right - before this fix only one cluster is lists if we have more clusters from the same type (eg. KVM), and only one host will return volume stats. Also all volumes are sent to that host, but they could be on another host. And the logic does not work correctly. Also the response was not working correctly for QCOW2 images, because it's looking for volume's UUID, but in the statistics CS keeps the path (because of the migrated volumes which UUIDs are changed). We have discussed the NPE with @Spaceman1984 in PR [https://github.com/apache/cloudstack/pull/3949](url) <!--- Describe your changes in detail --> With this change all clusters will be listed even those with the same type. Host will receive only the active volumes which are on it. And in the logs we will receive a proper information about the volumes ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [X ] Bug fix (non-breaking change which fixes an issue) - [ X] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) ## How Has This Been Tested? CS versions - 4.14 and master 2 clusters each having 2 hosts hypervisors KVM 2 NFS primary storages with scope Zone <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md) document --> ---------------------------------------------------------------- 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]
