#1296 closed System Defect (fixed)

Warden can't create template on zpool with altroot

Reported by: clinta Owned by:
Priority: major Milestone:
Component: System Configuration Version: 10-STABLE
Keywords: Cc: trac-bugs@…

Description

Steps to reproduce (Tested on FreeBSD 10-STABLE with pcbsd-utils package installed:

  1. Have a zpool mounted with an altroot:
    # zpool list
    NAME    SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
    tank   13.6T  8.03T  5.60T    58%  1.00x  ONLINE  /mnt
    
  1. Configure Warden to use a dataset on this pool:
    cat /usr/local/etc/warden.conf
    #!/bin/sh
    # Configuration options for the Warden
    ######################################################################
    
    # Network Interface for the jails to use
    NIC: tap0
    
    # Directory to use for compressing / decompressing files
    WTMP: /mnt/tank/jails
    
    # Location of the jails
    JDIR: /mnt/tank/jails
    
    # zfs list -r tank/jails
    NAME                                  USED  AVAIL  REFER  MOUNTPOINT
    tank/jails                           77.2M  4.30T  77.0M  /mnt/tank/jails
    
  1. Create a template:
    # warden template create -fbsd 10.0-RELEASE -arch amd64 -nick fbsd100
    Fetching jail environment. This may take a while...
    /mnt/tank/jails/.download/base.txz            100% of   59 MB 2109 kBps 00m29s
    /mnt/tank/jails/.download/doc.txz             100% of 1394 kB  801 kBps 00m02s
    /mnt/tank/jails/.download/games.txz           100% of  865 kB  565 kBps 00m02s
    /mnt/tank/jails/.download/lib32.txz           100% of   14 MB 1874 kBps 00m09s
    Creating ZFS /mnt/tank/jails/.warden-template-fbsd100 dataset...
    ERROR: Failed extracting ZFS template environment
    

Result:

Warden creates a dataset with mountpoint in an absolute path below the altroot rater than a path relative to the altroot.

# zfs list -r tank/jails
NAME                                  USED  AVAIL  REFER  MOUNTPOINT
tank/jails                           77.2M  4.30T  77.0M  /mnt/tank/jails
tank/jails/.warden-template-fbsd100   230K  4.30T   230K  /mnt/mnt/tank/jails/.warden-template-fbsd100

Expected results, warden should create a path relative to the altroot. I'm not sure why warden was written to create explicit mountpoints anyway, rather than inheriting them from the parent dataset. This can make things annoying of someone wants to change the mountpoint of their jails dataset in the future.

Change History (1)

comment:1 Changed 11 months ago by kris

  • Resolution set to fixed
  • Status changed from new to closed

Fixed!

https://github.com/pcbsd/pcbsd/commit/698a24961fb8febe1f0b43cdea392ecad1274ce7

If you want to test, do a checkout of our git repo:

# git clone https://github.com/pcbsd/pcbsd.git
# cd pcbsd/src-sh/libsh && make install
# cd ../warden && make install

Note: See TracTickets for help on using tickets.