How to delete a port with fixed IP address on an OpenStack Pike instance (deployed by Kolla-Ansible)

You cannot delete a network from the dashboard interface if it's attached to a port with fixed IP address on OpenStack (I'm running Pike). So what you have to do is to delete the port directly from the database:

1. Go to the mariadb docker instance:

$ docker exec -it <id or name of the nova docker instance> /bin/bash

2. Login to mariadb console using the password in /etc/kolla/passwords.yml

$ mysql -u root -p

3. Run these commands to delete the port (you may need to delete all of its relationship, for example from sfc_flow_classifiers table first)

use neutron;
select id from sfc_flow_classifiers; # get the id of the classifier that linked to the port
delete from sfc_flow_classifiers where id='<the id you get from the previous command>';
delete from ports where id='<the port id you get from the dashboard>';

4. Then you can delete the network.

Comments