Thursday, 1 September 2016

Router interface for subnet on router cannot be deleted, as it is required by one or more floating IPs

I was trying to reconfigure an Openstack router, but I got the below error ,

root@controller:~# neutron router-interface-delete router1 one-subnet
Router interface for subnet 9bf32c5e-f46f-4c27-b928-cee4b47034d8 on router 4f9ea791-d6ee-4e78-a891-5b282fd78a11 cannot be deleted, as it is required by one or more floating IPs.

FIX


Found out the floating IP information related to the router - router1

root@controller:~# neutron floatingip-list
+--------------------------------------+------------------+---------------------+--------------------------------------+
| id                                   | fixed_ip_address | floating_ip_address | port_id                              |
+--------------------------------------+------------------+---------------------+--------------------------------------+
| be36d2d9-a099-431f-babd-c23c13fb1ef4 | 10.1.1.153       | 10.1.12.135         | e62ded91-b309-4d7b-9f8b-384ab9c86db7 |
| dee50689-9600-4c62-9f4d-8a67dbaa1535 | 10.1.1.154       | 10.1.12.128         | 925a41ca-3faa-450f-8f70-e46aa9d92b89 |
+--------------------------------------+------------------+---------------------+--------------------------------------+
root@controller:~# neutron router-show router1
+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field                   | Value                                                                                                                                                                                   |
+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| admin_state_up          | True                                                                                                                                                                                    |
| availability_zone_hints |                                                                                                                                                                                         |
| availability_zones      | nova                                                                                                                                                                                    |
| description             |                                                                                                                                                                                         |
| distributed             | False                                                                                                                                                                                   |
| external_gateway_info   | {"network_id": "e15ecc33-c3a5-429d-b958-f3f378870b37", "enable_snat": true, "external_fixed_ips": [{"subnet_id": "1b1dd1f6-3be2-4204-a219-6b11bf6679f6", "ip_address": "10.1.12.127"}]} |
| ha                      | False                                                                                                                                                                                   |
| id                      | 4f9ea791-d6ee-4e78-a891-5b282fd78a11                                                                                                                                                    |
| name                    | router1                                                                                                                                                                                 |
| routes                  |                                                                                                                                                                                         |
| status                  | ACTIVE                                                                                                                                                                                  |
| tenant_id               | 04c68cc86c804486bf2484d9d28a6eca                                                                                                                                                        |
+-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
root@controller:~# neutron router-port-list router1
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------------+
| id                                   | name | mac_address       | fixed_ips                                                                          |
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------------+
| 17589b8d-d9f4-466f-84b4-1e3b867e3a99 |      | fa:16:3e:8e:a7:93 | {"subnet_id": "9bf32c5e-f46f-4c27-b928-cee4b47034d8", "ip_address": "10.1.1.1"}    |
| a408faa5-6c70-4e1b-8aa8-01ded4239008 |      | fa:16:3e:28:dc:b8 | {"subnet_id": "1b1dd1f6-3be2-4204-a219-6b11bf6679f6", "ip_address": "10.1.12.127"} |
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------------+

Then deleted the floating IPs

root@controller:~# neutron floatingip-delete  be36d2d9-a099-431f-babd-c23c13fb1ef4
Deleted floatingip: be36d2d9-a099-431f-babd-c23c13fb1ef4
root@controller:~# neutron floatingip-delete dee50689-9600-4c62-9f4d-8a67dbaa1535
Deleted floatingip: dee50689-9600-4c62-9f4d-8a67dbaa1535

Then cleared the router configuration,

root@controller:~# neutron router-gateway-clear router1
Removed gateway from router router1
root@controller:~# neutron router-interface-delete router1 one-subnet
Removed interface from router router1.
root@controller:~# neutron router-show router1
+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| admin_state_up          | True                                 |
| availability_zone_hints |                                      |
| availability_zones      | nova                                 |
| description             |                                      |
| external_gateway_info   |                                      |
| id                      | 4f9ea791-d6ee-4e78-a891-5b282fd78a11 |
| name                    | router1                              |
| routes                  |                                      |
| status                  | ACTIVE                               |
| tenant_id               | 04c68cc86c804486bf2484d9d28a6eca     |
+-------------------------+--------------------------------------+