Activity log for bug #1219795

Date Who What changed Old value New value Message
2013-09-02 11:44:40 Brian D. Burns bug added bug
2013-09-02 11:45:10 Brian D. Burns description When creating a subnet, the DHCP port is not being created until another port is created. That is, unless ports have been created on the network. And a call to create a subnet will return before the DHCP port is established (if that occurs), which produces a race condition if creating a port immediately after creating the subnet. This is easier is explain by example :) The following can be run from a shell script to reproduce the issue: neutron net-create test_net neutron subnet-create test_net 198.18.0.0/24 neutron subnet-create test_net 2001:db8:abc:123::/64 --ip-version 6 sleep 5 # just to be sure neutron port-list # dhcp port has not been created yet neutron port-create test_net --name test_port # the dhcp port is created after the test_port. # apparently before the port-create command returns, # as no sleep is needed before the port-list. neutron port-list # test_port assigned 198.18.0.2 and 2001:db8:abc:123::2 # dhcp port assigned 198.18.0.3 and 2001:db8:abc:123::3 neutron port-delete test_port neutron net-delete test_net neutron net-create test_net # this add/remove port before subnet creation causes the dhcp port # to be setup when the subnets are created. neutron port-create test_net --name test_port neutron port-delete test_port neutron subnet-create test_net 198.18.0.0/24 neutron subnet-create test_net 2001:db8:abc:123::/64 --ip-version 6 sleep 5 # subnet-create returns before the dhcp port is setup neutron port-list # dhcp port assigned 198.18.0.2 and 2001:db8:abc:123::2 neutron port-create test_net --name test_port neutron port-list # test_port assigned 198.18.0.3 and 2001:db8:abc:123::3 neutron port-delete test_port neutron net-delete test_net # this creates a condition where if you create the test_port # after the subnets without sleeping, the test_port gets the ::2 ipv6 # address before the dhcp port. neutron net-create test_net neutron port-create test_net --name test_port neutron port-delete test_port neutron subnet-create test_net 198.18.0.0/24 neutron subnet-create test_net 2001:db8:abc:123::/64 --ip-version 6 neutron port-create test_net --name test_port sleep 5 # in order to see the dhcp port neutron port-list # test_port assigned 198.18.0.3 and 2001:db8:abc:123::2 # dhcp port assigned 198.18.0.2 and 2001:db8:abc:123::3 neutron port-delete test_port neutron net-delete test_net It seems the solution would be to make sure the DHCP port check is performed after a subnet is created/updated, and not return until that is completed. It doesn't seem like this would be necessary when creating/updating a port. (unless it's the DHCP port that's being modified?) When creating a subnet, the DHCP port is not being created until another port is created. That is, unless ports have been created on the network. And a call to create a subnet will return before the DHCP port is established (if that occurs), which produces a race condition if creating a port immediately after creating the subnet. This is easier is explain by example :) The following can be run from a shell script to reproduce the issue: neutron net-create test_net neutron subnet-create test_net 198.18.0.0/24 neutron subnet-create test_net 2001:db8:abc:123::/64 --ip-version 6 sleep 5 # just to be sure neutron port-list # dhcp port has not been created yet neutron port-create test_net --name test_port # the dhcp port is created after the test_port. # apparently before the port-create command returns, # as no sleep is needed before the port-list. neutron port-list # test_port assigned 198.18.0.2 and 2001:db8:abc:123::2 # dhcp port assigned 198.18.0.3 and 2001:db8:abc:123::3 neutron port-delete test_port neutron net-delete test_net neutron net-create test_net # this add/remove port before subnet creation causes the dhcp port # to be setup when the subnets are created. neutron port-create test_net --name test_port neutron port-delete test_port neutron subnet-create test_net 198.18.0.0/24 neutron subnet-create test_net 2001:db8:abc:123::/64 --ip-version 6 sleep 5 # subnet-create returns before the dhcp port is setup neutron port-list # dhcp port assigned 198.18.0.2 and 2001:db8:abc:123::2 neutron port-create test_net --name test_port neutron port-list # test_port assigned 198.18.0.3 and 2001:db8:abc:123::3 neutron port-delete test_port neutron net-delete test_net # this creates a condition where if you create the test_port # after the subnets without sleeping, the test_port gets the ::2 ipv6 # address before the dhcp port. neutron net-create test_net neutron port-create test_net --name test_port neutron port-delete test_port neutron subnet-create test_net 198.18.0.0/24 neutron subnet-create test_net 2001:db8:abc:123::/64 --ip-version 6 neutron port-create test_net --name test_port sleep 5 # in order to see the dhcp port neutron port-list # test_port assigned 198.18.0.3 and 2001:db8:abc:123::2 # dhcp port assigned 198.18.0.2 and 2001:db8:abc:123::3 neutron port-delete test_port neutron net-delete test_net It seems the solution would be to make sure the DHCP port check is performed after a subnet is created/updated, and not return until that is completed. It doesn't seem like this would be necessary when creating/updating a port. (unless it's the DHCP port that's being modified?)
2013-09-03 16:36:19 Armando Migliaccio tags l3-ipam-dhcp
2013-09-03 16:51:52 Sean McCully neutron: assignee Sean McCully (sean-mccully)
2013-09-03 20:21:53 Sean McCully neutron: status New Confirmed
2013-09-04 16:45:35 OpenStack Infra neutron: status Confirmed In Progress
2013-09-09 21:22:29 Mark McClain neutron: importance Undecided Critical
2013-09-09 21:22:34 Mark McClain neutron: importance Critical Medium
2013-09-18 01:01:04 Sean McCully neutron: assignee Sean McCully (sean-mccully)
2014-06-04 09:18:49 mandar neutron: assignee mandar (mandar-sherikar)
2015-03-01 07:12:17 Aman Kumar bug added subscriber Aman Kumar
2015-03-29 18:10:02 Don Bowman attachment added reproduce problem using heat https://bugs.launchpad.net/neutron/+bug/1219795/+attachment/4360036/+files/1219795.yaml
2015-08-04 05:06:14 Sudhakar Gariganti bug added subscriber Sudhakar Gariganti
2015-09-01 06:07:44 Armando Migliaccio marked as duplicate 1431105