'Destroy a rescue instance.'

def _destroy_rescue_instance(self, rescue_vm_ref, original_vm_ref):

    state = vm_utils.get_power_state(self._session, rescue_vm_ref)
    if (state != power_state.SHUTDOWN):
        self._session.call_xenapi('VM.hard_shutdown', rescue_vm_ref)
    vdi_refs = vm_utils.lookup_vm_vdis(self._session, rescue_vm_ref)
    orig_vdi_refs = self._find_vdi_refs(original_vm_ref)
    vdi_refs = (set(vdi_refs) - set(orig_vdi_refs.values()))
    vm_utils.safe_destroy_vdis(self._session, vdi_refs)
    self._session.call_xenapi('VM.destroy', rescue_vm_ref)
