Skip to content

KVM: probable problem with storage stats when storage is put on maintenance #5775

@slavkap

Description

@slavkap
ISSUE TYPE
  • Bug Report
COMPONENT NAME
Primary storage - excluding Ceph/non managed NFS
CLOUDSTACK VERSION
main and older versions
CONFIGURATION
OS / ENVIRONMENT

OS - CentOS7
hypervisor - KVM
mgmt/agent version - 4.16.0.0

SUMMARY

When you put the primary storage on Maintenance mode and restart the agent, the storage will be removed from the storage adaptor's map. This causes NullPointerException when collecting the storage statistics. The problem is probably for all storage pools which don't use LibvirtStorageAdaptor - e.g. Linstor, StorPool maybe, and SolidFire.
This does not affect Ceph and non managed NFS, also and PowerFlex (PowerFlex does not call the agents to get the storage statistics)

STEPS TO REPRODUCE
set storage.stats.interval on short interval
enable storage maintenance mode
restart the agents
EXPECTED RESULTS
collect or don't the storage stats on pools on Maintenance mode
ACTUAL RESULTS
2021-12-15 08:31:03,586 DEBUG [cloud.agent.Agent] (agentRequest-Handler-3:null) (logid:552801e3) Processing command: com.cloud.agent.api.GetStorageStatsCommand
2021-12-15 08:31:03,586 WARN  [cloud.agent.Agent] (agentRequest-Handler-3:null) (logid:552801e3) Caught: 
java.lang.NullPointerException
        at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtGetStorageStatsCommandWrapper.execute(LibvirtGetStorageStatsCommandWrapper.java:40)
        at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtGetStorageStatsCommandWrapper.execute(LibvirtGetStorageStatsCommandWrapper.java:32)
        at com.cloud.hypervisor.kvm.resource.wrapper.LibvirtRequestWrapper.execute(LibvirtRequestWrapper.java:78)
        at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.executeRequest(LibvirtComputingResource.java:1768)
        at com.cloud.agent.Agent.processRequest(Agent.java:661)
        at com.cloud.agent.Agent$AgentRequestHandler.doTask(Agent.java:1079)
        at com.cloud.utils.nio.Task.call(Task.java:83)
        at com.cloud.utils.nio.Task.call(Task.java:29)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)
2021-12-15 08:31:03,588 DEBUG [cloud.agent.Agent] (agentRequest-Handler-3:null) (logid:552801e3) Seq 60-4602115869219225621:  { Ans: , MgmtId: 2199191159196, via: 60, Ver: v1, Flags: 10, [{"com.cloud.agent.api.Answer":{"result":"false","details":"java.lang.NullPointerException

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions