borisstoyanov opened a new issue, #10930:
URL: https://github.com/apache/cloudstack/issues/10930

   ### problem
   
   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: 
   ```
   
https://github.com/apache/cloudstack/blob/be191f5ad79a77a54d5325307c6047fc352c275e/vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/HostMO.java#L322
   
   
   ### 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. 


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to