diff --git a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java index 40881cfaa89..3b9397782f5 100644 --- a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java +++ b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java @@ -313,7 +313,10 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati } private Optional getPreferredStoragePool(List poolList, VirtualMachine vm) { - String accountStoragePoolUuid = StorageManager.PreferredStoragePool.valueIn(vm.getAccountId()); + String accountStoragePoolUuid = null; + if (vm != null) { + accountStoragePoolUuid = StorageManager.PreferredStoragePool.valueIn(vm.getAccountId()); + } Optional storagePool = getMatchingStoragePool(accountStoragePoolUuid, poolList); if (storagePool.isPresent()) {