Ask Your Question
3

How to delete a subnet in neutron?

asked 2014-11-21 06:33:39 -0600

sanderv gravatar image

I'm setting up my cloud, based on Juno, and I'm following the setup guides on http://openstack.org . I have just added a subnet, but after adding it realise that it has wrong IP addresses. The subnet is displayed with neutron subnet-list:

[root@controller ~]# neutron subnet-list
+--------------------------------------+-------------+----------------+----------------------------------------------------+
| id                                   | name        | cidr           | allocation_pools                                   |
+--------------------------------------+-------------+----------------+----------------------------------------------------+
| bb384bc5-1df7-470d-86ca-9f4fd5cad3a1 | ext-subnet  | 203.0.113.0/24 | {"start": "203.0.113.101", "end": "203.0.113.200"} |
| 0d762f12-d158-474c-8c59-1509c4d9318b | demo-subnet | 192.168.1.0/24 | {"start": "192.168.1.2", "end": "192.168.1.254"}

Now I would like to remove the subnet and create it again with the correct IP addressing, but I'm getting a HTTP 409:

[root@controller ~]# neutron subnet-delete bb384bc5-1df7-470d-86ca-9f4fd5cad3a1
Conflict (HTTP 409) (Request-ID: req-80a96f97-4bad-4384-a782-a3a7f668fa12)

What am I missing?

Thanks, Sander

edit retag flag offensive close merge delete

5 answers

Sort by ยป oldest newest most voted
6

answered 2015-09-19 12:09:43 -0600

Marknikel gravatar image
  1. neutron router-gateway-clear "Router"(check name with neutron router-list)
  2. neutron router-interface-delete "Router" "SubNet"
  3. neutron router-delete "Router"
  4. neutron subnet-delete "SubNet"
  5. neutron net-delete "Net"
edit flag offensive delete link more
1

answered 2014-11-21 12:58:29 -0600

amitabh sinha gravatar image

updated 2014-11-21 12:59:16 -0600

First remove the allocated floating IP . use command floatingip-delete IP after that delete PORT using port-delete portid .After deleting port you can be able to delete subnet easily

edit flag offensive delete link more
1

answered 2015-11-22 21:54:28 -0600

Bipin gravatar image

Hello,

Looks like you are having an orphan port.

neutron port-list

Then remove the port using neutron port-delete <port id>

After that remove the subnet using

neutron subnet-delete <subnet id>

Your issue is related to this review https://review.openstack.org/#/c/127357/

edit flag offensive delete link more
1

answered 2014-11-21 10:45:59 -0600

dbaxps gravatar image

updated 2014-11-21 11:02:10 -0600

Delete Subnet
This operation remove a subnet from a Neutron network. The operation will fail if IPs from the subnet being removed are still allocated.
409 Conflict 

Delete Network
This operation will remove a Neutron network, and all its associated subnets, provided that no port is currently configured on the network. If ports are still configured on the network being removed, a 409 error will be returned.
edit flag offensive delete link more

Comments

Check floating IPs still allocated from subnet , login to corresponding tenant :
Access & Security => Floating IPs => Release Floating IPs

dbaxps gravatar imagedbaxps ( 2014-11-21 11:10:32 -0600 )edit

I would also check whether external net itself was activated as gateway for some router and cleaned this gateway up. Then neutron net-delete will remove subnet as well.

dbaxps gravatar imagedbaxps ( 2014-11-21 11:16:32 -0600 )edit

Mail system seems to be down. Track thread itself.

dbaxps gravatar imagedbaxps ( 2014-11-21 11:18:25 -0600 )edit

Hi! Do you know how to get the response code, i.e. "409" in this case? Thanks.

MrQ gravatar imageMrQ ( 2017-08-09 15:41:07 -0600 )edit
0

answered 2017-07-20 23:36:46 -0600

mourya007 gravatar image

Hi this is the simple and confusing situation but you have to follow some steps and hope it will work :

neutron router-list

neutron router-show <router-id>

neutron router-gateway-clear <router-id>

Check for the attached ports to the router. If there are attached ports, clear them first.

neutron router-port-list <router-id>

neutron router-interface-delete <router-id> <subnet-id>

neutron router-delete <router-id>

neutron subnet-list

neutron subnet-show <subnet-id>

neutron subnet-delete <subnet-id>

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-11-21 06:33:39 -0600

Seen: 25,949 times

Last updated: Jul 20 '17