Prachi Damle created CLOUDSTACK-1307: ----------------------------------------
Summary: Noticed NPE when we put host in maintenance mode in clustered management setup Key: CLOUDSTACK-1307 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-1307 Project: CloudStack Issue Type: Bug Security Level: Public (Anyone can view this level - this is the default.) Components: Management Server Reporter: Prachi Damle Assignee: Prachi Damle Fix For: 4.1.0 Noticed the Nullpointer exception when we put one of the host in maintenance mode Steps: 1.Configured cluster management setup with 4 management server and 4 hosts(make sure each host was managed by unique Ms ) 2.create few domain and user accounts 3 login with that account and deploy vms based on isolated and sharednetworks 4.once the all the vms are up and running 5.select one host and put in maintenance mode actual result; Putting the one of host into maintenance mode causes the java.lang.NullPointerException. 012-06-06 12:24:44,111 INFO [vmware.resource.VmwareResource] (DirectAgent-287:10.147.29.53) Executing resource MaintainCommand: {"wait":0} 2012-06-06 12:24:44,277 DEBUG [agent.manager.DirectAgentAttache] (DirectAgent-287:null) Seq 8-1880293401: Response Received: 2012-06-06 12:24:44,277 DEBUG [agent.transport.Request] (DirectAgent-287:null) Seq 8-1880293401: Processing: { Ans: , MgmtId: 7551760465939, via: 8, Ver: v1, Flags: 110, [{"MaintainAnswer":{"willMigrate":true,"result":true,"details":"Put host in maintaince","wait":0}}] } 2012-06-06 12:24:44,282 DEBUG [agent.transport.Request] (Job-Executor-2:job-40) Seq 8-1880293401: Received: { Ans: , MgmtId: 7551760465939, via: 8, Ver: v1, Flags: 110, { MaintainAnswer } } 2012-06-06 12:24:44,282 DEBUG [agent.manager.AgentManagerImpl] (Job-Executor-2:job-40) Details from executing class com.cloud.agent.api.MaintainCommand: Put host in maintaince 2012-06-06 12:24:44,283 DEBUG [agent.manager.AgentAttache] (DirectAgent-287:null) Seq 8-1880293401: No more commands found 2012-06-06 12:24:44,616 DEBUG [cloud.resource.ResourceState] (Job-Executor-2:job-40) Resource state update: [id = 8; name = 10.147.29.53; old state = Enabled; event = AdminAskMaintenace; new state = PrepareForMaintenance] 2012-06-06 12:24:44,703 DEBUG [agent.manager.DirectAgentAttache] (DirectAgent-104:null) Ping from 8 2012-06-06 12:24:44,751 DEBUG [agent.manager.AgentAttache] (Job-Executor-2:job-40) Seq 8-1880293377: Sending disconnect to class com.cloud.network.security.SecurityGroupListener 2012-06-06 12:24:45,576 DEBUG [agent.manager.DirectAgentAttache] (DirectAgent-481:null) Ping from 9 2012-06-06 12:24:45,844 DEBUG [agent.manager.DirectAgentAttache] (DirectAgent-32:null) Seq 3-412680218: Response Received: 2012-06-06 12:24:45,844 DEBUG [agent.transport.Request] (StatsCollector-2:null) Seq 3-412680218: Received: { Ans: , MgmtId: 7551760465939, via: 3, Ver: v1, Flags: 10, { GetHostStatsAnswer } } 2012-06-06 12:24:45,848 DEBUG [agent.manager.DirectAgentAttache] (DirectAgent-15:null) Seq 3-1803485203: Response Received: 2012-06-06 12:24:45,848 DEBUG [agent.manager.ClusteredAgentManagerImpl] (DirectAgent-15:null) Seq 3-1803485203: MgmtId 6835037798417: Resp: Routing to peer 2012-06-06 12:24:46,009 DEBUG [agent.manager.ClusteredAgentAttache] (StatsCollector-2:null) Seq 7-1926104508: Forwarding null to 7487134629906 2012-06-06 12:24:46,275 INFO [cloud.ha.HighAvailabilityManagerImpl] (HA-Worker-0:work-4) Processing HAWork[4-Migration-4-Running-Scheduled] 2012-06-06 12:24:46,279 INFO [cloud.ha.HighAvailabilityManagerImpl] (HA-Worker-4:work-5) Processing HAWork[5-Migration-6-Running-Scheduled] 2012-06-06 12:24:46,330 INFO [cloud.ha.HighAvailabilityManagerImpl] (HA-Worker-2:work-6) Processing HAWork[6-Migration-10-Running-Scheduled] 2012-06-06 12:24:46,356 INFO [cloud.ha.HighAvailabilityManagerImpl] (HA-Worker-1:work-7) Processing HAWork[7-Migration-13-Running-Scheduled] 2012-06-06 12:24:46,616 DEBUG [cloud.resource.ResourceManagerImpl] (Job-Executor-2:job-40) Sent resource event EVENT_PREPARE_MAINTENANCE_AFTER to listener CapacityManagerImpl$$EnhancerByCGLIB$$e9d6b2bf 2012-06-06 12:24:47,155 DEBUG [cloud.async.AsyncJobManagerImpl] (Job-Executor-2:job-40) Complete async job-40, jobStatus: 1, resultCode: 0, result: com.cloud.api.response.HostResponse@3133134e 2012-06-06 12:24:51,034 DEBUG [cloud.async.AsyncJobManagerImpl] (Job-Executor-2:job-40) Done executing com.cloud.api.commands.PrepareForMaintenanceCmd for job-40 2012-06-06 12:24:51,717 DEBUG [cloud.async.AsyncJobManagerImpl] (catalina-exec-12:null) Async job-40 completed 2012-06-06 12:24:53,110 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-1:work-7) DeploymentPlanner allocation algorithm: random 2012-06-06 12:24:53,110 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-4:work-5) DeploymentPlanner allocation algorithm: random 2012-06-06 12:24:54,408 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-4:work-5) Trying to allocate a host and storage pools from dc:1, pod:1,cluster:1, requested cpu: 500, requested ram: 134217728 2012-06-06 12:24:54,429 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-4:work-5) Is ROOT volume READY (pool already allocated)?: No 2012-06-06 12:24:54,409 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-1:work-7) Trying to allocate a host and storage pools from dc:1, pod:1,cluster:1, requested cpu: 500, requested ram: 134217728 2012-06-06 12:24:54,479 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-1:work-7) Is ROOT volume READY (pool already allocated)?: No 2012-06-06 12:24:54,438 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-0:work-4) DeploymentPlanner allocation al 2012-06-06 12:24:54,438 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-0:work-4) DeploymentPlanner allocation algorithm: random 2012-06-06 12:24:54,479 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-0:work-4) Trying to allocate a host and storage pools from dc:1, pod:1,cluster:1, requested cpu: 500, requested ram: 134217728 2012-06-06 12:24:54,479 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-0:work-4) Is ROOT volume READY (pool already allocated)?: No 2012-06-06 12:24:54,480 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-2:work-6) DeploymentPlanner allocation algorithm: random 2012-06-06 12:24:54,480 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-2:work-6) Trying to allocate a host and storage pools from dc:1, pod:1,cluster:1, requested cpu: 500, requested ram: 536870912 2012-06-06 12:24:54,480 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-2:work-6) Is ROOT volume READY (pool already allocated)?: No 2012-06-06 12:24:54,630 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-4:work-5) This VM has last host_id specified, trying to choose the same host: 8 2012-06-06 12:24:54,670 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-0:work-4) This VM has last host_id specified, trying to choose the same host: 8 2012-06-06 12:24:54,630 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-1:work-7) This VM has last host_id specified, trying to choose the same host: 8 2012-06-06 12:24:54,630 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-2:work-6) This VM has last host_id specified, trying to choose the same host: 8 2012-06-06 12:24:54,954 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-4:work-5) The last host of this VM is in avoid set 2012-06-06 12:24:54,982 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-1:work-7) The last host of this VM is in avoid set 2012-06-06 12:24:55,033 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-1:work-7) Cannot choose the last host to deploy this VM 2012-06-06 12:24:54,996 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-4:work-5) Cannot choose the last host to deploy this VM 2012-06-06 12:24:55,095 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-4:work-5) Searching resources only under specified Cluster: 1 2012-06-06 12:24:55,095 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-1:work-7) Searching resources only under specified Cluster: 1 2012-06-06 12:24:55,217 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-2:work-6) The last host of this VM is in avoid set 2012-06-06 12:24:55,255 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-2:work-6) Cannot choose the last host to deploy this VM 2012-06-06 12:24:55,299 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-2:work-6) Searching resources only under specified Cluster: 1 2012-06-06 12:24:55,345 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-0:work-4) The last host of this VM is in avoid set 2012-06-06 12:24:55,372 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-0:work-4) Cannot choose the last host to deploy this VM 2012-06-06 12:24:55,372 DEBUG [cloud.deploy.FirstFitPlanner] (HA-Worker-0:work-4) Searching resources only under specified Cluster: 1 2012-06-06 12:24:58,124 ERROR [cloud.ha.HighAvailabilityManagerImpl] (HA-Worker-0:work-4) Terminating HAWork[4-Migration-4-Running-Migrating] java.lang.NullPointerException at com.cloud.capacity.dao.CapacityDaoImpl.findCapacityBy(CapacityDaoImpl.java:260) at com.cloud.utils.db.DatabaseCallback.intercept(DatabaseCallback.java:30) at com.cloud.deploy.FirstFitPlanner.removeClustersCrossingThreshold(FirstFitPlanner.java:464) at com.cloud.deploy.FirstFitPlanner.checkClustersforDestination(FirstFitPlanner.java:500) at com.cloud.deploy.FirstFitPlanner.plan(FirstFitPlanner.java:238) at com.cloud.vm.VirtualMachineManagerImpl.migrateAway(VirtualMachineManagerImpl.java:1477) at com.cloud.ha.HighAvailabilityManagerImpl.migrate(HighAvailabilityManagerImpl.java:557) at com.cloud.ha.HighAvailabilityManagerImpl$WorkerThread.run(HighAvailabilityManagerImpl.java:828) 2012-06-06 12:24:58,124 ERROR [cloud.ha.HighAvailabilityManagerImpl] (HA-Worker-4:work-5) Terminating HAWork[5-Migration-6-Running-Migrating] java.lang.NullPointerException at com.cloud.capacity.dao.CapacityDaoImpl.findCapacityBy(CapacityDaoImpl.java:260) at com.cloud.utils.db.DatabaseCallback.intercept(DatabaseCallback.java:30) at com.cloud.deploy.FirstFitPlanner.removeClustersCrossingThreshold(FirstFitPlanner.java:464) at com.cloud.deploy.FirstFitPlanner.checkClustersforDestination(FirstFitPlanner.java:500) at com.cloud.deploy.FirstFitPlanner.plan(FirstFitPlanner.java:238) at com.cloud.vm.VirtualMachineManagerImpl.migrateAway(VirtualMachineManagerImpl.java:1477) at com.cloud.ha.HighAvailabilityManagerImpl.migrate(HighAvailabilityManagerImpl.java:557) at com.cloud.ha.HighAvailabilityManagerImpl$WorkerThread.run(HighAvailabilityManagerImpl.java:828) 2012-06-06 12:24:58,124 ERROR [cloud.ha.HighAvailabilityManagerImpl] (HA-Worker-1:work-7) Terminating HAWork[7-Migration-13-Running-Migrating] java.lang.NullPointerException at com.cloud.capacity.dao.CapacityDaoImpl.findCapacityBy(CapacityDaoImpl.java:278) at com.cloud.utils.db.DatabaseCallback.intercept(DatabaseCallback.java:30) at com.cloud.deploy.FirstFitPlanner.removeClustersCrossingThreshold(FirstFitPlanner.java:464) at com.cloud.deploy.FirstFitPlanner.checkClustersforDestination(FirstFitPlanner.java:500) at com.cloud.deploy.FirstFitPlanner.plan(FirstFitPlanner.java:238) at com.cloud.vm.VirtualMachineManagerImpl.migrateAway(VirtualMachineManagerImpl.java:1477) at com.cloud.ha.HighAvailabilityManagerImpl.migrate(HighAvailabilityManagerImpl.java:557) at com.cloud.ha.HighAvailabilityManagerImpl$WorkerThread.run(HighAvailabilityManagerImpl.java:828) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira