By deferring scheduling of networks to dhcp agents until the first VM port is created, there is a possibility to create the VM port and have it issuing DHCP requests before the DHCP agent gets a chance to create a port on the network, launch its dnsmasq process, etc.
By scheduling the agent at subnet creation time instead of the first port creation, we can buy extra time to help avoid this situation (DHCP scheduling notification sent before VM port creation rather than after). Additionally, scripts can watch the DHCP port state after creating the subnet to know when it should be safer to proceed.
Ultimately we will need a way to know that the DHCP agent is truly ready (dnsmasq process running with updated config), but this will require new state to be stored and passed from the agent which will probably require a spec so we can address 'readiness' in a broader fashion.
have you seen the race in the field?
or just code inspection?