[Openstack] Static IP on lunching an instance

Don Waterloo don.waterloo at gmail.com
Thu Dec 11 04:11:40 UTC 2014


On 9 December 2014 at 12:38, 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,
> Marti
>

If using Heat, you can allocate the port.

  pts_ctrl_port:
    type: OS::Neutron::Port
    properties:
      name: {"Fn::Join": ["-", [{ get_param: "OS::stack_name" } ,
"pts-port"]]}
      network_id: { get_resource: ctrl_net }
      fixed_ips:
        - ip_address: 172.16.1.13

  pts:
    type: OS::Nova::Server
    properties:
      name: { str_replace: { params: { $stack_name: { get_param:
'OS::stack_name' } }, template: '$stack_name-pts' } }
      key_name: { get_param: 'ssh_key' }
      image: { get_param: 'pts_image' }
      flavor: "sv.pts"
      networks:
        - port: { get_resource: pts_ctrl_port }

in this case the dnsmasq will assign the ip you reuquested if you do DHCP,
or you can assign manually in the image w/o conflict.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20141210/097f6f5b/attachment.html>


More information about the Openstack mailing list