def _destroy_rescue_instance(self, rescue_vm_ref, original_vm_ref):
        """Destroy a rescue instance."""
        # Shutdown Rescue VM
        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)

        # Destroy Rescue VDIs
        vdi_refs = vm_utils.lookup_vm_vdis(self._session, rescue_vm_ref)

        # Don't destroy any VDIs belonging to the original VM
        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)

        # Destroy Rescue VM
        self._session.call_xenapi("VM.destroy", rescue_vm_ref)
dataset/ETHPy150Open openstack/nova/nova/virt/xenapi/vmops.py/VMOps._destroy_rescue_instance/original