Working Debian turnkey steps
# pct create 102 local:vztmpl/debian-10-turnkey-core_16.1-1_amd64.tar.gz \
--features mknod=1,nesting=1,fuse=1 --ostype debian --storage=lvmthinCTVM \
--description "debian glusterfs" --hostname debiangluster --password "password" \
--onboot 1 --net0 name=eth0,bridge=vmbr0 --unprivileged=0
- Add the following lines to
/etc/pve/lxc/102.conf
for mounting a hard drive and char devices needed by the container to communicate with lvm.
lxc.autodev: 1
lxc.cgroup2.devices.allow: a
lxc.mount.entry: /dev/disk/by-id/ata-ST2000DM008-2FR102_ZFL1MDSK dev/sdc none bind,create=file 0 0
lxc.mount.entry: /dev/mapper/control dev/mapper/control none bind,create=file 0 0
lxc.mount.entry: /run/lvm run/lvm none bind,create=file 0 0
Failing Centos steps
# pct create 101 local:vztmpl/centos-8-default_20201210_amd64.tar.xz --features mknod=1,nesting=1,fuse=1 --ostype centos --storage=CTVM --description "centos glusterfs" --hostname thorgluster --password "password" --onboot 1 --net0 name=eth0,bridge=vmbr0 --unprivileged=0
- Install LVM on the container
# pct start 101
# pct enter 101
# cd /etc/yum.repos.d/
# sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
# sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
# dnf update
# dnf install lvm2
- Then edit
/etc/pve/lxc/101.conf
and add the same lines from above (copied here)
lxc.autodev: 1
lxc.cgroup2.devices.allow: a
lxc.mount.entry: /dev/disk/by-id/ata-ST2000DM008-2FR102_ZFL1MDSK dev/sdc none bind,create=file 0 0
lxc.mount.entry: /dev/mapper/control dev/mapper/control none bind,create=file 0 0
lxc.mount.entry: /run/lvm run/lvm none bind,create=file 0 0
- Then I get an error starting the container
# pct start 101
safe_mount: 1200 Not a directory - Failed to mount "/run/lvm" onto "/usr/lib/x86_64-linux-gnu/lxc/rootfs/run/lvm"
mount_entry: 2406 Not a directory - Failed to mount "/run/lvm" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/run/lvm"
lxc_setup: 4365 Failed to setup mount entries
do_start: 1274 Failed to setup container "101"
sync_wait: 34 An error occurred in another process (expected sequence number 3)
__lxc_start: 2068 Failed to spawn container "101"
startup for container '101' failed