apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
2.11k stars 1.11k forks source link

Zone wide storage pools hypervisor checks missing while retrieving statistics #3596

Closed nvazquez closed 4 years ago

nvazquez commented 5 years ago
ISSUE TYPE
COMPONENT NAME
Storage
CLOUDSTACK VERSION
4.11.2
CONFIGURATION

Zones with mixed hypervisors (Vmware + other hypervisor)

OS / ENVIRONMENT

Zones with mixed hypervisors (Vmware + other hypervisor)

SUMMARY

Periodically, the management server sends GetVolumeStatsCommand to hosts and appends the storage pools which the host needs to examine. However, the hypervisor type is not checked before sending the command.

STEPS TO REPRODUCE
- Create a zone with hosts of KVM (or non-Vmware hypervisor)
- Add Vmware datacenter
- Add zone-wide storage pool accessible from KVM
- Add zone-wide storage pool accessible from Vmware
- Check KVM logs for GetVolumeStatsCommand
EXPECTED RESULTS
No errors
ACTUAL RESULTS
KVM tries to access the Vmware accessible storage pool
DaanHoogland commented 5 years ago

the same stack trace is seen as with issue #3093 trying to reach unreachable local storage:

2019-09-12 11:24:20,543 WARN  [cloud.agent.Agent] (agentRequest-Handler-1:null) (logid:28787106) Caught:com.cloud.utils.exception.CloudRuntimeException: Could not fetch storage pool 36251de7-aa8a-3078-bfbc-38af7208ec6a from libvirt
        at com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager.getStoragePool(KVMStoragePoolManager.java:249)
        at com.cloud.hypervisor.kvm.storage.KVMStoragePoolManager.getStoragePool(KVMStoragePoolManager.java:235)
        at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtGetVolumeStatsCommandWrapper.getVolumeStat(LibvirtGetVolumeStatsCommandWrapper.java:62)
        at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtGetVolumeStatsCommandWrapper.execute(LibvirtGetVolumeStatsCommandWrapper.java:52)
        at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtGetVolumeStatsCommandWrapper.execute(LibvirtGetVolumeStatsCommandWrapper.java:40)
        at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtRequestWrapper.execute(LibvirtRequestWrapper.java:78)
        at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.executeRequest(LibvirtComputingResource.java:1450)
        at com.cloud.agent.Agent.processRequest(Agent.java:640)
        at com.cloud.agent.Agent$AgentRequestHandler.doTask(Agent.java:1053)
        at com.cloud.utils.nio.Task.call(Task.java:83)
        at com.cloud.utils.nio.Task.call(Task.java:29)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
DaanHoogland commented 4 years ago

the method

     public HashMap<String, VolumeStatsEntry> getVolumeStatistics(long clusterId, String poolUuid, StoragePoolType poolType, List<String> volumeLocators, int timeout) {

in UserVmManagerImpl is creating the command for the host and has a filter in case of storagePool.isManaged(). It also needs filters for the cases of storagePool.isLocal() and ScopeType.ZONE.equals(storagePool.getScope()). I will create a PR for the later in context of this ticket and see if the isLocal case can be cought in there as well.