incubator-cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Prasanna Santhanam (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CLOUDSTACK-643) KVM snapshots deleted on UI/API do not physically delete from secondary storage
Date Sat, 15 Dec 2012 00:22:13 GMT

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

Prasanna Santhanam commented on CLOUDSTACK-643:
-----------------------------------------------

Following is the cmd sent by KVM resource object:

2012-12-15 03:34:29,214 DEBUG [agent.transport.Request] (Job-Executor-43:job-111) Seq 11-276569926:
Sending  { Cmd , MgmtId: 345050870294, via: 11, Ver: v1, Flags: 100011, [{"DeleteSnapshotBackupCommand":{"all":false,"snapshotUuid":"/snapshots/3/7/31/any_ROOT-29_20121214210220","secondaryStorageUrl":"nfs://secstorage/export/home/storage/secondary","dcId":3,"accountId":7,"volumeId":31,"wait":0}}]
}
2012-12-15 03:34:29,277 DEBUG [agent.transport.Request] (AgentManager-Handler-8:null) Seq
11-276569926: Processing:  { Ans: , MgmtId: 345050870294, via: 11, Ver: v1, Flags: 10, [{"Answer":{"result":true,"details":"success","wait":0}}]
}

here snapshotUuid is the complete path as show unlike in XenServer where this is only the
uuid in its datastore.
                
> KVM snapshots deleted on UI/API do not physically delete from secondary storage
> -------------------------------------------------------------------------------
>
>                 Key: CLOUDSTACK-643
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-643
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the default.) 
>          Components: KVM, Snapshot
>    Affects Versions: 4.0.0, 4.1.0
>            Reporter: Prasanna Santhanam
>             Fix For: 4.0.1, 4.1.0
>
>
> Snapshots taken on KVM do not delete on secondary storage even after deleting them on
the API/UI. 
> The cmd.getSnapshotUuid() in case of KVM is the complete path to the qcow2 image on secondary
storage.  But the following concatenation evaluates to an invalid path and subsequent "rm
-f" fails quietly returning Answer(success) back to management server.
> ""
> String lPath = parent + "/snapshots/" + String.valueOf(accountId) + "/" + String.valueOf(volumeId)
+ "/" + filename;
> ""
> On NfsSecondaryStorageResource.java:
> protected Answer execute(final DeleteSnapshotBackupCommand cmd) {
>         String secondaryStorageUrl = cmd.getSecondaryStorageUrl();
>         Long accountId = cmd.getAccountId();
>         Long volumeId = cmd.getVolumeId();
>         String name = cmd.getSnapshotUuid();
>         try {
>             if (swift == null) {
>                 String parent = getRootDir(secondaryStorageUrl);
>                 String filename;
>                 if (cmd.isAll()) {
>                     filename = "*";
>                 } else {
>                     filename = "*" + name + "*";
>                 }
>                 String lPath = parent + "/snapshots/" + String.valueOf(accountId) + "/"
+ String.valueOf(volumeId) + "/" + filename;
>                 String result = deleteLocalFile(lPath);
>                 if (result != null) {
>                     String errMsg = "failed to delete snapshot " + lPath + " , err="
+ result;
>                     s_logger.warn(errMsg);
>                     return new Answer(cmd, false, errMsg);
>                 }
>             } else {
>                     #### SNIP ####
>              }
>             return new Answer(cmd, true, "success");
>         } catch (Exception e) {
>         }
>     }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message