Ask Your Question

How do I extend a subnet allocation pool in neutron [closed]

asked 2014-10-21 08:40:42 -0500

mickt gravatar image

updated 2014-10-21 09:14:32 -0500

I configured an allocation pool with 5 floating IP using the following command.

neutron subnet-create $external_network_name --name $external_subnet_name --allocation-pool start=$floating_start,end=$floating_end --disable-dhcp --gateway $external_gateway $external_network_cidr

I now wish to extend the pool since I have freed a few IP addresses. How do I do this?

# neutron subnet-list
| id                                   | name            | cidr            | allocation_pools                                   |
| bc9dd495-b14e-49ec-a26c-f798e3685755 | ext-subnet      |   | {"start": "", "end": ""}   |

Can I add blocks of addresses instead of a contiguous range?

Also, I don't see the floating IP list anywhere in the dashboard. Where is will I locate it?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by mickt
close date 2014-12-08 09:35:19.105725



nova floating-ip-pool-list

nova-manage floating create --pool=[pool name] --ip_range=[your new IP]
Antonio G. gravatar imageAntonio G. ( 2014-10-21 09:45:30 -0500 )edit

Grand job. Thanks. I figured MySQL was a little over-complicated. :)

mickt gravatar imagemickt ( 2014-10-21 09:51:03 -0500 )edit

I believe this will work only with nova-network not neutron, right?

vthapar gravatar imagevthapar ( 2014-10-21 10:05:21 -0500 )edit

Probably. .

mickt gravatar imagemickt ( 2014-10-23 07:12:10 -0500 )edit

3 answers

Sort by ยป oldest newest most voted

answered 2014-10-21 09:46:43 -0500

vthapar gravatar image

updated 2014-12-01 03:53:49 -0500

You can use neutron subnet-update.

Let's say you want to add to and - as two non-contingous ranges to existing one. For your subnet this is how you'll do it:

neutron subnet-update ext-subnet --allocation-pools start=,end= --allocation-pools start=,end=

Note that this will only work with Juno or later as updating allocation_pools was fixed in Juno.

edit flag offensive delete link more


neutron subnet-update ext-subnet --allocation-pool start=,end=

Unrecognized attribute(s) 'allocation_pool'

mickt gravatar imagemickt ( 2014-10-21 09:53:59 -0500 )edit

Which version of openstack and neutron client you're using? I tried with neutron client version 2.3.10 and it worked for me.

vthapar gravatar imagevthapar ( 2014-10-21 10:02:16 -0500 )edit

Icehouse with v2.3.4

mickt gravatar imagemickt ( 2014-10-23 03:16:18 -0500 )edit

the option is --allocation-pools (plural). anyway, in icehouse the answer is "Cannot update read-only attribute allocation_pools". maybe it's working in juno....

sTe gravatar imagesTe ( 2014-11-12 05:40:17 -0500 )edit

Setting up juno now so I'll try and get back.

mickt gravatar imagemickt ( 2014-11-26 03:06:30 -0500 )edit

answered 2014-10-21 09:33:19 -0500

mickt gravatar image

Did in MySQL:

update ipallocationpools set last_ip="" where id="02b730f9-69cc-4cf1-929a-d0dc795a4a29";

Is this the only way to do so?

edit flag offensive delete link more


I tried this in havana and it works if you also update the ipavailabilityranges table (in neutron).

sTe gravatar imagesTe ( 2014-11-12 05:43:10 -0500 )edit

sTe is correct. You should update ipavailabilityranges table with subnet_id and the first and last ip available INSERT INTO ipavailabilityranges VALUES('c5ac3beb-1c1d-47a1-b092-b3cc955e8d68','','');

guimaluf gravatar imageguimaluf ( 2014-12-01 10:56:21 -0500 )edit

answered 2014-12-01 05:05:10 -0500

dbaxps gravatar image

Neutron API to solve multiple allocation pools allocation for single subnet :-

import logging
from neutronclient.neutron import client

auth_url = ""

neutron = client.Client('2.0', username="admin", password="password", tenant_name="admin", auth_url=auth_url)

print "".join(neutron.list_subnets())

req = {"subnet": {"allocation_pools": [{"start": "", "end": ""}, {"start": "", "end": ""}, {"start": "", "end": ""}]}}

neutron.update_subnet("d5d48930-7bfb-4f0c-8968-13f8af785868", req)
edit flag offensive delete link more


I'm the author of the blog :) thanks for providing a link back. Appreciated

Sam Stoelinga gravatar imageSam Stoelinga ( 2015-02-02 07:50:43 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-10-21 08:40:42 -0500

Seen: 17,048 times

Last updated: Dec 01 '14