Saturday, August 6, 2016

Unable to delete a neutron network: OpenStack Mitaka: Unable to complete operation on subnet : One or more ports have an IP allocation from this subnet.




OpenStack Mitaka issue deleting a subnet and network

[root@controller1 ~]# neutron subnet-list
+--------------------------------------+-------------+------------------+--------------------------------------------------------+
| id                                   | name        | cidr             | allocation_pools                                       |
+--------------------------------------+-------------+------------------+--------------------------------------------------------+
| d0342273-8e66-41f7-8350-e521effb87ca | provider    | 192.168.100.0/24 | {"start": "192.168.100.200", "end": "192.168.100.215"} |
| 50c1f579-9aaf-418b-88ed-cdba613131bc | selfservice | 172.16.1.0/24    | {"start": "172.16.1.2", "end": "172.16.1.254"}         |
+--------------------------------------+-------------+------------------+--------------------------------------------------------+
[root@controller1 ~]# . demo-openrc
[root@controller1 ~]# neutron subnet-delete selfservice
Unable to complete operation on subnet 50c1f579-9aaf-418b-88ed-cdba613131bc: One or more ports have an IP allocation from this subnet.
Neutron server returns request_ids: ['req-65ef3cf1-8932-4aef-b2de-279ad0074635']


Neutron server returns request_ids: ['req-832cd4d9-a38d-40d5-90d4-f2b5d5a2ccfb']
[root@controller1 ~]# neutron port-list
+--------------------------------------+------+-------------------+----------------------------------------------------------+
| id                                   | name | mac_address       | fixed_ips                                                |
+--------------------------------------+------+-------------------+----------------------------------------------------------+
| 06ab1ec7-11a8-40b2-8fcc-e74d2705074b |      | fa:16:3e:b4:be:6b | {"subnet_id": "50c1f579-9aaf-418b-88ed-cdba613131bc",    |
|                                      |      |                   | "ip_address": "172.16.1.1"}                              |
| caa368c7-5e83-4779-866e-b3038285ba5e |      | fa:16:3e:c5:15:0f | {"subnet_id": "50c1f579-9aaf-418b-88ed-cdba613131bc",    |
|                                      |      |                   | "ip_address": "172.16.1.2"}                              |
+--------------------------------------+------+-------------------+----------------------------------------------------------+

There are ports already allocated from this network/subnet so it is not allowing the removal of the network.

Note: Please ensure that these ports are not carrying IP address to connect to any instance. deleting the port which is in use by an instance will cause the  instance connectivity fail.


[root@controller1 ~]# neutron port-delete 06ab1ec7-11a8-40b2-8fcc-e74d2705074b
Deleted port: 06ab1ec7-11a8-40b2-8fcc-e74d2705074b


[root@controller1 ~]# neutron port-delete caa368c7-5e83-4779-866e-b3038285ba5e
Deleted port: caa368c7-5e83-4779-866e-b3038285ba5e
[root@controller1 ~]# neutron floatingip-list
404 Not Found

The resource could not be found.


Neutron server returns request_ids: ['req-6ea7902e-17aa-4cc1-bed2-cacd1d6f97a3']
[root@controller1 ~]# neutron subnet-delete selfservice
Deleted subnet: selfservice
[root@controller1 ~]#