lxc-create -B btrfs fails if lxc.lxcpath is not on the same filesystem as /var/cache/lxc (not a configurable option)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
Won't Fix
|
Wishlist
|
Unassigned |
Bug Description
## Version
Description: Ubuntu 15.04
Release: 15.04
lxc:
Installed: 1.1.2-0ubuntu3.1
Candidate: 1.1.2-0ubuntu3.1
Version table:
*** 1.1.2-0ubuntu3.1 0
500 http://
500 http://
100 /var/lib/
1.1.2-0ubuntu3 0
500 http://
## Config changes from default
>cat /etc/lxc/lxc.conf
lxc.lxcpath = /srv/vservers/lxc
## Mount details
/var/cache/lxc in on root filesystem
/srv/vservers/lxc is a btrfs mount point
## Command used (sample)
> sudo lxc-create -B btrfs --name test-bt -t ubuntu -- -r trusty
## Error (sample)
Copy /var/cache/
Copying rootfs to /srv/vservers/
Transaction commit: none (default)
Delete subvolume '/srv/vservers/
Create a snapshot of '/var/cache/
ERROR: cannot snapshot '/var/cache/
lxc_container: lxccontainer.c: create_
lxc_container: lxccontainer.c: container_destroy: 2056 Error destroying rootfs for test-bt
lxc_container: lxc_create.c: main: 274 Error creating container test-bt
## Thoughts
Maybe this is the expected behavior, if so a Documentation update stating something to the effect of "If you change the lxcpath to a different filesystem than the one where /var/cache/lxc livs you cannot create a btrfs backed container."
-or-
Let /var/cache/lxc be configured via lxc.conf and have the documentation note that they should reside on the same filesystem.
Indeed this is expected behavior. Since there is no way to
create a btrfs subvolume in this instance, and you explicitly
asked for a btrfs subvolume, it should error. A simple directory
copy must be used.
I think it might be reasonable to say that even if it has to
do a full directory copy, it could still create a new subvolume
so that clones can be done as snapshots. Patches for either that
or for documentation improvement are welcome, so leaving this bug
open