diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java index 15418d4dc87..f9bc0420083 100755 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -487,7 +487,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac Long hostId = vm.getHostId() != null ? vm.getHostId() : vm.getLastHostId(); - if (volumeExpungeCommands != null && hostId != null) { + if (volumeExpungeCommands != null && volumeExpungeCommands.size() > 0 && hostId != null) { Commands cmds = new Commands(Command.OnError.Stop); for (Command volumeExpungeCommand : volumeExpungeCommands) {