This document will offer an Ubuntu Server-specific view of LXD, focusing on administration.
Installation
LXD is pre-installed on Ubuntu Server cloud images. On other systems, the lxd package can be installed
using:
sudo snap i n s t a l l l x d
This will install the self-contained LXD snap package.
Kernel preparation
In general, Ubuntu should have all the desired features enabled by default. One exception to this is that
in order to enable swap accounting the boot argument swapaccount=1 must be set. This can be done by
appending it to the GRUB_CMDLINE_LINUX_DEFAULT=variable in /etc/default/grub, then running
‘update-grub’ as root and rebooting.
Configuration
In order to use LXD, some basic settings need to be configured first. This is done by running lxd init , which
will allow you to choose:
• Directory or ZFS container backend. If you choose ZFS, you can choose which block devices to use, or
the size of a file to use as backing store.
• Availability over the network.
• A ‘trust password’ used by remote clients to vouch for their client certificate.
You must run ‘lxd init’ as root. ‘lxc’ commands can be run as any user who is a member of group lxd. If
user joe is not a member of group ‘lxd’, you may run:
a d d us er j o e l x d
as root to change it. The new membership will take effect on the next login, or after running newgrp lxd
from an existing login.
For more information on server, container, profile, and device configuration, please refer to the definitive
configuration provided with the source code, which can be found online.
Do'stlaringiz bilan baham: