1

I tried to autoinstall ubuntu server providing the user-data file as stated in the documentation but specifically for root on ZFS on Virtualbox. I followed the cloud-init documentation to set the storage part of the user-data file. I implemented both the "ZFS Root Simple" and "ZFS Root" examples shown in the documentation. The simple one works without issues but the second doesn't work and the subiquity error that pops out is "autoinstall config didn't mount root". I can't figure out what is wrong with the configuration whereas it comes from the documentation.

The configuration file looks like this :

#cloud-config
autoinstall:
  version: 1
  identity:
    hostname: ubuntu-server
    password: "$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0"
    username: ubuntu
  keyboard:
    layout: fr
  early-commands:
    - "sudo apt-get install zfsutils-linux -y"
  storage:
    config:
      - grub_device: true
        id: disk1
        name: main_disk
        ptable: gpt
        path: /dev/sda
        type: disk
        wipe: superblock
      - device: disk1
        id: disk1p1
        number: 1
        size: 9G
        type: partition
      - device: disk1
        flag: bios_grub
        id: bios_boot
        number: 2
        size: 1M
        type: partition
      - id: disk1_rootpool
        mountpoint: /
        pool: rpool
        type: zpool
        vdevs:
          - disk1p1
      - id: disk1_rootpool_container
        pool: disk1_rootpool
        properties:
          canmount: "off"
          mountpoint: "none"
        type: zfs
        volume: /ROOT
      - id: disk1_rootpool_rootfs
        pool: disk1_rootpool
        properties:
          canmount: noauto
          mountpoint: /
        type: zfs
        volume: /ROOT/zfsroot
      - id: disk1_rootpool_home
        pool: disk1_rootpool
        properties:
          setuid: "off"
        type: zfs
        volume: /home
      - id: disk1_rootpool_home_root
        pool: disk1_rootpool
        type: zfs
        volume: /home/root
        properties:
          mountpoint: /root
    version: 1

2 Answers2

0

You can find more details for the error message in /var/log/curtin/installer.log. I got quite far with this autoinstall configuration. Only tested it in a proxmox VM, so ymmv.

#cloud-config
autoinstall:
  apt:
    disable_components: []
    geoip: true
    preserve_sources_list: false
    primary:
    - arches:
      - amd64
      - i386
      uri: http://archive.ubuntu.com/ubuntu
    - arches:
      - default
      uri: http://ports.ubuntu.com/ubuntu-ports
  drivers:
    install: false
  identity:
    hostname: HOSTNAME
    password: PASSWORD
    realname: USER
    username: USER
  kernel:
    package: linux-generic
  keyboard:
    layout: us
    toggle: null
    variant: ''
  locale: en_US.UTF-8
  network:
    ethernets:
      ens18:
        critical: true
        dhcp-identifier: mac
        dhcp4: true
    version: 2
  ssh:
    allow-pw: true
    authorized-keys: []
    install-server: true
  storage:
    config:
    - ptable: gpt
      serial: 0QEMU_QEMU_HARDDISK_drive-scsi0
      path: /dev/sda
      wipe: superblock-recursive
      preserve: false
      name: ''
      grub_device: true
      type: disk
      id: disk1
    - device: disk1
      size: 1127219200
      wipe: superblock-recursive
      flag: boot
      number: 1
      preserve: false
      grub_device: true
      type: partition
      ptable: gpt
      id: disk1p1
    - fstype: fat32
      volume: disk1p1
      preserve: false
      type: format
      id: disk1p1fs1
    - path: /boot/efi
      device: disk1p1fs1
      type: mount
      id: mount-2
    - device: disk1
      size: -1
      wipe: superblock-recursive
      flag: root
      number: 2
      preserve: false
      grub_device: false
      type: partition
      id: disk1p2
    - id: disk1p2fs1
      type: format
      fstype: zfsroot
      volume: disk1p2
      preserve: false
    - id: disk1p2f1_rootpool
      mountpoint: /
      pool: rpool
      type: zpool
      device: disk1p2fs1
      preserve: false
      vdevs:
        - disk1p2fs1
    - id: disk1_rootpool_container
      pool: disk1p2f1_rootpool
      preserve: false
      properties:
        canmount: "off"
        mountpoint: "none"
      type: zfs
      volume: /ROOT
    - id: disk1_rootpool_rootfs
      pool: disk1p2f1_rootpool
      preserve: false
      properties:
        canmount: noauto
        mountpoint: /
      type: zfs
      volume: /ROOT/zfsroot
    - path: /
      device: disk1p2fs1
      type: mount
      id: mount-disk1p2
    swap:
      swap: 0
  early-commands:
    - "sudo apt-get install zfsutils-linux -y"
  updates: security
  version: 1
0

I ran into this same issue and it appears that this should be fixed in the next release of the subuquity Ubuntu Server installer. When checking if root is mounted, it will now accept a zpool storage type object if its mountpoint is /.

See here (0e1da11c3) for the commit with this change from the project's repository: https://github.com/canonical/subiquity.

plackemacher
  • 101
  • 2