[lxc-devel] RFC: should lxc-create default to -B best?

Dwight Engen dwight.engen at oracle.com
Wed Sep 24 21:09:42 UTC 2014


On Wed, 24 Sep 2014 20:45:22 +0000
Serge Hallyn <serge.hallyn at ubuntu.com> wrote:

> Quoting Dwight Engen (dwight.engen at oracle.com):
> > In lxc-0.9.0 if -B wasn't given to lxc-create (the shell script), it
> > would test if $rootfs was on a btrfs and if so would act as if -B
> > btrfs were given (ie. create a subvolume).
> > 
> > In lxc-1.x with the bdev backend, lxc-create has the option -B best
> > which would have a similar result, but this is not the default. Is
> > there a reason 'dir' was made the default? This seems like a change
> > in default behavior, at least with respect to btrfs backend
> > storage. I'd be happy to send a patch making lxc-create default to
> > -B best, but wanted to understand if there were any issues first.
> > Thanks.
> > 
> > P.S. doing this change might allow simplification of the lxc-ubuntu
> > template since it appears to always create a subvolume when $rootfs
> > is a btrfs.
> 
> The commit message which made this change said:
> 
> #    bdev_create: don't default to btrfs if possible
> #    
> #    Ideally it would be great to default to a btrfs subvolume for each new
> #    container created.  However, this is not as we previously thought
> #    without consequence.  'rsync --one-file-system' will not descend into
> #    btrfs subvolumes.  This means that 'lxc-create -B _unset' will cause
> #    different behavior for rsync -vax /var/lib/lxc based on whether that
> #    fs is btrfs or not.
> #    
> #    So don't do that.  If -B is not specified, use -B dir.

Hmm. The problem between rsync and subvolumes isn't good, but is it
really worth giving up being able to make a snapshot clone? My guess is
that's one of the primary reasons a user would choose to use btrfs over
something (faster) else right now.

> Stéphane also points out that as the default btrfs mount is such that
> unpriv users can create but not remove subvolumes, doing this by
> default could cause trouble.

Yeah, I agree that makes it a non-starter. Okay, unfortunately I'm
convinced :)

> Now mind you, I'd far prefer to do as you suggest.  I keep getting
> bitten by this change, and it's annoying.  (Of course so is the slow
> fsync on btrfs :)
> 
> -serge
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel



More information about the lxc-devel mailing list