Skip to content

Commit b35eb04

Browse files
committed
CLOUDSTACK-6017: NPE while creating snapshot multiple times on same Root
volume with S3 as secondary storage.
1 parent 9778481 commit b35eb04

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,10 @@ public void processEvent(ObjectInDataStoreStateMachine.Event event, Answer answe
286286
} else if (answer instanceof CopyCmdAnswer) {
287287
SnapshotObjectTO snapshotTO = (SnapshotObjectTO)((CopyCmdAnswer)answer).getNewData();
288288
snapshotStore.setInstallPath(snapshotTO.getPath());
289-
snapshotStore.setSize(snapshotTO.getPhysicalSize());
289+
if (snapshotTO.getPhysicalSize() != null) {
290+
// For S3 delta snapshot, physical size is currently not set
291+
snapshotStore.setSize(snapshotTO.getPhysicalSize());
292+
}
290293
if (snapshotTO.getParentSnapshotPath() == null) {
291294
snapshotStore.setParentSnapshotId(0L);
292295
}

0 commit comments

Comments
 (0)