yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #73473
[Bug 1778390] [NEW] dhcp ns will not delete when network with subnet's cidr being 0.x.x.x/x
Public bug reported:
I create a network with subnet's cidr being 0.x.x.x/x. When I delete the network, I find that the
qdhcp-xxxx ns still exists. There is still a device tap-xxx with ip 0.x.x.x in the qdhcp-xxx ns. But neutron port-list|grep "tap-xxx.mac_address" will not find the port.
1. Create a network and subnet:
[root@node-4 ~]# neutron net-create --provider:network_type vxlan test333
Created a new network:
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| availability_zone_hints | |
| availability_zones | |
| created_at | 2018-06-24T06:54:58 |
| description | |
| id | 5d2eeb43-78ee-4ece-9034-7c8783fa6f13 |
| ipv4_address_scope | |
| ipv6_address_scope | |
| mtu | 1450 |
| name | test333 |
| port_security_enabled | True |
| provider:network_type | vxlan |
| provider:physical_network | |
| provider:segmentation_id | 65611 |
| qos_policy_id | |
| router:external | False |
| shared | False |
| status | ACTIVE |
| subnets | |
| tags | |
| tenant_id | 88753bfc962c447bbb6b146c1834ea7d |
| updated_at | 2018-06-24T06:54:58 |
+---------------------------+--------------------------------------+
[root@node-4 ~]# neutron subnet-create test333 --name test333-subnet 0.0.8.1/24
Created a new subnet:
+-------------------+------------------------------------------+
| Field | Value |
+-------------------+------------------------------------------+
| allocation_pools | {"start": "0.0.8.2", "end": "0.0.8.254"} |
| cidr | 0.0.8.0/24 |
| created_at | 2018-06-24T06:55:57 |
| description | |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 0.0.8.1 |
| host_routes | |
| id | 7b9bf396-de26-48e6-8302-935876b5d0a5 |
| ip_version | 4 |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | test333-subnet |
| network_id | 5d2eeb43-78ee-4ece-9034-7c8783fa6f13 |
| subnetpool_id | |
| tags | |
| tenant_id | 88753bfc962c447bbb6b146c1834ea7d |
| updated_at | 2018-06-24T06:55:57 |
+-------------------+------------------------------------------+
2. And then see the qdhcp ns and dhcp-agent.log, neutron-server.log.
qdhcp ns:
[root@node-4 ~]# ip netns exec qdhcp-5d2eeb43-78ee-4ece-9034-7c8783fa6f13 ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
150: tap7daeb5f1-61: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN qlen 1000
link/ether fa:16:3e:77:31:84 brd ff:ff:ff:ff:ff:ff
inet 0.0.8.2/24 brd 0.0.8.255 scope global tap7daeb5f1-61
valid_lft forever preferred_lft forever
inet 169.254.169.254/16 brd 169.254.255.255 scope global tap7daeb5f1-61
valid_lft forever preferred_lft forever
inet6 fe80::f816:3eff:fe77:3184/64 scope link
valid_lft forever preferred_lft forever
[root@node-4 ~]# ip netns exec qdhcp-5d2eeb43-78ee-4ece-9034-7c8783fa6f13 ip r
169.254.0.0/16 dev tap7daeb5f1-61 proto kernel scope link src 169.254.169.254
3. Here no subnet routing table in dhcp-ns. And I get some error in /var/log/neutron/dhcp_agent.log likes as follow:
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent [-] Unable to enable dhcp for 5d2eeb43-78ee-4ece-9034-7c8783fa6f13.
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent Traceback (most recent call last):
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/dhcp/agent.py", line 111, in call_driver
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent getattr(driver, action)(**action_kwargs)
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/dhcp.py", line 208, in enable
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent interface_name = self.device_manager.setup(self.network)
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/dhcp.py", line 1277, in setup
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent self._set_default_route(network, interface_name)
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/dhcp.py", line 1062, in _set_default_route
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent device.route.add_gateway(subnet.gateway_ip)
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 714, in add_gateway
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent self._as_root([ip_version], tuple(args))
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 385, in _as_root
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent use_root_namespace=use_root_namespace)
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 96, in _as_root
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent log_fail_as_error=self.log_fail_as_error)
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 105, in _execute
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent log_fail_as_error=log_fail_as_error)
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/utils.py", line 146, in execute
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent raise ProcessExecutionError(msg, returncode=returncode)
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent ProcessExecutionError: Exit code: 2; Stdin: ; Stdout: ; Stderr: RTNETLINK answers: Network is unreachable
I'm sure dhcp agent hit an error during create the first subnet. And if
the subnet with cidr being 0.x.x.x/x is not first subnet, here still no
subnet routing table in qdhcp ns. I have tested several times.
4. when I delete the network, the port in neutron database will delete. But the qdhcp ns with tap device still exists.
[root@node-4 ~]# neutron port-list|grep fa:16:3e:77:31:84
| 7daeb5f1-61db-47fa-a054-21bf95a4414b | | fa:16:3e:77:31:84 | {"subnet_id": "7b9bf396-de26-48e6-8302-935876b5d0a5", "ip_address": "0.0.8.2"} |
[root@node-4 ~]# neutron net-delete test333
Deleted network: test333
[root@node-4 ~]# neutron port-list|grep fa:16:3e:77:31:84
[root@node-4 ~]#
[root@node-4 ~]# ip netns exec qdhcp-5d2eeb43-78ee-4ece-9034-7c8783fa6f13 ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
150: tap7daeb5f1-61: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN qlen 1000
link/ether fa:16:3e:77:31:84 brd ff:ff:ff:ff:ff:ff
inet 0.0.8.2/24 brd 0.0.8.255 scope global tap7daeb5f1-61
valid_lft forever preferred_lft forever
inet 169.254.169.254/16 brd 169.254.255.255 scope global tap7daeb5f1-61
valid_lft forever preferred_lft forever
inet6 fe80::f816:3eff:fe77:3184/64 scope link
valid_lft forever preferred_lft forever
I think we should judge whether CIDR is 0.x.x.x./x when creating subnet.
** Affects: neutron
Importance: Undecided
Status: New
** Tags: neutron
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1778390
Title:
dhcp ns will not delete when network with subnet's cidr being
0.x.x.x/x
Status in neutron:
New
Bug description:
I create a network with subnet's cidr being 0.x.x.x/x. When I delete the network, I find that the
qdhcp-xxxx ns still exists. There is still a device tap-xxx with ip 0.x.x.x in the qdhcp-xxx ns. But neutron port-list|grep "tap-xxx.mac_address" will not find the port.
1. Create a network and subnet:
[root@node-4 ~]# neutron net-create --provider:network_type vxlan test333
Created a new network:
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| admin_state_up | True |
| availability_zone_hints | |
| availability_zones | |
| created_at | 2018-06-24T06:54:58 |
| description | |
| id | 5d2eeb43-78ee-4ece-9034-7c8783fa6f13 |
| ipv4_address_scope | |
| ipv6_address_scope | |
| mtu | 1450 |
| name | test333 |
| port_security_enabled | True |
| provider:network_type | vxlan |
| provider:physical_network | |
| provider:segmentation_id | 65611 |
| qos_policy_id | |
| router:external | False |
| shared | False |
| status | ACTIVE |
| subnets | |
| tags | |
| tenant_id | 88753bfc962c447bbb6b146c1834ea7d |
| updated_at | 2018-06-24T06:54:58 |
+---------------------------+--------------------------------------+
[root@node-4 ~]# neutron subnet-create test333 --name test333-subnet 0.0.8.1/24
Created a new subnet:
+-------------------+------------------------------------------+
| Field | Value |
+-------------------+------------------------------------------+
| allocation_pools | {"start": "0.0.8.2", "end": "0.0.8.254"} |
| cidr | 0.0.8.0/24 |
| created_at | 2018-06-24T06:55:57 |
| description | |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 0.0.8.1 |
| host_routes | |
| id | 7b9bf396-de26-48e6-8302-935876b5d0a5 |
| ip_version | 4 |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | test333-subnet |
| network_id | 5d2eeb43-78ee-4ece-9034-7c8783fa6f13 |
| subnetpool_id | |
| tags | |
| tenant_id | 88753bfc962c447bbb6b146c1834ea7d |
| updated_at | 2018-06-24T06:55:57 |
+-------------------+------------------------------------------+
2. And then see the qdhcp ns and dhcp-agent.log, neutron-server.log.
qdhcp ns:
[root@node-4 ~]# ip netns exec qdhcp-5d2eeb43-78ee-4ece-9034-7c8783fa6f13 ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
150: tap7daeb5f1-61: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN qlen 1000
link/ether fa:16:3e:77:31:84 brd ff:ff:ff:ff:ff:ff
inet 0.0.8.2/24 brd 0.0.8.255 scope global tap7daeb5f1-61
valid_lft forever preferred_lft forever
inet 169.254.169.254/16 brd 169.254.255.255 scope global tap7daeb5f1-61
valid_lft forever preferred_lft forever
inet6 fe80::f816:3eff:fe77:3184/64 scope link
valid_lft forever preferred_lft forever
[root@node-4 ~]# ip netns exec qdhcp-5d2eeb43-78ee-4ece-9034-7c8783fa6f13 ip r
169.254.0.0/16 dev tap7daeb5f1-61 proto kernel scope link src 169.254.169.254
3. Here no subnet routing table in dhcp-ns. And I get some error in /var/log/neutron/dhcp_agent.log likes as follow:
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent [-] Unable to enable dhcp for 5d2eeb43-78ee-4ece-9034-7c8783fa6f13.
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent Traceback (most recent call last):
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/dhcp/agent.py", line 111, in call_driver
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent getattr(driver, action)(**action_kwargs)
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/dhcp.py", line 208, in enable
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent interface_name = self.device_manager.setup(self.network)
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/dhcp.py", line 1277, in setup
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent self._set_default_route(network, interface_name)
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/dhcp.py", line 1062, in _set_default_route
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent device.route.add_gateway(subnet.gateway_ip)
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 714, in add_gateway
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent self._as_root([ip_version], tuple(args))
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 385, in _as_root
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent use_root_namespace=use_root_namespace)
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 96, in _as_root
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent log_fail_as_error=self.log_fail_as_error)
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/ip_lib.py", line 105, in _execute
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent log_fail_as_error=log_fail_as_error)
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent File "/usr/lib/python2.7/site-packages/neutron/agent/linux/utils.py", line 146, in execute
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent raise ProcessExecutionError(msg, returncode=returncode)
2018-06-24 15:35:22.754 4954 ERROR neutron.agent.dhcp.agent ProcessExecutionError: Exit code: 2; Stdin: ; Stdout: ; Stderr: RTNETLINK answers: Network is unreachable
I'm sure dhcp agent hit an error during create the first subnet. And
if the subnet with cidr being 0.x.x.x/x is not first subnet, here
still no subnet routing table in qdhcp ns. I have tested several
times.
4. when I delete the network, the port in neutron database will delete. But the qdhcp ns with tap device still exists.
[root@node-4 ~]# neutron port-list|grep fa:16:3e:77:31:84
| 7daeb5f1-61db-47fa-a054-21bf95a4414b | | fa:16:3e:77:31:84 | {"subnet_id": "7b9bf396-de26-48e6-8302-935876b5d0a5", "ip_address": "0.0.8.2"} |
[root@node-4 ~]# neutron net-delete test333
Deleted network: test333
[root@node-4 ~]# neutron port-list|grep fa:16:3e:77:31:84
[root@node-4 ~]#
[root@node-4 ~]# ip netns exec qdhcp-5d2eeb43-78ee-4ece-9034-7c8783fa6f13 ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
150: tap7daeb5f1-61: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN qlen 1000
link/ether fa:16:3e:77:31:84 brd ff:ff:ff:ff:ff:ff
inet 0.0.8.2/24 brd 0.0.8.255 scope global tap7daeb5f1-61
valid_lft forever preferred_lft forever
inet 169.254.169.254/16 brd 169.254.255.255 scope global tap7daeb5f1-61
valid_lft forever preferred_lft forever
inet6 fe80::f816:3eff:fe77:3184/64 scope link
valid_lft forever preferred_lft forever
I think we should judge whether CIDR is 0.x.x.x./x when creating
subnet.
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1778390/+subscriptions