Local subnet left after central subnet deleted
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Tricircle |
Fix Released
|
Undecided
|
Zhiyuan Cai |
Bug Description
After issuing a subnet delete request to central Neutron, central subnet is deleted, but local subnet is left. Further delete central network, local network is deleted successfully along with local subnet deleted(this is why we didn't find out this bug before)
Digging into the log, I found that the local subnet was once deleted, but the following processes recreate the subnet.
1. local subnet is deleted
2. dhcp agent gets "subnet delete" notification
3. dhcp agent calls "get_network"
4. "get_network" calls "ensure_subnet"
5. "ensure_subnet" queries central Neutron to see if there are subnets associated with the network. At this point, central subnet is not deleted since we delete local subnet before deleting central subnet, so central subnet is returned and "ensure_subnet" recreates the local subnet.
Then why do we need to call "ensure_subnet" in "get_network"? The reason is that a user may first create a network and boot a VM, so local network is created. Then the user creates a subnet on this network and boots a VM again, in this case, if we don't ensure subnet in "get_network", the local subnet will not be created.
To fix this bug, we need a way to distinguish the call from dhcp agent and API.
Fix proposed to branch: master /review. openstack. org/456826
Review: https:/