I think you would need to allow access from your LXC to DRBD's major/minor device numbers, and maybe the low-level devices' ones too (not sure about that last one).

Out of curiosity, may I ask for some details about what you're trying to achieve? In case it helps to kown that, we've been doing it the other way round (LXCs inside DRBD containers) with little difficulty.

Lionel Sausin.

Le 20/01/2014 16:08, Jeremiah Snapp a écrit :
Can DRBD work in LXC Container?

I already asked this in LXC-Users but they weren't sure.

I saw the following message which gave me the vague impression DRBD could be done in a container.

http://lists.linbit.com/pipermail/drbd-dev/2011-March/001426.html

I have the DRBD module loaded in the host.

But when I try to attach the resource it says it can't connnect to 'drbd' generic netlink family. Can someone please explain to me what it the 'drbd' generic netlink family even is?
And how to get access to it from inside an LXC container?

As you can see in my LXCX container's config I have app armor unconfined and no lxc.devices entries so I'm hoping that I've removed as many restrictions that might block access.

The following was run from inside the container.

root@saucy:~# service drbd status
drbd driver loaded OK; device status:
version: 8.4.3 (api:1/proto:86-101)
srcversion: 5CF35A4122BF8D21CC12AE2
m:res  cs  ro  ds  p  mounted  fstype

root@saucy:~# drbdadm attach pc0
Could not connect to 'drbd' generic netlink family
Command 'drbdsetup attach 0 /dev/loop1 /dev/loop1 internal --resync-rate=40M' terminated with exit code 20

Here's the container's LXC config.

lxc.aa_profile = unconfined
lxc.mount = /var/lib/lxc/saucy/fstab
lxc.mount.entry = proc proc proc nodev,noexec,nosuid 0 0
lxc.mount.entry = sysfs sys sysfs defaults 0 0
lxc.mount.entry = /sys/fs/fuse/connections sys/fs/fuse/connections none bind,optional 0 0 lxc.mount.entry = /sys/kernel/debug sys/kernel/debug none bind,optional 0 0 lxc.mount.entry = /sys/kernel/security sys/kernel/security none bind,optional 0 0
lxc.mount.entry = /sys/fs/pstore sys/fs/pstore none bind,optional 0 0
lxc.tty = 4
lxc.pts = 1024
lxc.devttydir = lxc
lxc.arch = x86_64
lxc.utsname = saucy
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = lxcbr0
lxc.network.hwaddr = 00:16:3e:f8:ca:e6
lxc.cap.drop = sys_module
lxc.cap.drop = mac_admin
lxc.cap.drop = mac_override
lxc.cap.drop = sys_time
lxc.rootfs = /var/lib/lxc/saucy/rootfs
lxc.pivotdir = lxc_putold

Thanks in advance,
Jeremiah


_______________________________________________
drbd-user mailing list
[email protected]
http://lists.linbit.com/mailman/listinfo/drbd-user

_______________________________________________
drbd-user mailing list
[email protected]
http://lists.linbit.com/mailman/listinfo/drbd-user

Reply via email to