Ask Your Question
1

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      | 10.10.12.0/24   | {"start": "10.10.12.231", "end": "10.10.12.235"}   |
+--------------------------------------+-----------------+-----------------+----------------------------------------------------+

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

Comments

Simply:

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
2

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 10.10.12.200 to 10.10.12.210 and 10.10.12.220 - 10.10.12.230 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=10.10.12.200,end=10.10.12.210 --allocation-pools start=10.10.12.220,end=10.10.12.230

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

edit flag offensive delete link more

Comments

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

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
2

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

mickt gravatar image

Did in MySQL:

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

Is this the only way to do so?

edit flag offensive delete link more

Comments

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','192.168.6.11','192.168.6.59');

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

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

dbaxps gravatar image

Neutron API to solve multiple allocation pools allocation for single subnet :-
http://samos-it.com/posts/neutron-mul...

import logging
from neutronclient.neutron import client

auth_url = "http://192.168.33.11:5000/v2.0"

logging.basicConfig(level=logging.DEBUG)
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": "10.0.2.3", "end": "10.0.2.15"}, {"start": "10.0.2.17", "end": "10.0.2.17"}, {"start": "10.0.2.19", "end": "10.0.2.254"}]}}

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

Comments

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

Stats

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

Seen: 14,299 times

Last updated: Dec 01 '14