Skip to content

Cannot start cloudstack-agent if there is vm not managed by cloudstack on the host #8040

@weizhouapache

Description

@weizhouapache

the agent.log shows

2023-10-03 12:18:23,692 ERROR [cloud.agent.AgentShell] (main:null) (logid:) Unable to start agent:
javax.naming.ConfigurationException: Error while creating Agent with class [com.cloud.hypervisor.kvm.resource.LibvirtComputingResource]. [Root exception is java.lang.NumberFormatException: null]
    at com.cloud.agent.AgentShell.launchAgentFromClassInfo(AgentShell.java:434)
    at com.cloud.agent.AgentShell.launchAgent(AgentShell.java:415)
    at com.cloud.agent.AgentShell.start(AgentShell.java:511)
    at com.cloud.agent.AgentShell.main(AgentShell.java:541)
Caused by: java.lang.NumberFormatException: null
    at java.base/java.lang.Integer.parseInt(Integer.java:614)
    at java.base/java.lang.Integer.parseInt(Integer.java:770)
    at com.cloud.hypervisor.kvm.resource.LibvirtDomainXMLParser.parseDomainXML(LibvirtDomainXMLParser.java:311)
    at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.setupMemoryBalloonStatsPeriod(LibvirtComputingResource.java:1301)
    at com.cloud.hypervisor.kvm.resource.LibvirtComputingResource.configure(LibvirtComputingResource.java:1244)
    at com.cloud.agent.Agent.<init>(Agent.java:190)
    at com.cloud.agent.AgentShell.launchNewAgent(AgentShell.java:452)
    at com.cloud.agent.AgentShell.launchAgentFromClassInfo(AgentShell.java:431)
    … 3 more

the issue is because there are 2 vms which are not created by cloudstack on the host. The xml of the vm does not have rate period and bytes in the rng secion. It should be

<rng model='virtio'>
<rate period='5000' bytes='4096' />
<backend model='random'>/dev/random</backend>
</rng>

Stopping the vms and edit the xml definition of vms should fix the issue.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

CLOUDSTACK VERSION

CONFIGURATION
OS / ENVIRONMENT
SUMMARY
STEPS TO REPRODUCE

EXPECTED RESULTS

ACTUAL RESULTS

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions