mirror of https://github.com/apache/cloudstack.git
Fix the simulator
Include the createTemplateFromSnapshot in the storageprocessor. Signed-off-by: Prasanna Santhanam <tsp@apache.org>
This commit is contained in:
parent
4c81ea69c4
commit
0b90fa369e
|
|
@ -93,6 +93,27 @@ public class SimulatorStorageProcessor implements StorageProcessor {
|
|||
return new CopyCmdAnswer(template);
|
||||
}
|
||||
|
||||
@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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue