Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

NPE when migrating VM in VMware and host not having 'config.product' property #10930

Copy link
Copy link
Open
@borisstoyanov

Description

@borisstoyanov
Issue body actions

When a migration is initiated from Cloudstack and for some reason the target host does not have the config.product property, an NPE is thrown in the logs failing the migration. Unfortunately we do not know the exact steps to get into such state, but surely we can address the NPE with some defensive coding

2025-05-28 11:10:13,452 INFO  [c.c.h.v.u.VmwareHelper] (DirectAgent-155:ctx-289ce694 s1f4r6u1.dcarsat.com.ar, job-477505/job-477506, cmd: MigrateCommand) (logid:fa9f0956) [ignored]failed to get message for exception: null
2025-05-28 11:10:13,452 ERROR [c.c.h.v.r.VmwareResource] (DirectAgent-155:ctx-289ce694 s1f4r6u1.dcarsat.com.ar, job-477505/job-477506, cmd: MigrateCommand) (logid:fa9f0956) MigrateCommand failed due to [Exception: java.lang.NullPointerException
Message: null
].
java.lang.NullPointerException
	at com.cloud.hypervisor.vmware.mo.HostMO.getHostType(HostMO.java:322)
	at com.cloud.hypervisor.vmware.manager.VmwareManagerImpl.getManagementPortGroupByHost(VmwareManagerImpl.java:624)
	at jdk.internal.reflect.GeneratedMethodAccessor140.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
	at com.sun.proxy.$Proxy424.getManagementPortGroupByHost(Unknown Source)
	at com.cloud.hypervisor.vmware.resource.VmwareResource.getTargetHyperHost(VmwareResource.java:5124)
	at com.cloud.hypervisor.vmware.resource.VmwareResource.execute(VmwareResource.java:4785)
	at com.cloud.hypervisor.vmware.resource.VmwareResource.executeRequest(VmwareResource.java:510)
	at com.cloud.agent.manager.DirectAgentAttache$Task.runInContext(DirectAgentAttache.java:315)
	at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:48)
	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:55)
	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:102)
	at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:52)
	at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:45)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
	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:829)
2025-05-28 11:10:13,452 DEBUG [c.c.a.m.DirectAgentAttache] (DirectAgent-155:ctx-289ce694) (logid:fa9f0956) Seq 217-6176405413961971181: Response Received: 

if ("VMware ESXi".equals(aboutInfo.getName()))

versions

VMware 8.0
ACS 4.18.2.3

The steps to reproduce the bug

NA

What to do about it?

This problem could be mitigated by:

  1. restarting
    /etc/init.d/hostd restart
    /etc/init.d/vpxa restart
  2. Out of bound migration directly in vCenter, while cloudstack would sync up a bit later.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.