def METHOD_NAME(cif):
    conn = libvirtconnection.get()
    for vm_id in cif.pop_unknown_vm_ids():
        try:
            dom_obj = conn.lookupByUUIDString(vm_id)
            dom_xml = dom_obj.XMLDesc()
        except libvirt.libvirtError as e:
            if e.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN:
                logging.debug("External domain %s not found", vm_id)
                continue
            else:
                logging.exception("Failed to retrieve external VM: %s", vm_id)
                cif.add_unknown_vm_id(vm_id)
                continue
        if _is_ignored_vm(vm_id, dom_obj, dom_xml):
            continue
        logging.debug("Recovering external domain: %s", vm_id)
        if _recover_domain(cif, vm_id, dom_xml, True):
            cif.log.info("Recovered new external domain: %s", vm_id)
        else:
            cif.log.info("Failed to recover new external domain: %s", vm_id)