[Openstack-operators] extend the ip address of subnet in Havana?
mgagne at iweb.com
Thu Oct 9 20:16:29 UTC 2014
On 2014-10-09 3:08 PM, raju wrote:
> I tried changing in DB but doesn't work, I see that Havana Neutron
> doesn't have option to expand subnet allocation pools
Neutron does not allow you to shrink or expand an existing allocation
pool, nor add allocation pools to an existing subnet.
From memory, there is more than one entry to update in Neutron database:
This is the subnet definition.
This is the allocation pool definition.
This is the ranges of IPs FREE in the allocation pool.
A. Update the subnet definition (if needed)
If the subnet netmask changes, you need to update the 'cidr' field in
the 'neutron.subnets' table with the new subnet definition.
This change won't:
- expand the existing subnet's allocation pool
- give you new IPs to use in instances
- change netmask already configured in existing instances.
This will only update the subnet definition.
B. Extending an allocation pool
You need to update the 'neutron.ipallocationpools' table to expand the
definition of the existing allocation pool.
Find the entry associated to the subnet and update the 'last_ip' field
with the new allocation range.
This won't give you new IPs but only update the allocation pool
definition. Makes sure the 'last_ip' does not go beyond the subnet
Now, to add new free IPs, you need to insert new entries in the
'neutron.ipavailabilityranges' table. This table contains *ranges* of
FREE IPs. Therefore you have to add a new range entry corresponding to
the existing subnet allocation pool (allocation_pool_id).
The 'first_ip' field corresponds to the first free ip of the new range
and 'last_ip' to the last free ip. This will give you new IPs available.
C. Add an allocation pool
Add a new entry in the 'neutron.ipallocationpools' table corresponding
to your new allocation pool definition. The 'id' field should be a NEW
*unique* uuid and 'subnet_id' the subnet to which you wish to add an
allocation pool. Make sure allocation pools don't overlap.
Then add a new entry in the 'neutron.ipavailabilityranges' table. Use
the previous uuid for the 'allocation_pool_id' field and the same values
in 'first_ip' and 'last_ip' fields as the ones put in
You will then have new IPs available.
Always *backup* your data and *test* in a development environment first.
More information about the OpenStack-operators