mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fix the simulator
Include the createTemplateFromSnapshot in the storageprocessor. Signed-off-by: Prasanna Santhanam <tsp@apache.org> (cherry picked from commit e8383121c60e7c815ba1990df1e8a440f7d87188)
This commit is contained in:
parent
0010faee4b
commit
2d5fde3dc1
@ -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…
x
Reference in New Issue
Block a user