Non-interactive IBM Z LPAR autoinstall (s390x)

This non-interactive installation uses autoinstall, which can be considered the successor to the Debian installer (d-i) and preseed on Ubuntu. This is a detailed step-by-step guide, including output and logs (which are partially a bit shortened, as indicated by …, to limit the size of this document).

The example logical partition (LPAR) here uses zFCP storage and is connected to a VLAN network. For a DASD and a non-VLAN network example, please see the non-interactive IBM z/VM (s390x) auto-installation guide.

Start with the preparation of the (FTP) install server (if it doesn’t already exist).

user@local:~$
ssh admin@installserver.local
admin@installserver:~$
mkdir -p /srv/ftp/ubuntu-daily-live-server-20.04
admin@installserver:~$
wget http://cdimage.ubuntu.com/ubuntu-server/focal/daily-live/current/focal-live-server-s390x.iso --directory-prefix=/srv/ftp/ubuntu-daily-live-server-20.04
--2020-06-26 12:18:48--  http://cdimage.ubuntu.com/ubuntu-server/focal/daily-live/current/focal-live-server-s390x.iso
Resolving cdimage.ubuntu.com (cdimage.ubuntu.com)... 2001:67c:1560:8001::1d, 2001:67c:1360:8001::28, 2001:67c:1360:8001::27, 
  ...
Connecting to cdimage.ubuntu.com (cdimage.ubuntu.com)|2001:67c:1560:8001::1d|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 700952576 (668M) [application/x-iso9660-image]
Saving to: ‘focal-live-server-s390x.iso’

focal-live-server-s 100%[===================>] 668.48M  2.73MB/s    in 4m 54s

2020-06-26 12:23:42 (2.27 MB/s) - ‘focal-live-server-s390x.iso’ saved [700952576/700952576]

The ISO image needs to be extracted now. Since files in its boot folder need to be modified, loopback mount is not an option here:

admin@installserver:~$
cd /srv/ftp/ubuntu-daily-live-server-20.04
admin@installserver:~/srv/ftp/ubuntu-daily-live-server-20.04$
mkdir iso
admin@installserver:~/srv/ftp/ubuntu-daily-live-server-20.04$
sudo mount -o loop ./focal-live-server-s390x.iso ./iso
[sudo] password for admin: 
mount: /home/user/iso-test/iso: WARNING: device write-protected, mounted read-only.
admin@installserver:~/srv/ftp/ubuntu-daily-live-server-20.04$
ls -l
total 684530
-rw-rw-r--  1 user user 700952576 Jun 26 10:12 focal-live-server-s390x.iso
dr-xr-xr-x 10 root    root         2048 Jun 26 10:12 iso
admin@installserver:~/srv/ftp/ubuntu-daily-live-server-20.04$
rsync -rtvz ./iso/ . && sync
sending incremental file list
skipping non-regular file "ubuntu"
skipping non-regular file "ubuntu-ports"
./
README.diskdefines
boot.catalog
md5sum.txt
ubuntu.ins
skipping non-regular file "dists/stable"
skipping non-regular file "dists/unstable"
.disk/
.disk/base_installable
.disk/casper-uuid-generic
.disk/cd_type
.disk/info
boot/
boot/README.boot
boot/initrd.off
boot/initrd.siz
boot/initrd.ubuntu
boot/kernel.ubuntu
boot/parmfile.ubuntu
boot/ubuntu.exec
boot/ubuntu.ikr
boot/ubuntu.ins
casper/
  ...
sent 681,509,758 bytes  received 1,857 bytes  22,344,643.11 bytes/sec
total size is 700,317,941  speedup is 1.03
admin@installserver:~/srv/ftp/ubuntu-daily-live-server-20.04$
ls -l
total 684578
dr-xr-xr-x  2 user user      4096 Jun 26 10:12 boot
-r--r--r--  1 user user      2048 Jun 26 10:12 boot.catalog
dr-xr-xr-x  3 user user      4096 Jun 26 10:12 casper
dr-xr-xr-x  3 user user      4096 Jun 26 10:11 dists
-rw-rw-r--  1 user user 700952576 Jun 26 10:12 focal-live-server-s390x.iso
dr-xr-xr-x  2 user user      4096 Jun 26 10:11 install
dr-xr-xr-x 10 root    root         2048 Jun 26 10:12 iso
-r--r--r--  1 user user      4944 Jun 26 10:12 md5sum.txt
dr-xr-xr-x  2 user user      4096 Jun 26 10:11 pics
dr-xr-xr-x  3 user user      4096 Jun 26 10:11 pool
dr-xr-xr-x  2 user user      4096 Jun 26 10:11 preseed
-r--r--r--  1 user user       236 Jun 26 10:11 README.diskdefines
-r--r--r--  1 user user       185 Jun 26 10:12 ubuntu.ins

Now create .ins and parmfiles dedicated to the LPAR that will be installed (here zlinlpar), based on the default .ins and parmfiles that are shipped with the ISO image:

admin@installserver:~/srv/ftp/ubuntu-daily-live-server-20.04$
chmod -R +rw ./boot > cp ./boot/ubuntu.ins ./boot/ubuntu_zlinlpar.ins > cp ./boot/parmfile.ubuntu ./boot/parmfile.zlinlpar
admin@installserver:~/srv/ftp/ubuntu-daily-live-server-20.04$
vi ./boot/ubuntu_zlinlpar.ins > cat ./boot/ubuntu_zlinlpar.ins
* Ubuntu for z Series (default kernel)
kernel.ubuntu 0x00000000
initrd.off 0x0001040c
initrd.siz 0x00010414
parmfile.zlinlpar 0x00010480
initrd.ubuntu 0x01000000
admin@installserver:/srv/ftp/ubuntu-daily-live-server-20.04$
vi ./boot/parmfile.zlinlpar > cat ./boot/parmfile.zlinlpar
ip=10.11.12.42::10.11.12.1:255.255.255.0:zlinlpar:encc000.4711:none:10.11.12.1 vlan=encc000.4711:encc000 url=http://installserver.local:80/ubuntu-daily-live-server-20.04/focal-live-server-s390x.iso autoinstall ds=nocloud-net;s=http://installserver.local:80/autoinstall/zlinlpar/ --- quiet

Now make sure an FTP server is running in the installserver with /srv/ftp as ftp-server root (as used in this example).

Now prepare an autoinstall (HTTP) server, which hosts the configuration data for the non-interactive installation.

admin@installserver:~/srv/ftp/ubuntu-daily-live-server-20.04$
mkdir -p /srv/www/autoinstall/zlinlpar > cd /srv/www/autoinstall/zlinlpar
admin@installserver:~/srv/www/autoinstall/zlinlpar$
echo "instance-id: $(uuidgen || openssl rand -base64 8)" > meta-data > cat meta-data
instance-id: 2c2215fb-6a38-417f-b72f-376b1cc44f01
admin@installserver:/srv/www/autoinstall/zlinlpar$
admin@installserver:~/srv/www/autoinstall/zlinlpar$
vi user-data > cat user-data
#cloud-config
autoinstall:
  version: 1
  refresh-installer:
    update: yes
  reporting:
    builtin:
      type: print
  apt:
    preserve_sources_list: false
    primary:
    - arches: [amd64, i386]
      uri: http://archive.ubuntu.com/ubuntu
    - arches: [default]
      uri: http://ports.ubuntu.com/ubuntu-ports
  keyboard:
    layout: en
    variant: us
  locale: en_US
  identity:
    hostname: zlinlpar
    password: 
"$6$ebJ1f8wxED22bTL4F46P0"
      username: ubuntu
    user-data:
      timezone: America/Boston
      users:
        - name: ubuntu
          password: 
"$6$KwuxED22bTL4F46P0"
          lock_passwd: false
    early-commands:
      - touch /tmp/lets_activate_the_s390x_devices
      - chzdev zfcp -e e000
      - chzdev zfcp -e e100
      - chzdev zfcp-lun -e --online
      - touch /tmp/s390x_devices_activation_done
    network:
      ethernets:
        encc000: {}
      version: 2
      vlans:
        encc000.4711:
          addresses: [10.11.12.42/24]
          gateway4: 10.11.12.1
          id: 4711
          link: encc000
          nameservers:
            addresses: [10.11.12.1]
    ssh:
      install-server: true
      allow-pw: true
      authorized-keys: ['ssh-rsa  meQwtZ user@workstation # ssh-import-id lp:user']

For s390x installations the early-commands section is the interesting part:

early-commands:
  - touch /tmp/lets_activate_the_s390x_devices
  - chzdev zfcp -e e000
  - chzdev zfcp -e e100
  - chzdev zfcp-lun -e --online
  - touch /tmp/s390x_devices_activation_done

The first and last early-commands are optional; they only frame and indicate the real s390x command activation.

In this particular example, two zFCP hosts (host-bus-adapters) are enabled via their addresses e000 (chzdev zfcp -e e000) and e100 (chzdev zfcp -e e000). These have certain logical unit numbers (LUNs) assigned that are all automatically discovered and activated by chzdev zfcp-lun -e --online.

Activation of a direct-access storage device (DASD) would look like this: chzdev dasd -e 1f00, and a QETH device activation looks like: chzdev qeth -e c000.

See also

For more details about the autoinstall config options, please have a look at the autoinstall reference and autoinstall schema pages.

  • Now make sure a HTTP server is running with /srv/www as web-server root (in this particular example).

  • Next steps need to be done at the hardware management console (HMC). First, connect to the HMC and proceed with the ‘Load From Removable Media and Server’ task.

  • Then, start the ‘Load from Removable Media or Server’ task under ‘Recovery’ –> ‘Load from Removable Media or Server’ on your specific LPAR that you are going to install, and fill out the following fields (the contents will be of course different on your system):

    FTP Source 	
    Host computer:	installserver.local
    User ID:	ftpuser
    Password: ********
    Account (optional):	
    File location (optional): ubuntu-daily-live-server-20.04/boot
    
  • Now confirm the entered data and click ‘OK’.

  • At the ‘Load from Removable Media or Server - Select Software to Install’ screen, choose the LPAR that is going to be installed, here:

    ubuntu-daily-live-server-20.04/boot/ubuntu_zlinlpar.ins   Ubuntu for z Series (default kernel)
    
  • Confirm again with ‘OK’.

  • And another confirmation about the ‘Load will cause jobs to be cancelled’.

  • Then, another ‘Yes’ – understanding that it’s a disruptive task:

    Disruptive Task Confirmation : Load from Removable Media or Server
    
  • Now monitor the ‘Load from Removable media or Server Progress’ screen and confirm it once again when the status changes from ‘Please wait while the image is being loaded.’ to ‘Success’.

  • Then navigate to ‘Daily’ –> ‘Operating System Messages’ to monitor the initial program load (IPL) of the install system …

    Message
    chzdev: Unknown device type or device ID format: c000.4711
    Use 'chzdev --help' for more information
    QETH device 0.0.c000:0.0.c001:0.0.c002 configured
    IP-Config: encc000.4711 hardware address 1a:3c:99:55:2a:ef mtu 1500
    IP-Config: encc000.4711 guessed broadcast address 10.11.12.255
    IP-Config: encc000.4711 complete:
    address: 10.11.12.42    broadcast: 10.11.12.255   netmask: 255.255.255.0
    
    gateway: 10.11.12.1     dns0     : 10.11.12.1     dns1   : 0.0.0.0
    
    host   : zlinlpar
    rootserver: 0.0.0.0 rootpath:
    filename  :
    Connecting to installserver.local:80 (installserver.local:80)
    focal-live-server-s3   5% |*                               | 39.9M  0:00:15 ETA
    focal-live-server-s3  22% |*******                         |  147M  0:00:07 ETA
    focal-live-server-s3  38% |************                    |  254M  0:00:04 ETA
    focal-live-server-s3  53% |*****************               |  355M  0:00:03 ETA
    focal-live-server-s3  67% |*********************           |  453M  0:00:02 ETA
    focal-live-server-s3  81% |**************************      |  545M  0:00:01 ETA
    focal-live-server-s3  94% |*****************************  |  633M  0:00:00 ETA
    focal-live-server-s3 100% |******************************|  668M  0:00:00 ETA
    mount: mounting /cow on /root/cow failed: No such file or directory
    Connecting to plymouth: Connection refused
    passwd: password expiry information changed.
    Using CD-ROM mount point /cdrom/
    Identifying... [5d25356068b713167814807dd678c261-2]
    Scanning disc for index files...
    Found 2 package indexes, 0 source indexes, 0 translation indexes and 1 signature
    Found label 'Ubuntu-Server 20.04 LTS _Focal Fossa_ - Release s390x (20200616)'
    This disc is called:
    'Ubuntu-Server 20.04 LTS _Focal Fossa_ - Release s390x (20200616)'
    ...
    [   61.190916] cloud-init[2076]: Cloud-init v. 20.1-10-g71af48df-0ubuntu5 running
    'modules:final' at Fri, 26 Jun 2020 11:02:01 +0000. Up 61.09 seconds.
    [   61.191002] cloud-init[2076]: ci-info: no authorized SSH keys fingerprints fo
    und for user installer.
    [   61.191071] cloud-init[2076]: Cloud-init v. 20.1-10-g71af48df-0ubuntu5 finished at Fri, 26 Jun 2020 11:02:01 +0000.
    Datasource DataSourceNoCloudNet [seed=cmdline,
    /var/lib/cloud/seed/nocloud,
    http://installserver.local:80/autoinstall/zlinlpar/]
    [dsmode=net].  Up 61.18 seconds
    [   61.191136] cloud-init[2076]: Welcome to Ubuntu Server Installer!
    [   61.191202] cloud-init[2076]: Above you will find SSH host keys and a random
    password set for the `installer` user. You can use these credentials to ssh-in
    and complete the installation. If you provided SSH keys in the cloud-init datasource,
    they were also provisioned to the installer user.
    [   61.191273] cloud-init[2076]: If you have access to the graphical console,
    like TTY1 or HMC ASCII terminal you can complete the installation there too.
    
    It is possible to connect to the installer over the network, which
    might allow the