[Openstack] Static IP on lunching an instance

Jonathan Proulx jon at jonproulx.com
Wed Dec 10 14:59:26 UTC 2014


On Wed, Dec 10, 2014 at 12:19 AM, Venu Murthy <venu.murthy at thoughtworks.com>
wrote:

> This command should help nova add-fixed-ip <server> <network-id> or you
> can specify the static ip that has been created in the nova boot command
> this link should help
>
> https://ask.openstack.org/en/question/30690/add-multiple-specific-ips-to-instance/
>
>
>
That might do what you want (there's equivalents you can do at launch to
specify fixed IP and even MAC if you need to for example on a license
server), but while you'll know the IP in advance it still relies on
OpenStack's DHCP service to get that IP into the VM.  We use this quite a
lot and it works well, is accesable from the the API, CLI and Heat
templates.  We even kludged a little addition to the Horizon launch
workflow (I can provide it as an example but isn't very robust ).

But, if you are  really looking to avoid DHCP (rather than just the dynamic
IP part) you'll need to s things a bit differently.  I've not tried this,
but I think using a 'config drive' and passing in a user data script to
statically configure the interface(s) would be the way to go, note you'll
need cloud-init (or a similar script) in the image to execute the user data
and you can't rely on the metadata service because that relies on the
network being setup so it can reach the metadata server over http.

-Jon


>
> On Tue, Dec 9, 2014 at 11:08 PM, Martin Lipka <Martin.Lipka at pulsant.com>
> wrote:
>
>>  Hi,
>>
>>  I would like to assign a static IP/subnet and the gateway of my choice
>> to an instance (both windows and linux) while lunching it instead of using
>> built-in DHCP.
>> What are my options in OpenStack to achieve it?
>>
>>  Regards,
>> Martin
>>       This email and any files transmitted with it are confidential and
>> intended solely for the use of the individual or entity to whom they are
>> addressed. If you have received this email in error please notify the
>> sender. Any offers or quotation of service are subject to formal
>> specification. Errors and omissions excepted. Please note that any views or
>> opinions presented in this email are solely those of the author and do not
>> necessarily represent those of Pulsant Limited or any companies within the
>> wider group. Finally, the recipient should check this email and any
>> attachments for the presence of viruses. Pulsant Limited accept no
>> liability for any damage caused by any virus transmitted by this email.
>>
>> _______________________________________________
>> Mailing list:
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
>> Post to     : openstack at lists.openstack.org
>> Unsubscribe :
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
>>
>>
>
> _______________________________________________
> Mailing list:
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
> Post to     : openstack at lists.openstack.org
> Unsubscribe :
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20141210/0009e421/attachment.html>


More information about the Openstack mailing list