• lxd and adjusting size of root device

    That’s normal. With LXD 2.9 and the storage pool changes, LXD stopped generating automatic «root» devices for the containers, instead relying on inheritance from the default profile.

    So in LXD < 2.9, every container had a local «root» device which you could then set properties directly on. With those LXD versions, adding a «root» device to your default profile would be entirely ignored as all containers would override it.

    In LXD > 2.9, containers don’t have any devices by default, they instead rely on inheritance. Meaning that if you want to override it, you have to add a new device to the container with the same name so that it overrides the one coming from the profiles.

    «lxc config show NAME» vs ” lxc config show –expanded NAME ” is pretty useful to see how this all works.

    © https://discuss.linuxcontainers.org/u/stgraber

  • Building an LXC Server

    Building an LXC Server on Ubuntu with ZFS and a container with public IP address

    First update Ubuntu

    Setup ZFS

    Configure LXC

    Configure ZFS

    Create ZFS pool:

    Keep in mind that deduplication takes much more memory and sometimes CPU.

    The rule of Thumb says to have 1GB of Ram per TB of Data. For deduplicated ZPools you actually should have 5 GB of Ram for 1TB of Data. I don’t use it.

    Turn on compression and create fs:

    To configure LXC to use ZFS as the backing store and set the default LXC path, add the following to /etc/lxc/lxc.conf:

    Creating a Container

    Create the first container by doing:

    Setup Bridged Network

    Important Commands

    Show bridge interfaces:

    Simple Bridge

    This setup can be used to connect multiple network interfaces. The bridge acts as a switch: each additional network interface is directly connected to the physical network.

    Edit /etc/network/interfaces, remove eth0, add br0.

    For dynamic IP:

    For static IP:

    reboot server

    Is all OK?

    Edit /tank/lxc/containers/node.name/config

    start the node:

    connect to the node:

    On the lxc node /etc/network/interfaces:

    It’s possible to use static IP address in node config and use dhcp inside the node, that works too.

    But IPv6 didn’t work inside the node, I disabled it and then the node stopped receiving IP address at all.

    I had to use static IP.

    I’m going to solve this problem later.