[
https://issues.apache.org/jira/browse/CLOUDSTACK-9734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15935120#comment-15935120
]
ASF GitHub Bot commented on CLOUDSTACK-9734:
--------------------------------------------
GitHub user SudharmaJain opened a pull request:
https://github.com/apache/cloudstack/pull/2013
Bug-ID: CLOUDSTACK-9734 Destroy VM Fails sometimes
This is a specific case when vm state gets updated by the vmsync before it
can be updated by the api-job-executor thread.
I could see following logs.
```
2015-10-28 02:03:21,590 DEBUG [jobs.impl.AsyncJobManagerImpl]
(API-Job-Executor-5:ctx-5fe7b795 job-3056226 ctx-49b11835) Sync job-3056236
execution on object VmWorkJobQueue.845336
2015-10-28 02:03:23,563 DEBUG [vm.dao.VMInstanceDaoImpl]
(API-Job-Executor-5:ctx-5fe7b795 job-3056226 ctx-49b11835) Unable to update
VM[User|i-3702-845336-VM]: DB Data={Host=null; State=Stopped; updated=6;
time=Wed Oct 28 02:03:23 PDT 2015} New Data: {Host=null; State=Destroyed;
updated=6; time=Wed Oct 28 02:03:23 PDT 2015} Stale Data: {Host=null;
State=Stopped; updated=5; time=Wed Oct 28 02:03:18 PDT 2015}
```
I don't see any other traces of sync job queued for the mentioned vm.
This is an extremely rare scenario and is not reproducible.
To fix the scenario, I have added 2 retries to trigger DestroyRequested
event for the VM.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/Accelerite/cloudstack cs-9734
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cloudstack/pull/2013.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 #2013
----
commit 4686f1e45bfc5ae079b54e3b4ebcb39f50124d9b
Author: Sudharma Jain <[email protected]>
Date: 2017-01-09T09:45:22Z
Bug-ID: CLOUDSTACK-9734 Destroy VM Fails sometimes
----
> Destroy VM Fails sometimes
> --------------------------
>
> Key: CLOUDSTACK-9734
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9734
> Project: CloudStack
> Issue Type: Bug
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Affects Versions: 4.8.0
> Reporter: sudharma jain
>
> Observed Error like below.
> 2015-10-28 02:03:23,563 DEBUG [vm.dao.VMInstanceDaoImpl]
> (API-Job-Executor-5:ctx-5fe7b795 job-3056226 ctx-49b11835) Unable to update
> VM[User|i-3702-845336-VM]: DB Data={Host=null; State=Stopped; updated=6;
> time=Wed Oct 28 02:03:23 PDT 2015} New Data: {Host=null; State=Destroyed;
> updated=6; time=Wed Oct 28 02:03:23 PDT 2015} Stale Data: {Host=null;
> State=Stopped; updated=5; time=Wed Oct 28 02:03:18 PDT 2015}
> 2015-10-28 02:03:23,563 DEBUG [cloud.vm.VirtualMachineManagerImpl]
> (API-Job-Executor-5:ctx-5fe7b795 job-3056226 ctx-49b11835) Unable to destroy
> the vm because it is not in the correct state: VM[User|i-3702-845336-VM]
> 2015-10-28 02:03:23,581 ERROR [cloud.api.ApiAsyncJobDispatcher]
> (API-Job-Executor-5:ctx-5fe7b795 job-3056226) Unexpected exception while
> executing org.apache.cloudstack.api.command.admin.vm.DestroyVMCmdByAdmin
> com.cloud.utils.exception.CloudRuntimeException: Unable to destroy
> VM[User|i-3702-845336-VM]
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)