How to create a Floating IP pool and how to associate one of the floating IP's from the pool to a port on a VM

Asked by Ritesh Shetty

How to create a Floating IP pool and how to associate one of the floating IP's from the pool to a port on a VM

Question information

Language:
English Edit question
Status:
Solved
For:
neutron Edit question
Assignee:
No assignee Edit question
Solved by:
Salvatore Orlando
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
dan wendlandt (danwent) said :
#1

http://docs.openstack.org/trunk/openstack-network/admin/content/l3_workflow.html

On Tue, Apr 2, 2013 at 11:06 AM, Ritesh Shetty <
<email address hidden>> wrote:

> New question #225720 on quantum:
> https://answers.launchpad.net/quantum/+question/225720
>
> How to create a Floating IP pool and how to associate one of the floating
> IP's from the pool to a port on a VM
>
> --
> You received this question notification because you are an answer
> contact for quantum.
>

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dan Wendlandt
Nicira, Inc: www.nicira.com
twitter: danwendlandt
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Revision history for this message
Ritesh Shetty (ritesh-s-shetty) said :
#2

Hi Dan,
I had searched this page but i guess this example shows how to create a single floating ip and then how to associate it to the port.

quantum floatingip-associate <floatingip-id> <internal VM port-id>

I thought there is a feature where you can create a pool and then probably just give the pool id and port id and quantum would then pick one of the free floating ip's from the pool and attach it to the port

i am assuming <floatingip-id> is the id of the exact floating ip i want to attach ?

Revision history for this message
Aaron Rosen (arosen) said :
#3

>i am assuming <floatingip-id> is the id of the exact floating ip i want to attach ?
Yup

You can also do this via the client to create and assoicate in one shot:
quantum floatingip-create public --port-id <port_id>

Revision history for this message
Ritesh Shetty (ritesh-s-shetty) said :
#4

So is there no way to create a pool and use pool id while associating it to a port?

Revision history for this message
yong sheng gong (gongysh) said :
#5

I think you are trying to apply nova concept to quantum.
regarding pool, quantum's correspondence is external network and its subnets.
quantum net-create externalnet --router:external true
quantum subnet-create externalnet 192.168.1.0/24 --name externalsubnet

This way, we have created a 'pool' of floating ips
then you create one floatingip from it:
quantum floatingip-create externalnet
and then associate it with one port:
quantum floatingip-associate [-h] [--request-format {json,xml}]
                                    [--fixed-ip-address FIXED_IP_ADDRESS]
                                    FLOATINGIP_ID PORT
or u can do these two steps by one shot:
usage: quantum floatingip-create [-h] [-f {html,json,shell,table,yaml}]
                                 [-c COLUMN] [--variable VARIABLE]
                                 [--prefix PREFIX]
                                 [--request-format {json,xml}]
                                 [--tenant-id TENANT_ID] [--port-id PORT_ID]
                                 [--fixed-ip-address FIXED_IP_ADDRESS]
                                 FLOATING_NETWORK

Create a floating ip for a given tenant.

positional arguments:
  FLOATING_NETWORK Network name or id to allocate floating IP from

optional arguments:
  -h, --help show this help message and exit
  --request-format {json,xml}
                        the xml or json request format
  --tenant-id TENANT_ID
                        the owner tenant ID
  --port-id PORT_ID ID of the port to be associated with the floatingip
  --fixed-ip-address FIXED_IP_ADDRESS
                        IP address on the port (only required if port has
                        multipleIPs)

Revision history for this message
Ritesh Shetty (ritesh-s-shetty) said :
#6

Thanks yong sheng gong, that solved my question.

Revision history for this message
Ritesh Shetty (ritesh-s-shetty) said :
#7

1 thing i forgot to ask was ..

in the above example a subnet was created for external network but was never used

quantum subnet-create externalnet 192.168.1.0/24 --name externalsubnet

The network id is directly used to create floating IP
quantum floatingip-create externalnet

Now does this mean i can just have i subnet from which floating ip's are getting created or there is a mechanism to specify subnet id while creating floating ip.

Revision history for this message
Best Salvatore Orlando (salvatore-orlando) said :
#8

Hi Ritesh,

you should have only 1 subnet on the external network. Quantum will not complain if you define more than one, but only the first is used to allocate floating IPs (and to allocate the external gateway's IP)

Revision history for this message
Ritesh Shetty (ritesh-s-shetty) said :
#9

Thanks Salvatore Orlando, that solved my question.