This will overwrite instances_by_id for each name in names.