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

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

Github user koushik-das commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1722#discussion_r91252165
  
    --- Diff: 
engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java
 ---
    @@ -260,11 +260,15 @@ public boolean deleteSnapshot(Long snapshotId) {
                 boolean result = deleteSnapshotChain(snapshotOnImage);
                 obj.processEvent(Snapshot.Event.OperationSucceeded);
                 if (result) {
    -                //snapshot is deleted on backup storage, need to delete it 
on primary storage
    -                SnapshotDataStoreVO snapshotOnPrimary = 
snapshotStoreDao.findBySnapshot(snapshotId, DataStoreRole.Primary);
    -                if (snapshotOnPrimary != null) {
    -                    snapshotOnPrimary.setState(State.Destroyed);
    -                    snapshotStoreDao.update(snapshotOnPrimary.getId(), 
snapshotOnPrimary);
    +                SnapshotInfo snapshotOnPrimary = 
snapshotDataFactory.getSnapshot(snapshotId, DataStoreRole.Primary);
    +                if(snapshotSvr.deleteSnapshot(snapshotOnPrimary)) {
    --- End diff --
    
    What happens if deleteSnapshot fails? Will it be retried again? If not 
should the DB be always cleaned up whether snapshot removal from primary is 
successful or not?


> Cleanup the snapshots on the primary storage of Xenserver after VM/Volume is 
> expunged
> -------------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-9558
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9558
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>          Components: Volumes
>    Affects Versions: 4.8.0
>         Environment: Xen Server
>            Reporter: subhash yedugundla
>             Fix For: 4.8.1
>
>
> Steps to reproduce the issue
> ===========================
> i) Deploy a new VM in CCP on Xenserver
> ii) Create a snapshot for the volume created in step i) from CCP. This step 
> will create a snapshot on the primary storage and keeps it on storage as we 
> use it as reference for the incremental snapshots
> iii) Now destroy and expunge the VM created in step i)
> You will notice that the volume for the VM ( created in step i) is deleted 
> from the primary storage. However the snapshot created on primary ( as part 
> of step ii)) still exists on the primary and this needs to be deleted 
> manually by the admin.
> Snapshot exists on the primary storage even after deleting the Volume.



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

Reply via email to