I like LXC than LXD for a simple use.

Roughly speaking, LXD is an enhanced version of LXC with management functions to make it easier to use for large-scale operations. When used by individuals as a simple virtual machine, the functions of LXD may seem somewhat expensive. For this reason, I mainly use LXC instead of LXD. The details are described as follows.

Storage (Area for files in a container)

LXC

The files in a container are placed under /var/lib/lxc/[container name]/rootfs on the host OS as they are. From the host's perspective, it is like file sharing by default.

LXD

By default, LXD creates a storage pool file for loop-back mount on the host OS. At the point, the file has to be fixed (E.g. 100GiB).

Becase this stoge pool file is thin-provisioning This storage pool file is thin provisioned, so its initial size is 0. It increase as it's used. However, the file size never reduces when a container or a file in a container is deleted. This is stressful for personal use. Although the storage pool file can be expanded, deciding how much the maximum size should be at the beginning is a difficult task.
Partitioning, such as btrfs on a storage pool loopback file, has some advantages, such as fast snapshot and container copying. However, in my usage, I have little use for taking snapshots while it is running. The containers themselves are not that bloated, so even if I have to copy them, it only takes a short wait. Therefore, I can't take advantage of these benefits nearly as much.

The same thing is also possible with LXC. Just create a user's own loopback mount file, formats it with btrfs, and sets rootfs on top of it.

Configuration

LXC

All configurations are in a file: /var/lib/lxc/[container name]/config. When a user changes a configuration, he/she just edits this one text file. A use can also save the configuration by backing up this file.

LXD

Commands such as `lxc config` can be used. It is a little inconvenient to load and save all configuration at once.

How to install

LXC

It can be installed with the default installer `apt` on Debian and Ubuntu.

LXD

It can be provided by snap. snap is not so major. Using multiple package management system makes a system complicated and is not happy.Roughly speaking, LXD is an enhanced version of LXC with management functions to make it easier to use for large-scale operations. When used by individuals as a simple virtual machine, the functions of LXD may seem somewhat expensive. For this reason, I mainly use LXC instead of LXD. The details are described as follows.

Storage (Area for files in a container)

LXC

The files in a container are placed under /var/lib/lxc/[container name]/rootfs on the host OS as they are. From the host's perspective, it is like file sharing by default.

LXD

By default, LXD creates a storage pool file for loop-back mount on the host OS. At the point, the file has to be fixed (E.g. 100GiB).

Becase this stoge pool file is thin-provisioning This storage pool file is thin provisioned, so its initial size is 0. It increase as it's used. However, the file size never reduces when a container or a file in a container is deleted. This is stressful for personal use. Although the storage pool file can be expanded, deciding how much the maximum size should be at the beginning is a difficult task.
Partitioning, such as btrfs on a storage pool loopback file, has some advantages, such as fast snapshot and container copying. However, in my usage, I have little use for taking snapshots while it is running. The containers themselves are not that bloated, so even if I have to copy them, it only takes a short wait. Therefore, I can't take advantage of these benefits nearly as much.

The same thing is also possible with LXC. Just create a user's own loopback mount file, formats it with btrfs, and sets rootfs on top of it.

Configuration

LXC

All configurations are in a file: /var/lib/lxc/[container name]/config. When a user changes a configuration, he/she just edits this one text file. A use can also save the configuration by backing up this file.

LXD

Commands such as `lxc config` can be used. It is a little inconvenient to load and save all configuration at once.

How to install

LXC

It can be installed with the default installer `apt` on Debian and Ubuntu.

LXD

It can be provided by snap. snap is not so major. Using multiple package management system makes a system complicated and is not happy.

No comments:

Post a Comment