[jira] [Commented] (CLOUDSTACK-7404) Failed to start an instance when originating template has been deleted

2014-12-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14229659#comment-14229659
 ] 

ASF GitHub Bot commented on CLOUDSTACK-7404:


GitHub user llambiel opened a pull request:

https://github.com/apache/cloudstack/pull/49

CLOUDSTACK-7404: Failed to start an instance when originating template h...

CLOUDSTACK-7404: Failed to start an instance when originating template has 
been deleted

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/exoscale/cloudstack CLOUDSTACK-7404

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/cloudstack/pull/49.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #49


commit 0e7e7f893d685cdf90be9a7196f954c9b541bf75
Author: Loic Lambiel l...@exoscale.ch
Date:   2014-12-01T11:02:56Z

CLOUDSTACK-7404: Failed to start an instance when originating template has 
been deleted




 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
 Fix For: 4.3.1


 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 
 

[jira] [Commented] (CLOUDSTACK-7404) Failed to start an instance when originating template has been deleted

2014-12-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14229690#comment-14229690
 ] 

ASF GitHub Bot commented on CLOUDSTACK-7404:


Github user bhaisaab commented on the pull request:

https://github.com/apache/cloudstack/pull/49#issuecomment-65053557
  
+1

As soon as travis passes, I'll help merge it. Thanks for sending the PR.


 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
 Fix For: 4.3.1


 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)
  

[jira] [Commented] (CLOUDSTACK-7404) Failed to start an instance when originating template has been deleted

2014-12-01 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14229706#comment-14229706
 ] 

ASF subversion and git services commented on CLOUDSTACK-7404:
-

Commit 34e8483e802d5467f6d5f52e8116ee26fe100f6f in cloudstack's branch 
refs/heads/master from [~llambiel]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=34e8483 ]

CLOUDSTACK-7404: Failed to start an instance when originating template has been 
deleted

Signed-off-by: Sebastien Goasguen run...@gmail.com
(cherry picked from commit c1bf7eb3bd4dad384225d411e21859cce470)


 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
 Fix For: 4.3.1


 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 
 

[jira] [Commented] (CLOUDSTACK-7404) Failed to start an instance when originating template has been deleted

2014-12-01 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14229707#comment-14229707
 ] 

ASF subversion and git services commented on CLOUDSTACK-7404:
-

Commit 99cb19787e55e2a80f2683291abc53fabb13f5c7 in cloudstack's branch 
refs/heads/4.5 from [~llambiel]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=99cb197 ]

CLOUDSTACK-7404: Failed to start an instance when originating template has been 
deleted

Signed-off-by: Sebastien Goasguen run...@gmail.com
(cherry picked from commit c1bf7eb3bd4dad384225d411e21859cce470)


 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
 Fix For: 4.3.1


 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 
 

[jira] [Commented] (CLOUDSTACK-7404) Failed to start an instance when originating template has been deleted

2014-12-01 Thread Wei Zhou (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14229710#comment-14229710
 ] 

Wei Zhou commented on CLOUDSTACK-7404:
--

cherry-pick to 4.5 and master

 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
 Fix For: 4.3.1


 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 

[jira] [Commented] (CLOUDSTACK-7404) Failed to start an instance when originating template has been deleted

2014-12-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14229726#comment-14229726
 ] 

ASF GitHub Bot commented on CLOUDSTACK-7404:


Github user bhaisaab commented on the pull request:

https://github.com/apache/cloudstack/pull/49#issuecomment-65058250
  
Hi, I just saw Wei checked in the fix from 4.3/4.4 on master. I've applied 
the same on 4.5 branch so we don't lose your commit. Since, it's already in all 
4.3+ branches, please close this PR.


 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
 Fix For: 4.3.1


 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 
 

[jira] [Commented] (CLOUDSTACK-7404) Failed to start an instance when originating template has been deleted

2014-12-01 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14229802#comment-14229802
 ] 

ASF GitHub Bot commented on CLOUDSTACK-7404:


Github user llambiel closed the pull request at:

https://github.com/apache/cloudstack/pull/49


 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
 Fix For: 4.3.1


 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 
 

[jira] [Commented] (CLOUDSTACK-7404) Failed to start an instance when originating template has been deleted

2014-09-05 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14123046#comment-14123046
 ] 

ASF subversion and git services commented on CLOUDSTACK-7404:
-

Commit c1bf7eb3bd4dad384225d411e21859cce470 in cloudstack's branch 
refs/heads/4.3 from [~llambiel]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=c1bf7ee ]

CLOUDSTACK-7404: Failed to start an instance when originating template has been 
deleted

Signed-off-by: Sebastien Goasguen run...@gmail.com


 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 
 

[jira] [Commented] (CLOUDSTACK-7404) Failed to start an instance when originating template has been deleted

2014-09-05 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14123175#comment-14123175
 ] 

ASF subversion and git services commented on CLOUDSTACK-7404:
-

Commit 6c39c57342df9d0ebb6b1c5524f5c337a270b285 in cloudstack's branch 
refs/heads/4.4 from [~llambiel]
[ https://git-wip-us.apache.org/repos/asf?p=cloudstack.git;h=6c39c57 ]

CLOUDSTACK-7404: Failed to start an instance when originating template has been 
deleted

Signed-off-by: Sebastien Goasguen run...@gmail.com
(cherry picked from commit c1bf7eb3bd4dad384225d411e21859cce470)


 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
 Fix For: 4.3.1


 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 
 

[jira] [Commented] (CLOUDSTACK-7404) Failed to start an instance when originating template has been deleted

2014-08-26 Thread Chiradeep Vittal (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=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 

[jira] [Commented] (CLOUDSTACK-7404) Failed to start an instance when originating template has been deleted

2014-08-22 Thread Loic Lambiel (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14106773#comment-14106773
 ] 

Loic Lambiel commented on CLOUDSTACK-7404:
--

Temporary workaround to start the VM is to set to null the removed value for 
the template in vm_template table

 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 
 

[jira] [Commented] (CLOUDSTACK-7404) Failed to start an instance when originating template has been deleted

2014-08-22 Thread Loic Lambiel (JIRA)

[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-7404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14106781#comment-14106781
 ] 

Loic Lambiel commented on CLOUDSTACK-7404:
--

also different stack trace but same root cause:

2014-08-22 08:12:44,654 ERROR [cloud.api.ApiAsyncJobDispatcher] 
(Job-Executor-27:ctx-ed629e58) Unexpected exception while executing 
org.apache.cloudstack.api.command.user.vm.StartVMCmd
java.lang.NullPointerException
at 
com.cloud.agent.manager.allocator.impl.FirstFitAllocator.allocateTo(FirstFitAllocator.java:135)
at 
com.cloud.agent.manager.allocator.impl.FirstFitAllocator.allocateTo(FirstFitAllocator.java:111)
at 
com.cloud.agent.manager.allocator.impl.FirstFitRoutingAllocator.allocateTo(FirstFitRoutingAllocator.java:44)
at 
com.cloud.deploy.DeploymentPlanningManagerImpl.findSuitableHosts(DeploymentPlanningManagerImpl.java:1126)
at 
com.cloud.deploy.DeploymentPlanningManagerImpl.checkClustersforDestination(DeploymentPlanningManagerImpl.java:892)
at 
com.cloud.deploy.DeploymentPlanningManagerImpl.planDeployment(DeploymentPlanningManagerImpl.java:442)
at 
org.apache.cloudstack.engine.cloud.entity.api.VMEntityManagerImpl.reserveVirtualMachine(VMEntityManagerImpl.java:188)
at 
org.apache.cloudstack.engine.cloud.entity.api.VirtualMachineEntityImpl.reserve(VirtualMachineEntityImpl.java:196)
at 
com.cloud.vm.UserVmManagerImpl.startVirtualMachine(UserVmManagerImpl.java:3580)
at 
com.cloud.vm.UserVmManagerImpl.startVirtualMachine(UserVmManagerImpl.java:2043)
at sun.reflect.GeneratedMethodAccessor561.invoke(Unknown Source)
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)

 Failed to start an instance when originating template has been deleted
 --

 Key: CLOUDSTACK-7404
 URL: