[lxc-users] LXD with LVM backend

Austin austin.plunkett at gmail.com
Fri Oct 9 18:59:18 UTC 2015


Hi all.

I see from https://github.com/lxc/lxd/blob/master/specs/storage-backends.md
that LVM can be used as a backingstore with LXD.

I've previously managed to get LVM working with LXC. This was very
pleasing, since it allows me to control disk consumption. However I
can't work out how to achieve this with LXD.

>From what I understand, storage.lvm_vg_name must point to my volume
group. I've set this for a container by creating a profile, and
applying that profile to the container. The entire profile config
looks like this:

name: my-profile-name
config:
  raw.lxc: |
    storage.lvm_vg_name = lxc-volume-group
    lxc.start.auto = 1
    lxc.arch = amd64
    lxc.network.type = veth
    lxc.network.link = lxcbr0
    lxc.network.flags = up
    lxc.network.hwaddr = 00:16:3e:xx:xx:xx
    lxc.cgroup.cpu.shares = 1
    lxc.cgroup.memory.limit_in_bytes = 76895572
  security.privileged: "false"
devices: {}

The volume group should be available and working, according to
pvdisplay on the host box:

  --- Physical volume ---
  PV Name               /dev/sdc5
  VG Name               lxc-volume-group
  PV Size               21.87 GiB / not usable 3.97 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              5599
  Free PE               901
  Allocated PE          4698
  PV UUID               what-ever

However after applying the profile and starting the container, it
appears to be using file backing store:

me at my-box:~# ls /var/lib/lxd/containers/migratee/rootfs/
bin  boot  dev  etc  home  lib  lib64  lost+found  media  mnt  opt
proc  root  run  sbin  srv  sys  tmp  usr  var

What am I doing wrong?

Many thanks!


More information about the lxc-users mailing list