lxc-create -B btrfs fails if lxc.lxcpath is not on the same filesystem as /var/cache/lxc (not a configurable option)

Bug #1486696 reported by Shawn Teague
6
This bug affects 1 person
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://us.archive.ubuntu.com/ubuntu/ vivid-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ vivid-security/main amd64 Packages
        100 /var/lib/dpkg/status
     1.1.2-0ubuntu3 0
        500 http://us.archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages

## 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/lxc/trusty/rootfs-amd64 to /srv/vservers/lxc/test-bt/rootfs ...
Copying rootfs to /srv/vservers/lxc/test-bt/rootfs ...
Transaction commit: none (default)
Delete subvolume '/srv/vservers/lxc/test-bt/rootfs'
Create a snapshot of '/var/cache/lxc/trusty/rootfs-amd64' in '/srv/vservers/lxc/test-bt/rootfs'
ERROR: cannot snapshot '/var/cache/lxc/trusty/rootfs-amd64' - Invalid cross-device link
lxc_container: lxccontainer.c: create_run_template: 1108 container creation template for test-bt failed
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.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 1486696] [NEW] lxc-create -B btrfs fails if lxc.lxcpath is not on the same filesystem as /var/cache/lxc (not a configurable option)

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

Changed in lxc (Ubuntu):
status: New → Triaged
importance: Undecided → Wishlist
Revision history for this message
Christian Brauner (cbrauner) wrote :

Marking as won't fix since LXC 1.1.* is EOL. Also, there have been quite some improvements in btrfs handling on LXC side. If the issue still persists, please feel free to report a bug against or repo on github.

Changed in lxc (Ubuntu):
status: Triaged → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.