Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce lxc.storage.<storage-driver>.* type configuration for container storage #1179

Open
Harvie opened this issue Sep 10, 2016 · 9 comments
Labels
Feature New feature, not a bug

Comments

@Harvie
Copy link

Harvie commented Sep 10, 2016

Hello i am trying to use ZFS or BtrFS with LXC and i've sucesfully set up ZFS like this:

lxc.lxcpath = /var/lib/lxc
lxc.bdev.zfs.root = tank/containers

But i have to call lxc-create with "-B zfs" each time and that sux. It's not going to change very often and when i let someone to manage the server and they forget about this they can just create dir without creating ZFS by omiting the "-B zfs" by accident.

Is there some place to set this? If not please add ability to set it like "lxc.backingstore=zfs" in lxc.conf.

Also please make the "best" backing store the new default (as it should use ZFS or BTRFS automaticaly when available).

@brauner
Copy link
Member

brauner commented Jan 2, 2017

Hm, I'm very much against configuration key inflation so I'm not very supportive of this idea. @stgraber and @hallyn may however disagree. In any case, if they agree with you and you want this option we welcome patches. :)

@brauner brauner added Community Feature New feature, not a bug labels Jan 2, 2017
@hallyn
Copy link
Member

hallyn commented Jan 2, 2017

Well as it is we have lxc.bdev.lvm.vg and lxc.bdev.zfs.root in lxc.system.conf.

lxc..backingstore= doesn't sound bad to me, assuming hooking it into the container creation doesn't become too invasive.

@stgraber
Copy link
Member

stgraber commented Jan 3, 2017

+1 on @hallyn's comment. We have the other bdev bits in there already and having to always pass -B is a bit counter-intuitive, so I'd be fine with adding an option.

@ek9
Copy link

ek9 commented Jan 25, 2017

+1, the -B btrfs has been typed too many times in this terminal.

@hallyn
Copy link
Member

hallyn commented Jan 26, 2017

So to summarize - patches welcome :)

@anevenchanniy
Copy link
Contributor

We are already have bdevtype inside LXC code, so lxc.bdev.type=[lvm,btrfs,zfs etc]
looks like more preferable, as for me.
https://github.com/lxc/lxc/blob/master/src/lxc/tools/lxc_create.c#L73

@hallyn
Copy link
Member

hallyn commented May 17, 2017

@anevenchanniy - I agree about lxc.bdev.type. While bdev is not as descriptive as 'backingstore', I think avoiding different option names for the config file than the command line options is worthwhile.

@brauner
Copy link
Member

brauner commented Jul 25, 2017

@hallyn, @stgraber, since I'm currently working on rewriting the storage backends for LXC as well. I would pick this idea up. But I would introduce the following namespaces keys:

lxc.storage.<storage driver>.*

For example

lxc.storage.zfs.pool
lxc.storage.btrfs.pool
lxc.storage.zfs.clone_copy
lxc.storage.ceph.osd.pool_name

etc. This nicely aligns with LXD and will make the API way nicer. Hooking it into the current container creation shouldn't be too difficult from an API perspective. In fact, it should make container creation and copy way easier.

@brauner brauner removed the Community label Jul 25, 2017
@brauner brauner changed the title set default backing store in lxc.conf? Introduce lxc.storage.<storage-driver>.* type configuration for container storage Jul 25, 2017
@hallyn
Copy link
Member

hallyn commented Jul 25, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature, not a bug
Development

No branches or pull requests

6 participants