"lxc-create -B best" fails on non-btrfs/zfs system
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
As per documentation, the `-B best` option should automatically select the best backingstore, falling back all the way to dir.
But apparently it doesn't, at least not in artful's 2.1.0-0ubuntu1:
$ sudo lxc-create -B best --name=
lxc-create: autopkgtest-xenial: storage/btrfs.c: btrfs_create: 860 Inappropriate ioctl for device - Failed to create btrfs subvolume "/var/lib/
lxc-create: autopkgtest-xenial: storage/zfs.c: zfs_create: 758 Failed to create zfs dataset "zfs:lxc/
lxc-create: autopkgtest-xenial: storage/zfs.c: zfs_mount: 256 No such file or directory - Failed to mount "lxc/autopkgtes
lxc-create: autopkgtest-xenial: lxccontainer.c: create_
lxc-create: autopkgtest-xenial: lxccontainer.c: create_
lxc-create: autopkgtest-xenial: storage/zfs.c: zfs_destroy: 613 Failed to detect zfs dataset "lxc/autopkgtes
lxc-create: autopkgtest-xenial: lxccontainer.c: container_destroy: 2653 Error destroying rootfs for autopkgtest-xenial
lxc-create: autopkgtest-xenial: tools/lxc_create.c: main: 326 Error creating container autopkgtest-xenial
Moreover, it creates cruft which is hard to clean up again:
$ sudo lxc-ls -f
NAME STATE AUTOSTART GROUPS IPV4 IPV6
autopkgtest-xenial STOPPED 0 - - -
$ sudo lxc-destroy -n autopkgtest-xenial
lxc-destroy: autopkgtest-xenial: storage/zfs.c: zfs_destroy: 613 Failed to detect zfs dataset "lxc/autopkgtes
lxc-destroy: autopkgtest-xenial: lxccontainer.c: container_destroy: 2653 Error destroying rootfs for autopkgtest-xenial
Destroying autopkgtest-xenial failed
$ sudo ls -lR /var/lib/
/var/lib/
total 8
-rw-r--r-- 1 root root 149 Feb 20 20:41 config
drwxr-xr-x 2 root root 4096 Feb 20 20:41 rootfs
/var/lib/
total 0
This can only be cleaned up with `sudo rm -r`.
autopkgtest-
ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: lxc 2.1.0-0ubuntu1
ProcVersionSign
Uname: Linux 4.13.0-32-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.7-0ubuntu3.7
Architecture: amd64
Date: Tue Feb 20 20:38:55 2018
JournalErrors:
Error: command ['journalctl', '-b', '--priority=
Users in the 'systemd-journal' group can see all messages. Pass -q to
turn off this notice.
No journal files were opened due to insufficient permissions.
PackageArchitec
SourcePackage: lxc
UpgradeStatus: No upgrade log present (probably fresh install)
defaults.conf:
lxc.net.0.type = veth
lxc.net.0.link = lxcbr0
lxc.net.0.flags = up
lxc.net.0.hwaddr = 00:16:3e:xx:xx:xx
lxcsyslog:
Changed in lxc (Ubuntu): | |
status: | New → Fix Released |
On Tue, Feb 20, 2018 at 08:43:41PM -0000, Martin Pitt wrote:
> Public bug reported:
>
> As per documentation, the `-B best` option should automatically select
> the best backingstore, falling back all the way to dir.
>
> But apparently it doesn't, at least not in artful's 2.1.0-0ubuntu1:
Hm, is it possible for you to try and reproduce with current master.
Works fine for me:
chb@conventiont|~ autopkgtest- xenial -t ubuntu -- -r xenial lxc/autopkgtest -xenial/ rootfs" lxc/autopkgtest -xenial" : The ZFS modules are not loaded. xenial" : Volume group "lvm_img" not found lvm_img/ autopkgtest- xenial" of size "1073741824 bytes" lxc/xenial/ rootfs- amd64 ... https,ssh, vim,language- pack-en main,universe --include= apt-transport- https,ssh, vim,language- pack-en xenial /var/cache/ lxc/xenial/ partial- amd64 http:// archive. ubuntu. com/ubuntu C42C86F933B4FE6 ACC0B21F32)
> sudo lxc-create -B best --name=
lxc-create: autopkgtest-xenial: storage/btrfs.c: btrfs_create: 861 Inappropriate ioctl for device - Failed to create btrfs subvolume "/var/lib/
lxc-create: autopkgtest-xenial: storage/zfs.c: zfs_create: 762 Failed to create zfs dataset "zfs:default/
Try running '/sbin/modprobe zfs' as root to load them.
lxc-create: autopkgtest-xenial: storage/lvm.c: do_lvm_create: 183 Failed to create logical volume "autopkgtest-
lxc-create: autopkgtest-xenial: storage/lvm.c: lvm_create: 655 Error creating new logical volume "lvm:/dev/
Checking cache download in /var/cache/
Installing packages in template: apt-transport-
Downloading ubuntu xenial minimal ...
W: Target architecture is the same as host architecture; disabling QEMU support
I: Running command: debootstrap --arch amd64 --verbose --components=
I: Retrieving InRelease
I: Checking Release signature
I: Valid Release signature (key id 790BC7277767219
I: Retrieving Packages
I: Validating Packages
I: Retrieving Packages