mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CS-18564: create template from snapshot failed, due to the volume(the
snapshot created from) is deleted.
This commit is contained in:
parent
e52a4d9306
commit
9947e688c4
@ -444,7 +444,14 @@ public class NfsSecondaryStorageResource extends ServerResourceBase implements S
|
||||
File srcFile = getFile(srcData.getPath(), srcDataStore.getUrl());
|
||||
File destFile = getFile(destData.getPath(), destDataStore.getUrl());
|
||||
|
||||
ImageFormat srcFormat = srcData.getVolume().getFormat();
|
||||
VolumeObjectTO volumeObjectTO = srcData.getVolume();
|
||||
ImageFormat srcFormat = null;
|
||||
//TODO: the image format should be stored in snapshot table, instead of getting from volume
|
||||
if (volumeObjectTO != null) {
|
||||
srcFormat = volumeObjectTO.getFormat();
|
||||
} else {
|
||||
srcFormat = ImageFormat.QCOW2;
|
||||
}
|
||||
|
||||
// get snapshot file name
|
||||
String templateName = srcFile.getName();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user