[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-8827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14743034#comment-14743034
 ] 

ASF GitHub Bot commented on CLOUDSTACK-8827:
--------------------------------------------

Github user karuturi commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/793#discussion_r39365314
  
    --- Diff: server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java ---
    @@ -1046,4 +1046,51 @@ private VmWorkJobVO createPlaceHolderWork(long 
instanceId) {
     
             return workJob;
         }
    +
    +    @Override
    +    public void cleanupVmSnapshotJobs(){
    +        List<AsyncJobVO> jobs = 
_jobMgr.findFailureAsyncJobs(VmWorkCreateVMSnapshot.class.getName(), 
VmWorkRevertToVMSnapshot.class.getName());
    +
    +        for (AsyncJobVO job : jobs) {
    +            try {
    +                if 
(job.getCmd().equalsIgnoreCase(VmWorkCreateVMSnapshot.class.getName())) {
    +                    VmWorkCreateVMSnapshot work = 
VmWorkSerializer.deserialize(VmWorkCreateVMSnapshot.class, job.getCmdInfo());
    +                    cleanupVmSnapshotCreateFailure(work.getVmSnapshotId());
    +                } else 
if(job.getCmd().equalsIgnoreCase(VmWorkRevertToVMSnapshot.class.getName())) {
    +                    VmWorkRevertToVMSnapshot work = 
VmWorkSerializer.deserialize(VmWorkRevertToVMSnapshot.class, job.getCmdInfo());
    +                    cleanupVmSnapshotRevertFailure(work.getVmSnapshotId());
    +                }
    +            } catch (Exception e) {
    --- End diff --
    
    what exception do you expect here? Is it the deserialization failure or any 
thing else? Can you catch specific exceptions?


> VM snapshot stuck in Creating state when management service is stopped
> ----------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-8827
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8827
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>            Reporter: Anshul Gangwar
>            Assignee: Anshul Gangwar
>             Fix For: 4.6.0
>
>
> If we stop cloudstack-managment service while a VM snapshot is in progress, 
> the snapshot will be stuck in "Creating" state forever, even after the 
> service is started.
> This will leave the snapshot in unusable state (we can't delete it or it 
> won't go into Error state etc).
> Repro steps:
> ==========
> Create an instance.
> Take a VM snapshot and stop the cloudstack-managment service while the 
> snapshot is in progress.
> Check the snapshot state in DB and it will be creating.
> Start the management service and check the snapshot state.
> It will be creating forever.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to