Hi,
According to the bug, dhcp-agent association with the network is still existed even if no subnet with dhcp-enable is available.
openstack@openstack:/opt/stack/neutron$ neutron subnet-create f0ab9b8d-0977-4eb9-9ca4-d84142a90081 --name subnet1 2.2.2.0/24 --enable-dhcp Created a new subnet: +-------------------+------------------------------------------+ | Field | Value | +-------------------+------------------------------------------+ | allocation_pools | {"start": "2.2.2.2", "end": "2.2.2.254"} | | cidr | 2.2.2.0/24 | | dns_nameservers | | | enable_dhcp | True | | gateway_ip | 2.2.2.1 | | host_routes | | | id | d81b2cd8-b318-4f9b-842c-bd809ebffb87 | | ip_version | 4 | | ipv6_address_mode | | | ipv6_ra_mode | | | name | subnet1 | | network_id | f0ab9b8d-0977-4eb9-9ca4-d84142a90081 | | subnetpool_id | | | tenant_id | e998f06543e4477b9a0bd5359a740a39 | +-------------------+------------------------------------------+
openstack@openstack:/opt/stack/neutron$ neutron dhcp-agent-list-hosting-net f0ab9b8d-0977-4eb9-9ca4-d84142a90081 +--------------------------------------+-----------+----------------+-------+ | id | host | admin_state_up | alive | +--------------------------------------+-----------+----------------+-------+ | af4de443-2e24-4892-b104-4041ceb2899d | openstack | True | :-) | +--------------------------------------+-----------+----------------+-------+
Updating subnet with --disable-dhcp agent
openstack@openstack:/opt/stack/neutron$ neutron subnet-update d81b2cd8-b318-4f9b-842c-bd809ebffb87 --disable-dhcp Updated subnet: d81b2cd8-b318-4f9b-842c-bd809ebffb87
Still dhcp-agent is running for that network openstack@openstack:/opt/stack/neutron$ neutron dhcp-agent-list-hosting-net f0ab9b8d-0977-4eb9-9ca4-d84142a90081 +--------------------------------------+-----------+----------------+-------+ | id | host | admin_state_up | alive | +--------------------------------------+-----------+----------------+-------+ | af4de443-2e24-4892-b104-4041ceb2899d | openstack | True | :-) | +--------------------------------------+-----------+----------------+-------+ openstack@openstack:/opt/stack/neutron$
Proposing solution: There should not be any dhcp-agent associated for given network if there is no subnet with dhcp-enable.
Please post your comments or concerns for this solution.
Hi,
According to the bug, dhcp-agent association with the network is still existed even if no subnet with dhcp-enable is available.
openstack@ openstack: /opt/stack/ neutron$ neutron subnet-create f0ab9b8d- 0977-4eb9- 9ca4-d84142a900 81 --name subnet1 2.2.2.0/24 --enable-dhcp ------- ------+ ------- ------- ------- ------- ------- ------- + ------- ------+ ------- ------- ------- ------- ------- ------- + b318-4f9b- 842c-bd809ebffb 87 | 0977-4eb9- 9ca4-d84142a900 81 | b9a0bd5359a740a 39 | ------- ------+ ------- ------- ------- ------- ------- ------- +
Created a new subnet:
+------
| Field | Value |
+------
| allocation_pools | {"start": "2.2.2.2", "end": "2.2.2.254"} |
| cidr | 2.2.2.0/24 |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 2.2.2.1 |
| host_routes | |
| id | d81b2cd8-
| ip_version | 4 |
| ipv6_address_mode | |
| ipv6_ra_mode | |
| name | subnet1 |
| network_id | f0ab9b8d-
| subnetpool_id | |
| tenant_id | e998f06543e4477
+------
openstack@ openstack: /opt/stack/ neutron$ neutron dhcp-agent- list-hosting- net f0ab9b8d- 0977-4eb9- 9ca4-d84142a900 81 ------- ------- ------- ------- ----+-- ------- --+---- ------- -----+- ------+ ------- ------- ------- ------- ----+-- ------- --+---- ------- -----+- ------+ 2e24-4892- b104-4041ceb289 9d | openstack | True | :-) | ------- ------- ------- ------- ----+-- ------- --+---- ------- -----+- ------+
+------
| id | host | admin_state_up | alive |
+------
| af4de443-
+------
Updating subnet with --disable-dhcp agent
openstack@ openstack: /opt/stack/ neutron$ neutron subnet-update d81b2cd8- b318-4f9b- 842c-bd809ebffb 87 --disable-dhcp b318-4f9b- 842c-bd809ebffb 87
Updated subnet: d81b2cd8-
Still dhcp-agent is running for that network openstack: /opt/stack/ neutron$ neutron dhcp-agent- list-hosting- net f0ab9b8d- 0977-4eb9- 9ca4-d84142a900 81 ------- ------- ------- ------- ----+-- ------- --+---- ------- -----+- ------+ ------- ------- ------- ------- ----+-- ------- --+---- ------- -----+- ------+ 2e24-4892- b104-4041ceb289 9d | openstack | True | :-) | ------- ------- ------- ------- ----+-- ------- --+---- ------- -----+- ------+ openstack: /opt/stack/ neutron$
openstack@
+------
| id | host | admin_state_up | alive |
+------
| af4de443-
+------
openstack@
Proposing solution:
There should not be any dhcp-agent associated for given network if there is no subnet with dhcp-enable.
Please post your comments or concerns for this solution.