[Openstack] How to configure the interfaces file using cloud-init (meta-data) or any other way?

Amit Uniyal auniyal61 at gmail.com
Tue Jun 6 04:54:47 UTC 2017


Hi Jorge,

You can use heat template to launch these type of VM's, The user data to
edit interface file can be:

user_data:
    #!/bin/bash
    sudo echo >> /etc/network/interfaces
    sudo echo auto ens3 >> /etc/network/interfaces
    sudo echo iface ens3 inet dhcp >> /etc/network/interfaces
    sudo echo iface ens3 inet6 auto >> /etc/network/interfaces
    sudo echo pre-up sleep 5 >> /etc/network/interfaces
    sudo echo dhcp 1 >> /etc/network/interfaces



Regards

On Tue, Jun 6, 2017 at 1:05 AM, Jorge Luiz Correa <correajl at gmail.com>
wrote:

> I need to customize/configure the file /etc/network/interfaces (or
> 50-cloud-init.cfg) from Ubuntu and Debian cloud images. My environment uses
> IPv6 with stateless configuration so I have replace this:
>
> --- generated by cloud-init ---
> auto lo
> iface lo inet loopback
>
> auto ens3
> iface ens3 inet dhcp
> ---
>
> with this:
>
> ---
> auto lo
> iface lo inet loopback
>
> auto ens3
> iface ens3 inet dhcp
> iface ens3 inet6 auto
>   pre-up sleep 5
>   dhcp 1
> ---
>
> This configuration makes the instance generate theis IPv6s and get others
> configurations from DHCPv6. The 'sleep' is due a Ubuntu bug.
>
> How can I do that?
>
> I need to customize the image before upload to OpenStack? Is there any way
> to pass this configuration at boot time? Is there any way to force all
> instances to have this configuration?
>
> I appreciate any help!
>
> Thanks.
>
> - JLC
>
> _______________________________________________
> 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/20170606/facbce4b/attachment.html>


More information about the Openstack mailing list