Ask Your Question
0

Multiple fixed address per instance

asked 2013-10-23 16:18:37 -0500

marcantonio gravatar image

updated 2014-05-14 05:55:44 -0500

darragh-oreilly gravatar image

Does anyone know if it's possible to add multiple fixed addresses to an instance?

I have a web application running on Apache that requires multiple IPs to be bound to it for SSL-based virtual hosts. I know that I can assign multiple floating addresses, but as the instance, and therefore Apache, knows nothing of these floating addresses, it doesn't get me anywhere. Ideally I would be able to assign a floating address to the instance which translates to a corresponding fixed address on the instance.

I'm currently using nova-network (Grizzly) with multiple compute nodes. Could Neutron help with this?

Thanks, Marc

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2013-10-24 10:14:02 -0500

darragh-oreilly gravatar image

updated 2014-05-14 05:54:06 -0500

I don't know much about nova-network or your Apache requirements. This answer is just for the last part of your question about neutron.

With Havana I was able to create a port and add two fixed_ips from the same subnet to it. Then pass this port to nova boot. In the instance I had to add the second IP to eth0 manually as the dhcp client didn't. Then I was able to create and associate a floating IP for each internal IP.

See http://paste.openstack.org/show/49514/

Update: actually it would be easier just to do this, and let Neutron allocate the IPs:

neutron port-create net1 \
    --fixed-ip subnet_id=2a9da468-73e0-4418-93de-69e00887b0ee \
    --fixed-ip subnet_id=2a9da468-73e0-4418-93de-69e00887b0ee

Also there is another way here.

edit flag offensive delete link more

Comments

I was thinking of something like this. It's cleaner than adding multiple networks, but it also takes configuration outside of OpenStack (manually adding IP's to instances). Thanks.

marcantonio gravatar imagemarcantonio ( 2013-10-24 10:20:50 -0500 )edit
1

What config is needed outside of openstack? Apache I guess, but there is going to be configuration needed no matter how you do it? I have added a paste of the steps.

darragh-oreilly gravatar imagedarragh-oreilly ( 2013-10-24 11:05:04 -0500 )edit

Oh, so neutron can actually assign multiple fixed IPs to the instance? I thought you were just manually adding the IP to the instance and telling the floating IP to redirect to it. I'm going to setup neutron right now and test it. Thanks!

marcantonio gravatar imagemarcantonio ( 2013-10-24 12:30:07 -0500 )edit

Well to be exact, neutron can assign multiple fixed ips to a _port_ on a neutron network. And the ips have to be from subnets of that network.

darragh-oreilly gravatar imagedarragh-oreilly ( 2013-10-24 12:56:13 -0500 )edit
1

answered 2013-10-23 21:35:41 -0500

dasp gravatar image

updated 2013-10-24 08:35:48 -0500

It is possible to add an instance to multiple networks. This would give the instance multiple fixed addresses to which you can assign floating IP addresses. This seems to be the only way, although it requires you to set up routers and subnets for each new network.

That seems to be the only way to get multiple fixed IP addresses straight from Horizon. There might another way using nova/neutron CLI. You can try using quantum floatingip-associate.

It takes two arguments:

positional arguments:
  FLOATINGIP_ID         ID of the floating IP to associate
  PORT                  ID or name of the port to be associated with the
                        floatingip

So you would put the floating IP ID as a first argument (find it first by quantum floatingip-list) and the port as second (find it with quantum port-list").

edit flag offensive delete link more

Comments

Thanks. Unfortunately, I can't "map" a specific floating IP to an instance IP. I believe nova would still DNAT the traffic to the first instance IP.

marcantonio gravatar imagemarcantonio ( 2013-10-24 08:22:35 -0500 )edit

Horizon gives you an option to choose which port this floating IP addresses is associated with. By choosing a port you are also choosing a fixed IP. It should come to the right interface on the VM.

dasp gravatar imagedasp ( 2013-10-24 08:24:44 -0500 )edit

I don't see a way to choose a port in Horizon. Are you using Grizzly?

marcantonio gravatar imagemarcantonio ( 2013-10-24 08:28:57 -0500 )edit
1

I just updated to Havana, so I am not sure it is there in Grizzly. Here is how it looks like (I know it doesn't really help you): http://i.dondaniello.com/2013-10-24_09-30-38_fS1R.png You might want to quantum CLI options - I'm updating the answers with a guide.

dasp gravatar imagedasp ( 2013-10-24 08:33:09 -0500 )edit

Thanks a lot @DanielS! I'm not crazy about the idea of creating a new network for each IP I need to add, but this is definitely an option.

marcantonio gravatar imagemarcantonio ( 2013-10-24 09:31:26 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2013-10-23 16:18:37 -0500

Seen: 4,256 times

Last updated: May 14 '14