openstack team mailing list archive
-
openstack team
-
Mailing list archive
-
Message #20637
Re: Single IP Pool and Multiple Tenant
On Feb 1, 2013, at 8:24 PM, Umar Draz <unix.co@xxxxxxxxx> wrote:
> So this is not possible that create a dedicated floating ip pools that share all tenant.
>
> I have 128 ip pools and different tenant, I don't want a tenant hold the ip even if its not needed. I want a central pool every tenant should acquire the ip address from that pool.
>
> Br.
>
> Umar
This is exactly what is happening. I think you have a basic misunderstanding of how floating ips work. The purpose of a floating ip is to be able to move it from one server to another (hence the term floating). A project therefore must explicitly reserve an ip before using it and unreserve it when it is finished. The reserve command is:
nova floating-ip-create
# returns an <address>
This will pick an address from the pool and reserve it for the project. The project is then free to associate it with a server:
nova add-floating-ip <server> <address>
If the project then wants to remove the floating ip:
nova remove-floating-ip <server> <address>
And associate it with another server:
nova add-floating-ip <other-server> <address>
When the project is done with the floating ip it should unreserve it (which returns it to the pool):
nova floating-ip-delete <address>
In the cloud world instances are ephemeral. Floating ips are designed to last beyond the length of an individual server. Note that the reservation is necessary so that:
a) a user knows a floating ip that he/she can use
b) another user doesn't 'steal' the floating ip during the remove/add process.
This is the standard way that floating ips work (and is equivalent to elastic ips in aws) so it shouldn't be hard to explain to your users to do it this way.
You could modify the code in various ways to automatically reserve/unreserve ips for you, but I think this will be very confusing and annoying to your users. One possible compromize is to have a periodic db check for ips that haven't been used for a while and automatically return them to the pool.
It seems like what you really want is:
auto_assign_floating_ip=True # automatically assign a floating ip to every instance
This saves the users from having to do any manual management of floating ips. It sounds like you don't really want "floating" ips anyway.
Vish
Follow ups
References