[ https://issues.apache.org/jira/browse/CLOUDSTACK-7404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14111656#comment-14111656 ]
Chiradeep Vittal commented on CLOUDSTACK-7404: ---------------------------------------------- You might want to change VirtualMachineTemplate template = _entityMgr.findById(VirtualMachineTemplate.class, vm.getTemplateId()); to VirtualMachineTemplate template = _entityMgr.findByIdIncludingRemoved(VirtualMachineTemplate.class, vm.getTemplateId()); in orchestrateStart > Failed to start an instance when originating template has been deleted > ---------------------------------------------------------------------- > > Key: CLOUDSTACK-7404 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-7404 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: KVM, Management Server > Affects Versions: 4.3.0 > Environment: Ubuntu 12.04, KVM, basic networking, Cloudstack 4.3.0 > Reporter: Loic Lambiel > > Hi, > I have an issue were I cannot start an instance that was previously stopped > when it's originating template has been deleted. > Steps to reproduce: > Deploy an instance > Stop the instance > Delete it's originating template > Wait a few minutes > Start the instance > This was working ok on CS 4.0.x > Management server log: > 2014-08-22 14:01:51,163 DEBUG [cloud.capacity.CapacityManagerImpl] > (Job-Executor-87:ctx-17783fe6 ctx-7479eb99) VM state transitted from :Stopped > to Starting with event: StartReques > tedvm's original host id: 48 new host id: null host id before state > transition: null > 2014-08-22 14:01:51,164 DEBUG [cloud.vm.VirtualMachineManagerImpl] > (Job-Executor-87:ctx-17783fe6 ctx-7479eb99) Successfully transitioned to > start state for VM[User|VM-69b4c242-fcd1 > -47ec-9afa-a798c370da5d] reservation id = 7bc0e976-6ba3-4b58-aa59-1eb011c1de4e > 2014-08-22 14:01:51,167 DEBUG [cloud.vm.VirtualMachineManagerImpl] > (Job-Executor-87:ctx-17783fe6 ctx-7479eb99) Trying to deploy VM, vm has dcId: > 1 and podId: 1 > 2014-08-22 14:01:51,168 DEBUG [cloud.vm.VirtualMachineManagerImpl] > (Job-Executor-87:ctx-17783fe6 ctx-7479eb99) advanceStart: DeploymentPlan is > provided, using dcId:1, podId: 1, clu > sterId: 1, hostId: 48, poolId: null > 2014-08-22 14:01:51,168 DEBUG [cloud.vm.VirtualMachineManagerImpl] > (Job-Executor-87:ctx-17783fe6 ctx-7479eb99) Deploy avoids pods: null, > clusters: null, hosts: null > 2014-08-22 14:01:51,177 DEBUG [cloud.capacity.CapacityManagerImpl] > (Job-Executor-87:ctx-17783fe6 ctx-7479eb99) VM state transitted from > :Starting to Stopped with event: OperationFa > iledvm's original host id: 48 new host id: null host id before state > transition: null > 2014-08-22 14:01:51,188 DEBUG [cloud.capacity.CapacityManagerImpl] > (Job-Executor-87:ctx-17783fe6 ctx-7479eb99) VM state transitted from :Stopped > to Starting with event: StartReques > tedvm's original host id: 48 new host id: null host id before state > transition: null > 2014-08-22 14:01:51,189 DEBUG [cloud.vm.VirtualMachineManagerImpl] > (Job-Executor-87:ctx-17783fe6 ctx-7479eb99) Successfully transitioned to > start state for VM[User|VM-69b4c242-fcd1 > -47ec-9afa-a798c370da5d] reservation id = 342cb1d2-fc32-4cdf-94c6-049cf16d5509 > 2014-08-22 14:01:51,191 DEBUG [cloud.vm.VirtualMachineManagerImpl] > (Job-Executor-87:ctx-17783fe6 ctx-7479eb99) Trying to deploy VM, vm has dcId: > 1 and podId: 1 > 2014-08-22 14:01:51,192 DEBUG [cloud.vm.VirtualMachineManagerImpl] > (Job-Executor-87:ctx-17783fe6 ctx-7479eb99) Deploy avoids pods: null, > clusters: null, hosts: null > 2014-08-22 14:01:51,198 DEBUG [cloud.capacity.CapacityManagerImpl] > (Job-Executor-87:ctx-17783fe6 ctx-7479eb99) VM state transitted from > :Starting to Stopped with event: OperationFa > iledvm's original host id: 48 new host id: null host id before state > transition: null > 2014-08-22 14:01:51,210 ERROR [cloud.api.ApiAsyncJobDispatcher] > (Job-Executor-87:ctx-17783fe6) Unexpected exception while executing > org.apache.cloudstack.api.command.user.vm.StartVMCmd > java.lang.NullPointerException > at > com.cloud.vm.VirtualMachineManagerImpl.orchestrateStart(VirtualMachineManagerImpl.java:858) > at > com.cloud.vm.VirtualMachineManagerImpl.advanceStart(VirtualMachineManagerImpl.java:761) > at > com.cloud.vm.VirtualMachineManagerImpl.start(VirtualMachineManagerImpl.java:601) > at > org.apache.cloudstack.engine.cloud.entity.api.VMEntityManagerImpl.deployVirtualMachine(VMEntityManagerImpl.java:237) > at > org.apache.cloudstack.engine.cloud.entity.api.VirtualMachineEntityImpl.deploy(VirtualMachineEntityImpl.java:207) > at > com.cloud.vm.UserVmManagerImpl.startVirtualMachine(UserVmManagerImpl.java:3581) > at > com.cloud.vm.UserVmManagerImpl.startVirtualMachine(UserVmManagerImpl.java:2043) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:606) > at > org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) > at > org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) > at > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) > at > com.cloud.event.ActionEventInterceptor.invoke(ActionEventInterceptor.java:50) > at > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) > at > org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91) > at > org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) > at > org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) > at com.sun.proxy.$Proxy169.startVirtualMachine(Unknown Source) > at > org.apache.cloudstack.api.command.user.vm.StartVMCmd.execute(StartVMCmd.java:121) > at com.cloud.api.ApiDispatcher.dispatch(ApiDispatcher.java:161) > at > com.cloud.api.ApiAsyncJobDispatcher.runJobInContext(ApiAsyncJobDispatcher.java:109) > at > com.cloud.api.ApiAsyncJobDispatcher$1.run(ApiAsyncJobDispatcher.java:66) > at > org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56) > at > org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103) > at > org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53) > at > com.cloud.api.ApiAsyncJobDispatcher.runJob(ApiAsyncJobDispatcher.java:63) > at > org.apache.cloudstack.framework.jobs.impl.AsyncJobManagerImpl$5.runInContext(AsyncJobManagerImpl.java:509) > at > org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49) > at > org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56) > at > org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103) > at > org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53) > at > org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46) > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) > at java.util.concurrent.FutureTask.run(FutureTask.java:262) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) > at java.lang.Thread.run(Thread.java:744) > 2014-08-22 14:01:51,218 INFO [jobs.impl.AsyncJobMonitor] > (Job-Executor-87:ctx-17783fe6) Remove job-2283 from job monitoring -- This message was sent by Atlassian JIRA (v6.2#6252)