Valery Ciareszka created CLOUDSTACK-4349: --------------------------------------------
Summary: vm hangs in expunged state when static nat is enabled Key: CLOUDSTACK-4349 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-4349 Project: CloudStack Issue Type: Bug Security Level: Public (Anyone can view this level - this is the default.) Components: Management Server Affects Versions: 4.1.0, 4.1.1 Environment: CS 4.1.1 advanced mode CentOS 6.4 64-bit / KVM Reporter: Valery Ciareszka Priority: Minor vm hangs in expunged state when static nat is enabled raising java.lang.NullPointerException in management server logs. steps to reproduce bug: 1. create VM 2. go to the network for this vm, acquire ip and make static nat mapping to this VM 3. create permissive firewall rules for this ip (net 0.0.0.0/0 , ports 1-65535 / icmptypes -1 for tcp/udp/icmp) 4. try to destroy VM some logs: 2013-08-15 09:32:53,417 DEBUG [cloud.capacity.CapacityManagerImpl] (UserVm-Scavenger-1:null) VM state transitted from :Expunging to Expunging with event: ExpungeOperationvm's original host id: 12 new host id: null host id before state transition: null 2013-08-15 09:32:53,417 DEBUG [cloud.vm.VirtualMachineManagerImpl] (UserVm-Scavenger-1:null) Destroying vm VM[User|test411-3-expunge] 2013-08-15 09:32:53,417 DEBUG [cloud.vm.VirtualMachineManagerImpl] (UserVm-Scavenger-1:null) Cleaning up NICS 2013-08-15 09:32:53,417 DEBUG [cloud.network.NetworkManagerImpl] (UserVm-Scavenger-1:null) Cleaning network for vm: 6307 2013-08-15 09:32:53,418 DEBUG [cloud.storage.StorageManagerImpl] (UserVm-Scavenger-1:null) Cleaning storage for vm: 6307 2013-08-15 09:32:53,420 DEBUG [cloud.vm.VirtualMachineManagerImpl] (UserVm-Scavenger-1:null) Expunged VM[User|test411-3-expunge] 2013-08-15 09:32:53,420 DEBUG [cloud.vm.UserVmManagerImpl] (UserVm-Scavenger-1:null) Starting cleaning up vm VM[User|test411-3-expunge] resources... 2013-08-15 09:32:53,427 DEBUG [network.firewall.FirewallManagerImpl] (UserVm-Scavenger-1:null) No firewall rules are found for vm id=6307 2013-08-15 09:32:53,427 DEBUG [cloud.vm.UserVmManagerImpl] (UserVm-Scavenger-1:null) Firewall rules are removed successfully as a part of vm id=6307 expunge 2013-08-15 09:32:53,431 DEBUG [network.rules.RulesManagerImpl] (UserVm-Scavenger-1:null) No port forwarding rules are found for vm id=6307 2013-08-15 09:32:53,431 DEBUG [cloud.vm.UserVmManagerImpl] (UserVm-Scavenger-1:null) Port forwarding rules are removed successfully as a part of vm id=6307 expunge 2013-08-15 09:32:53,432 DEBUG [cloud.vm.UserVmManagerImpl] (UserVm-Scavenger-1:null) Removed vm id=6307 from all load balancers as a part of expunge process 2013-08-15 09:32:53,433 DEBUG [agent.manager.AgentManagerImpl] (AgentManager-Handler-9:null) SeqA 46-808: Sending Seq 46-808: { Ans: , MgmtId: 161603152803976, via: 46, Ver: v1, Flags: 100010, [{"AgentControlAnswer":{"result":true,"wait":0}}] } 2013-08-15 09:32:53,435 DEBUG [network.rules.RulesManagerImpl] (UserVm-Scavenger-1:null) Revoking all Firewallrules as a part of disabling static nat for public IP id=1217 2013-08-15 09:32:53,437 DEBUG [network.firewall.FirewallManagerImpl] (UserVm-Scavenger-1:null) Releasing 3 firewall rules for ip id=1217 2013-08-15 09:32:53,438 WARN [cloud.vm.UserVmManagerImpl] (UserVm-Scavenger-1:null) Unable to expunge VM[User|test411-3-expunge] java.lang.NullPointerException at com.cloud.event.ActionEventUtils.getDomainId(ActionEventUtils.java:186) at com.cloud.event.ActionEventUtils.persistActionEvent(ActionEventUtils.java:142) at com.cloud.event.ActionEventUtils.onStartedActionEvent(ActionEventUtils.java:104) at com.cloud.event.ActionEventInterceptor.interceptStart(ActionEventInterceptor.java:47) at com.cloud.utils.component.ComponentInstantiationPostProcessor$InterceptorDispatcher.intercept(ComponentInstantiationPostProcessor.java:119) at com.cloud.network.firewall.FirewallManagerImpl.revokeFirewallRulesForIp(FirewallManagerImpl.java:734) at com.cloud.network.rules.RulesManagerImpl.disableStaticNat(RulesManagerImpl.java:1194) at com.cloud.vm.UserVmManagerImpl.cleanupVmResources(UserVmManagerImpl.java:1856) at com.cloud.vm.UserVmManagerImpl.expunge(UserVmManagerImpl.java:1787) at com.cloud.vm.UserVmManagerImpl$ExpungeTask.run(UserVmManagerImpl.java:2416) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:165) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:267) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:679) -- 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