> For the complete documentation index, see [llms.txt](https://yeasy.gitbook.io/openstack_code_neutron/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yeasy.gitbook.io/openstack_code_neutron/neutron/scheduler/dhcp_agent_schedulerpy.md).

# dhcp\_agent\_scheduler.py

定义了ChanceScheduler类，用于实现随机为一个网络分配一个dhcp agent。

该类主要定义对外的两个方法，schedule()实现对一个网络返回调度给它的若干agents，auto\_schedule\_networks()方法将还没有分配agent的所有网络安排到指定主机的agent上。
