Code for detecting and marking dead VMs