cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [2/2] git commit: updated refs/heads/4.2 to c6d9919
Date Thu, 25 Jul 2013 08:45:14 GMT
Fix the simulator

Include the createTemplateFromSnapshot in the storageprocessor.

Signed-off-by: Prasanna Santhanam <tsp@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/0b90fa36
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/0b90fa36
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/0b90fa36

Branch: refs/heads/4.2
Commit: 0b90fa369ead814994ac5ebee2b1feba2a2571d7
Parents: 4c81ea6
Author: Prasanna Santhanam <tsp@apache.org>
Authored: Thu Jul 25 12:08:55 2013 +0530
Committer: Prasanna Santhanam <tsp@apache.org>
Committed: Thu Jul 25 14:15:03 2013 +0530

----------------------------------------------------------------------
 .../resource/SimulatorStorageProcessor.java     | 21 ++++++++++++++++++++
 1 file changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0b90fa36/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorStorageProcessor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorStorageProcessor.java
b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorStorageProcessor.java
index d2be9cf..0131c1d 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorStorageProcessor.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorStorageProcessor.java
@@ -94,6 +94,27 @@ public class SimulatorStorageProcessor implements StorageProcessor {
     }
 
     @Override
+    public Answer createTemplateFromSnapshot(CopyCommand cmd) {
+        TemplateObjectTO template = (TemplateObjectTO)cmd.getDestTO();
+        DataStoreTO imageStore = template.getDataStore();
+        String details;
+
+        try {
+            if (!(imageStore instanceof  NfsTO)) {
+                return new CopyCmdAnswer("Only support create template from snapshot, when
the dest store is nfs");
+            }
+
+            template.setPath(template.getName());
+            template.setFormat(Storage.ImageFormat.RAW);
+
+            return new CopyCmdAnswer(template);
+        } catch (Throwable e) {
+            details = "CreatePrivateTemplateFromSnapshotCommand exception: " + e.toString();
+            return new CopyCmdAnswer(details);
+        }
+    }
+
+    @Override
     public Answer backupSnapshot(CopyCommand cmd) {
         DataTO srcData = cmd.getSrcTO();
         DataTO destData = cmd.getDestTO();


Mime
View raw message