guru.finalizeExpunge(vm);
//remove the overcommit detials from the uservm details
_uservmDetailsDao.deleteDetails(vm.getId());
// send hypervisor-dependent commands before removing
List<Command> finalizeExpungeCommands = hvGuru.finalizeExpunge(vm);
if(finalizeExpungeCommands != null && finalizeExpungeCommands.size() > 0){
Long hostId = vm.getHostId() != null ? vm.getHostId() : vm.getLastHostId();
if(hostId != null){
Commands cmds = new Commands(OnError.Stop);
for (Command command : finalizeExpungeCommands) {