OdooGap Blog / The LXD container hypervisor

The LXD container hypervisor

10x the density of ESX, 25% faster, with zero latency

It has been a while since I've been waiting for LXC to be stable enough to use in production. Let me tell you why I think that: LXD works like a daemon for LXC, it allows you to establish a communication handshake between your LXC client and any machine you have with LXD hosting several containers.

Lightweight and simple, just pop your command-line client and start creating, starting, stopping, cloning and snapshotting. Moving containers between LXD hosts is just as easy and performant. Here are the main LXD advantages:

Secure by design (unprivileged containers, resource restrictions and much more)

Scalable (from containers on your laptop to thousands of compute nodes)

Intuitive (simple, clear API and crisp command line experience)

Image-based (no more distribution templates, only good, trusted images)

If you’re using Ubuntu 16.04 LTS, start by:

$> sudo lxd init

If that's not enough, try also:

$> sudo apt-get install lxd

This will install the LXD daemon, client tools and also LXC. LXD is not a replacement for LXC, it's just a daemon and a new set of client libraries and tools that allow you to manage remote servers hosting the containers.

Now you can create a new container:

$> lxc create odoo1

Or in a remote host:

$> lxc create host1:odoo1

List existing containers:

$> lxc list host1:

Get access to the container's console:

$> lxc exec host1:odoo1 bash

Lots of other commands just use --help

$> lxc --help

* config - Manage configuration

* copy - Copy containers within or in between lxd instances.

* delete - Delete containers or container snapshots.

* exec - Execute the specified command in a container.

* file - Manage files on a container.

* help - Presents details on how to use LXD.

* image - Manipulate container images.

* info - List information on LXD servers and containers.

* launch - Launch a container from a particular image.

* list - Lists the available resources.

* move - Move containers within or in between lxd instances.

* profile - Manage configuration profiles.

* publish - Publish containers as images.

* remote - Manage remote LXD servers.

* restart - Changes state of one or more containers to restart.

* restore - Set the current state of a resource back to a snapshot.

* snapshot - Create a read-only snapshot of a container.

* start - Changes state of one or more containers to start.

* stop - Changes state of one or more containers to stop.

* version - Prints the version number of this client tool.

For the remote host, you need to do the following to get access:

lxc config set core.https_address "[::]"

lxc config set core.trust_password some-password

I hope this post gets you pumped enough for trying LXD, we sure love the concept and will be trying this "stable version" on test servers first ;)