OpenStack: Debug / cleanup DHCP
Restart DHCP namespaces
openstack subnet set --no-dhcp ${SUBNET_ID} openstack subnet set --dhcp ${SUBNET_ID}
Find unnecessary DHCP namespaces
MAX_DHCP_NS=3 SUBNET_IDS=$(openstack subnet list --dhcp -c ID -f value) for SUBNET_ID in ${SUBNET_IDS}; do NETWORK_ID=$(openstack subnet show ${SUBNET_ID} -c network_id -f value) DHCP_PORTS="$(openstack port list --device-owner network:dhcp --network ${NETWORK_ID} -c ID -c binding_host_id -c fixed_ips -c status -f value)" if [ $(echo "${DHCP_PORTS}" | wc -l) -ne ${MAX_DHCP_NS} ]; then echo "NETWORK_ID: ${NETWORK_ID}" echo "${DHCP_PORTS}" echo fi done
Add / remove DHCP ports