Show subnet details
openstack subnet list --network public openstack subnet show public-10.0.0.0/24
Modify database
DB_PASS=$(grep neutron_database_password /etc/kolla/passwords.yml | cut -d " " -f2) mysql -h db.service.example.com --password=${DB_PASS} -P 6033 -u neutron -D neutron select * from neutron.subnets where cidr like '10.0.0%'; update subnets set cidr='10.0.0.0/23' WHERE cidr = '10.0.0.0/24'; exit; # update subnet name openstack subnet set --name public-10.0.0.0/23 public-10.0.0.0/24 # extend allocation-pool openstack subnet set --allocation-pool start=10.0.0.255,end=10.0.1.254 public-10.0.0.0/23 # show subnet details openstack subnet show public-10.0.0.0/23
Restart network agent
OS_HOST=node1.example.com for OS_AGENT_TYPE in dhcp l3 open-vswitch; do openstack network agent set --disable $(openstack network agent list --agent-type ${OS_AGENT_TYPE} --host ${OS_HOST} -c ID -f value) sleep 3 done openstack network agent list --host ${OS_HOST} for OS_AGENT_TYPE in dhcp l3 open-vswitch; do openstack network agent set --enable $(openstack network agent list --agent-type ${OS_AGENT_TYPE} --host ${OS_HOST} -c ID -f value) sleep 3 done openstack network agent list
Debug
ssh nodeX.example.com watch -n 1 'for NS in $(ip netns | cut -d" " -f1); do ip netns exec ${NS} ip a | grep 10.0; done' for NS in $(ip netns | cut -d" " -f1); do ip netns exec ${NS} ip a | grep 10.0 done #> /tmp/ip_netns_a.out for NS in $(ip netns | cut -d" " -f1); do ip netns exec ${NS} ip r | grep 10.0 done #> /tmp/ip_netns_r.out tail -f /var/lib/docker/volumes/kolla_logs/_data/openvswitch/ovs*
Links
https://docs.openstack.org/python-openstackclient/rocky/cli/command-objects/subnet.html#subnet-set
https://cloudblog.switch.ch/2015/09/22/hack-neutron-to-add-more-ip-addresses-to-an-existing-subnet/
http://jodies.de/ipcalc