Re: [lxc-users] Setting up containers with multiple logical volumes

2014-02-18 Thread Joshua Schaeffer
Okay thanks for the pointers.  I'll be able to try this out tonight and
report back.


On Mon, Feb 17, 2014 at 10:30 PM, Serge Hallyn serge.hal...@ubuntu.comwrote:

 Quoting Serge Hallyn (serge.hal...@ubuntu.com):
  Quoting Joshua Schaeffer (jschaeffer0...@gmail.com):
   Yes it failed to start:
  
   1. lxc-create -n testme1 -t debian
   2. root@reaver:~# cat /var/lib/lxc/testme1/config | grep
 lxc.mount.entry
   lxc.mount.entry = proc proc proc nodev,noexec,nosuid 0 0
   lxc.mount.entry = sysfs sys sysfs defaults  0 0
   lxc.mount.entry = /dev/vg_lxc1/lv_ldap_tmp1 lv_ldap
   defaults,create=dir 0 0
 
  Wait a sec.  I mistyped.  There's no fstype in there :)
 
  That should be
 
  lxc.mount.entry = /dev/vg_lxc1/lv_ldap_tmp1 lv_ldap ext4
 defaults,create=dir 0 0
 
  or whatever fstype it is in place of ext4.  Sorry.

 Actually I see that will fail too, because 'create=dir' has a
 slight problem.  We need to remove create=dir from the mount
 options which we pass along to the mount syscall.

 so for the sake of testing just do

 lxc.mount.entry = /dev/vg_lxc1/lv_ldap_tmp1 mnt ext4 defaults 0 0

 -serge

___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] Setting up containers with multiple logical volumes

2014-02-17 Thread Joshua Schaeffer
I still can't get this to work, I'm sure I'm missing something simple or 
obvious. To recap, I'm trying to use an LVM logical volume for my 
container's /var and /tmp partitions. Since I've been unable to get this 
to work, I've just beenfocusing on getting /tmp to work.  I changed my 
mount points and my container's config:


Here are my logical volume onthe host:

root@reaver:~# lvdisplay /dev/vg_lxc1/lv_ldap_tmp1
  --- Logical volume ---
  LV Path /dev/vg_lxc1/lv_ldap_tmp1
  LV Namelv_ldap_tmp1
  VG Namevg_lxc1
  LV UUID GDru3y-oLJB-Iv06-tjv3-wHuq-p8Fi-xBUscf
  LV Write Accessread/write
  LV Creation host, time reaver, 2013-11-30 13:46:16 -0700
  LV Status  available
  # open 1
  LV Size4.00 GiB
  Current LE 1024
  Segments   1
  Allocation inherit
  Read ahead sectors auto
  - currently set to 256
  Block device   254:4

I've mounted this LV to: /mnt/lxc/ldap/tmp on the host.  I then changed 
my container's config file:


root@reaver:~# cat /var/lib/lxc/ldap_baneling/config |grep lxc.mount.entry
lxc.mount.entry= proc 
/var/lib/lxc/ldap_baneling/rootfs/proc procnodev,noexec,nosuid 
00
lxc.mount.entry= devpts 
/var/lib/lxc/ldap_baneling/rootfs/dev/pts devptsdefaults00
lxc.mount.entry= sysfs 
/var/lib/lxc/ldap_baneling/rootfs/sys sysfsdefaults00
#lxc.mount.entry= /mnt/lxc/ldap/var 
/var/lib/lxc/ldap_baneling/rootfs/var nonedefaults00
*lxc.mount.entry = /mnt/lxc/ldap/tmp 
/var/lib/lxc/ldap_baneling/rootfs/tmp   nonedefaults00*


When I start my container I don't see the new mount:

root@baneling:~# df -h
Filesystem  Size  Used Avail Use% Mounted on
tmpfs   3.1G 0  3.1G   0% /run/shm
rootfs   10G  537M  9.5G   6% /
tmpfs   801M   16K  801M   1% /run
tmpfs   5.0M 0  5.0M   0% /run/lock

Do, I need to put something in the container's fstab?

Thanks,
Josh

On 02/12/2014 05:02 PM, Alvaro Miranda Aguilera wrote:

sorry, i should have been more clear.

seems you are trying to mount /a into /a that won't work.

at those level, where are the logical volumes mounted?

Say you want to share

/media/lv1

into container as /media/lv1

then, the line should be:

lxc.mount.entry= /media/lv1 
/var/lib/lxc/ldap_baneling/rootfs/media/lv1none bind00


do you see the difference with your line?

if you have already mounted your lv inside the container, unmount it, 
mount it somewhere else, and try as I tell you, for me it works.


if you have time, I wrote this:

http://kikitux.net/lxc/lxc.html





On Wed, Feb 12, 2014 at 9:34 AM, Joshua Schaeffer 
jschaeffer0...@gmail.com mailto:jschaeffer0...@gmail.com wrote:


Based on the documentation I read, this can be the same, however
all I really care about is that the LV gets mounted to that
location on the host.


On Tue, Feb 11, 2014 at 1:13 PM, Alvaro Miranda Aguilera
kiki...@gmail.com mailto:kiki...@gmail.com wrote:


On Wed, Feb 12, 2014 at 4:11 AM, Joshua Schaeffer
jschaeffer0...@gmail.com mailto:jschaeffer0...@gmail.com
wrote:

lxc.mount.entry = /var/lib/lxc/ldap_baneling/rootfs/var
/var/lib/lxc/ldap_baneling/rootfs/var nonebind00
lxc.mount.entry= /var/lib/lxc/ldap_baneling/rootfs/tmp
/var/lib/lxc/ldap_baneling/rootfs/tmp nonebind00



you are mounting the same path in the same path?



___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
mailto:lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users



___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
mailto:lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users




___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users


___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users

Re: [lxc-users] Setting up containers with multiple logical volumes

2014-02-17 Thread Serge Hallyn
Quoting Joshua Schaeffer (jschaeffer0...@gmail.com):
 I still can't get this to work, I'm sure I'm missing something
 simple or obvious. To recap, I'm trying to use an LVM logical volume
 for my container's /var and /tmp partitions. Since I've been unable
 to get this to work, I've just beenfocusing on getting /tmp to work.
 I changed my mount points and my container's config:
 
 Here are my logical volume onthe host:
 
 root@reaver:~# lvdisplay /dev/vg_lxc1/lv_ldap_tmp1

Could you please create a new container, 'testme1', and just add to its
/var/lib/lxc/testme1/config the entry

lxc.mount.entry = /dev/vg_lxc1/lv_ldap_tmp1 lv_ldap defaults,create=dir 0 0

Then do

lxc-start -n testme1 -l trace -o testme1.out

and send testme1.out here (assuming that fails to start)?

thanks,
-serge
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users


Re: [lxc-users] Setting up containers with multiple logical volumes

2014-02-17 Thread Joshua Schaeffer

Yes it failed to start:

1. lxc-create -n testme1 -t debian
2. root@reaver:~# cat /var/lib/lxc/testme1/config | grep lxc.mount.entry
lxc.mount.entry = proc proc proc nodev,noexec,nosuid 0 0
lxc.mount.entry = sysfs sys sysfs defaults  0 0
lxc.mount.entry = /dev/vg_lxc1/lv_ldap_tmp1 lv_ldap 
defaults,create=dir 0 0

3. root@reaver:~# lxc-start -n testme1 -l trace -o testme1.out
lxc-start: No such file or directory - failed to mount 
'/dev/vg_lxc1/lv_ldap_tmp1' on '/usr/lib/x86_64-linux-gnu/lxc/lv_ldap'

lxc-start: failed to setup the mount entries for 'testme1'
lxc-start: failed to setup the container
lxc-start: invalid sequence number 1. expected 2
lxc-start: failed to spawn 'testme1'

Thanks,
Josh

On 02/17/2014 09:55 AM, Serge Hallyn wrote:

Quoting Joshua Schaeffer (jschaeffer0...@gmail.com):

I still can't get this to work, I'm sure I'm missing something
simple or obvious. To recap, I'm trying to use an LVM logical volume
for my container's /var and /tmp partitions. Since I've been unable
to get this to work, I've just beenfocusing on getting /tmp to work.
I changed my mount points and my container's config:

Here are my logical volume onthe host:

root@reaver:~# lvdisplay /dev/vg_lxc1/lv_ldap_tmp1

Could you please create a new container, 'testme1', and just add to its
/var/lib/lxc/testme1/config the entry

lxc.mount.entry = /dev/vg_lxc1/lv_ldap_tmp1 lv_ldap defaults,create=dir 0 0

Then do

lxc-start -n testme1 -l trace -o testme1.out

and send testme1.out here (assuming that fails to start)?

thanks,
-serge
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users


  lxc-start 1392656494.694 DEBUGlxc_conf - allocated pty '/dev/pts/12' 
(4/5)
  lxc-start 1392656494.695 DEBUGlxc_conf - allocated pty '/dev/pts/13' 
(6/7)
  lxc-start 1392656494.695 DEBUGlxc_conf - allocated pty '/dev/pts/14' 
(8/9)
  lxc-start 1392656494.695 DEBUGlxc_conf - allocated pty '/dev/pts/15' 
(10/11)
  lxc-start 1392656494.695 INFO lxc_conf - tty's configured
  lxc-start 1392656494.695 DEBUGlxc_console - using '/dev/tty' as 
console
  lxc-start 1392656494.695 DEBUGlxc_start - sigchild handler set
  lxc-start 1392656494.695 INFO lxc_start - 'testme1' is initialized
  lxc-start 1392656494.696 DEBUGlxc_cgroup - checking '/' (rootfs)
  lxc-start 1392656494.696 DEBUGlxc_cgroup - checking '/sys' (sysfs)
  lxc-start 1392656494.696 DEBUGlxc_cgroup - checking '/proc' (proc)
  lxc-start 1392656494.696 DEBUGlxc_cgroup - checking '/dev' (devtmpfs)
  lxc-start 1392656494.696 DEBUGlxc_cgroup - checking '/dev/pts' 
(devpts)
  lxc-start 1392656494.696 DEBUGlxc_cgroup - checking '/run' (tmpfs)
  lxc-start 1392656494.696 DEBUGlxc_cgroup - checking '/' (xfs)
  lxc-start 1392656494.696 DEBUGlxc_cgroup - checking '/sys/fs/selinux' 
(selinuxfs)
  lxc-start 1392656494.696 DEBUGlxc_cgroup - checking '/run/lock' 
(tmpfs)
  lxc-start 1392656494.696 DEBUGlxc_cgroup - checking '/boot' (ext4)
  lxc-start 1392656494.696 DEBUGlxc_cgroup - checking '/tmp' (xfs)
  lxc-start 1392656494.696 DEBUGlxc_cgroup - checking '/var' (xfs)
  lxc-start 1392656494.696 DEBUGlxc_cgroup - checking '/sys/fs/cgroup' 
(cgroup)
  lxc-start 1392656494.696 INFO lxc_cgroup - [1] found cgroup mounted 
at 
'/sys/fs/cgroup',opts='rw,relatime,perf_event,blkio,net_cls,freezer,devices,memory,cpuacct,cpu,cpuset,clone_children'
  lxc-start 1392656494.696 DEBUGlxc_cgroup - get_init_cgroup: found 
init cgroup for subsys (null) at /


  lxc-start 1392656494.696 DEBUGlxc_cgroup - cgroup /sys/fs/cgroup has 
flags 0x2
  lxc-start 1392656494.725 INFO lxc_cgroup - created cgroup 
'/sys/fs/cgroup//lxc/testme1'
  lxc-start 1392656494.725 DEBUGlxc_cgroup - checking 
'/var/lib/nfs/rpc_pipefs' (rpc_pipefs)
  lxc-start 1392656494.773 DEBUGlxc_start - Dropped cap_sys_boot

  lxc-start 1392656494.773 INFO lxc_conf - 'testme1' hostname has been 
setup
  lxc-start 1392656494.773 DEBUGlxc_conf - mounted 
'/var/lib/lxc/testme1/rootfs' on '/usr/lib/x86_64-linux-gnu/lxc'
  lxc-start 1392656494.774 DEBUGlxc_conf - mounted 'proc' on 
'/usr/lib/x86_64-linux-gnu/lxc/proc', type 'proc'
  lxc-start 1392656494.774 DEBUGlxc_conf - mounted 'sysfs' on 
'/usr/lib/x86_64-linux-gnu/lxc/sys', type 'sysfs'
  lxc-start 1392656494.774 ERRORlxc_conf - No such file or directory - 
failed to mount '/dev/vg_lxc1/lv_ldap_tmp1' on 
'/usr/lib/x86_64-linux-gnu/lxc/lv_ldap'
  lxc-start 1392656494.774 ERRORlxc_conf - failed to setup the mount 
entries for 'testme1'
  lxc-start 1392656494.774 ERRORlxc_start - failed to setup the 
container
  lxc-start 1392656494.774 ERRORlxc_sync - invalid sequence number 1. 
expected 2
  

Re: [lxc-users] Setting up containers with multiple logical volumes

2014-02-17 Thread Serge Hallyn
Quoting Joshua Schaeffer (jschaeffer0...@gmail.com):
 Yes it failed to start:
 
 1. lxc-create -n testme1 -t debian
 2. root@reaver:~# cat /var/lib/lxc/testme1/config | grep lxc.mount.entry
 lxc.mount.entry = proc proc proc nodev,noexec,nosuid 0 0
 lxc.mount.entry = sysfs sys sysfs defaults  0 0
 lxc.mount.entry = /dev/vg_lxc1/lv_ldap_tmp1 lv_ldap
 defaults,create=dir 0 0

Wait a sec.  I mistyped.  There's no fstype in there :)

That should be

lxc.mount.entry = /dev/vg_lxc1/lv_ldap_tmp1 lv_ldap ext4 
defaults,create=dir 0 0

or whatever fstype it is in place of ext4.  Sorry.

 3. root@reaver:~# lxc-start -n testme1 -l trace -o testme1.out
 lxc-start: No such file or directory - failed to mount
 '/dev/vg_lxc1/lv_ldap_tmp1' on
 '/usr/lib/x86_64-linux-gnu/lxc/lv_ldap'
 lxc-start: failed to setup the mount entries for 'testme1'
 lxc-start: failed to setup the container
 lxc-start: invalid sequence number 1. expected 2
 lxc-start: failed to spawn 'testme1'
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users


Re: [lxc-users] Setting up containers with multiple logical volumes

2014-02-17 Thread Serge Hallyn
Quoting Serge Hallyn (serge.hal...@ubuntu.com):
 Quoting Joshua Schaeffer (jschaeffer0...@gmail.com):
  Yes it failed to start:
  
  1. lxc-create -n testme1 -t debian
  2. root@reaver:~# cat /var/lib/lxc/testme1/config | grep lxc.mount.entry
  lxc.mount.entry = proc proc proc nodev,noexec,nosuid 0 0
  lxc.mount.entry = sysfs sys sysfs defaults  0 0
  lxc.mount.entry = /dev/vg_lxc1/lv_ldap_tmp1 lv_ldap
  defaults,create=dir 0 0
 
 Wait a sec.  I mistyped.  There's no fstype in there :)
 
 That should be
 
 lxc.mount.entry = /dev/vg_lxc1/lv_ldap_tmp1 lv_ldap ext4 
 defaults,create=dir 0 0
 
 or whatever fstype it is in place of ext4.  Sorry.

Actually I see that will fail too, because 'create=dir' has a
slight problem.  We need to remove create=dir from the mount
options which we pass along to the mount syscall.

so for the sake of testing just do

lxc.mount.entry = /dev/vg_lxc1/lv_ldap_tmp1 mnt ext4 defaults 0 0

-serge
___
lxc-users mailing list
lxc-users@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users