[lxc-users] Looking for LXD-2.4.1 Static IP Setup Documentation

Caleb Everett caleb at calebeverett.io
Wed Oct 19 19:22:25 UTC 2016


https://github.com/lxc/lxd/issues/2050

On Wed, Oct 19, 2016 at 4:37 AM, Nicola Volpini <nicola.volpini at kambi.com>
wrote:

> Hello
> > ATM what I do is either use dnsmasq to provide DHCP or stop the
> > container and push a preconfigured interfaces file...
> >
> > lxc file push interfaces.tmp CONTAINER/etc/network/interfaces
> Same approach we are using, but with Ansible as our
> "bootstrapper/configurer".
>
> I've been successfully able to do the following:
>
> 1. generate instance-specific config in the form of a cloud-init file
> 2. create container
> 3. take down network on the container by running lxc exec ... ifdown -a
> 4. generate the container's nw config file on the LXD host via ansible
> and push it to the container via "lxc push" (and remove the default
> configs if necessary)
> 5. bring up network on the container by running lxc exec ... ifup -a
>
> The cloud-init config is used to inject the ssh key, setup the ssh
> daemon+config and create an ansible-remote user. That user is necessary
> for ansible to do later more complex configs by directly accessing the
> container over ssh, as you would do for a normal ansible host.
>
> Something cleaner would be cool, possibly integrated in cloud-init itself.
>
> I guess this is somehow possible by creating your custom images and
> customizing the templates section of the metadata.yaml file, as outlined
> in the last part of this article
> https://www.stgraber.org/2016/03/30/lxd-2-0-image-management-512/
>
> CONFIDENTIALITY NOTICE: This email message (and any attachment) is
> intended only for the individual or entity to which it is addressed. The
> information in this email is confidential and may contain information that
> is legally privileged or exempt from disclosure under applicable law. If
> you are not the intended recipient, you are strictly prohibited from
> reading, using, publishing or disseminating such information and upon
> receipt, must permanently delete the original and destroy any copies. We
> take steps to protect against viruses and other defects but advise you to
> carry out your own checks and precautions as Kambi does not accept any
> liability for any which remain. Thank you for your co-operation.
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20161019/d847a83b/attachment.html>


More information about the lxc-users mailing list