The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/2934
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
From 99cbf19319639178f3e53ce5095ab0e9be10a668 Mon Sep 17 00:00:00 2001 From: Christian Brauner <christian.brau...@ubuntu.com> Date: Thu, 23 Feb 2017 02:19:24 +0100 Subject: [PATCH] doc: add client tool illustration for storage api Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com> --- doc/storage-backends.md | 89 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/doc/storage-backends.md b/doc/storage-backends.md index 0622fec..bdb4253 100644 --- a/doc/storage-backends.md +++ b/doc/storage-backends.md @@ -36,16 +36,67 @@ rsync is used to transfer the container content across. all the others due to it having to unpack images or do instant copies of containers, snapshots and images. +#### The following commands can be used to create directory storage pools + +- Create a new directory pool called "pool1". + +``` +lxc storage create pool1 dir +``` + ### Btrfs - Uses a subvolume per container, image and snapshot, creating btrfs snapshots when creating a new object. - When using for nesting, the host btrfs filesystem must be mounted with the "user\_subvol\_rm\_allowed" mount option. +#### The following commands can be used to create BTRFS storage pools + +- Create loop-backed pool named "pool1". + +``` +lxc storage create pool1 btrfs +``` + +- Create a btrfs subvolume named "pool1" on the btrfs filesystem "/some/path" and use as pool. + +``` +lxc storage create pool1 btrfs source=/some/path +``` + + +- Create a new pool called "pool1" on "/dev/sdX". + +``` +lxc storage create pool1 zfs source=/dev/sdX +``` + + + ### LVM - Uses LVs for images, then LV snapshots for containers and container snapshots. - The filesystem used for the LVs is ext4 (can be configured to use xfs instead). +#### The following commands can be used to create LVM storage pools + +- Use the existing volume group "my-pool" + +``` +lxc storage create pool1 lvm source=my-pool +``` + +- Create new pool named "pool1" on "/dev/sdX". + +``` +lxc storage create pool1 lvm source=/dev/sdX +``` + +- Create new pool on "/dev/sdX" with the volume group name "my-pool". + +``` +lxc storage create pool1 lvm source=/dev/sdX lvm.vg_name=my-pool +``` + ### ZFS - Uses ZFS filesystems for images, then snapshots and clones to create containers and snapshots. @@ -71,3 +122,41 @@ rsync is used to transfer the container content across. - Note that LXD will assume it has full control over the zfs pool or dataset. It is recommended to not maintain any non-LXD owned filesystem entities in a LXD zfs pool or dataset since LXD might delete them. + +#### The following commands can be used to create ZFS storage pools + +- Create a loop-backed pool named "pool1". + +``` +lxc storage create pool1 zfs +``` + +- Create a loop-backed pool named "pool1" with the on-disk name "my-tank". + +``` +lxc storage create pool1 zfs zfs.pool_name=my-tank +``` + +- Use the existing pool "my-tank". + +``` +lxc storage create pool1 zfs source=my-tank +``` + +- Use the existing dataset "my-tank/slice". + +``` +lxc storage create pool1 zfs source=my-tank/slice +``` + +- Create a new pool called "pool1" on "/dev/sdX". + +``` +lxc storage create pool1 zfs source=/dev/sdX +``` + +- Create a new pool on "/dev/sdX" with the on-disk name "my-tank". + +``` +lxc storage create pool1 zfs source=/dev/sdX zfs.pool_name=my-tank +```
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel