AutomatedInstallsWithPreseed

Revision 1 as of 2016-05-15 19:53:36

Clear message

Automated installs on s390x with preseed

One of the Debian installers (d-i) advanced options is the automated install mode via preseed - a combination of boot parameters and a preseed file.

The (d-i) installer has two stages - the initial stage (before networking has been started in the installer, usually run at the console) and the second stage that you usually run via ssh. To automate the initial stage, preseed commands of that stage have to be added to the boot prompt, like: "debian-installer/locale=en_US".

Aliases

Because the boot prompt can become quite long, there are short forms available, called aliases, for some parameters, like 'locale=en_US' or or 'url' instead of 'preseed/url'. Please find a table with all aliases here: https://help.ubuntu.com/16.04/installation-guide/s390x/apbs02.html#preseed-aliases

Alias

Normal

priority

debconf/priority

fb

debian-installer/framebuffer

language

debian-installer/language

country

debian-installer/country

locale

debian-installer/locale

theme

debian-installer/theme

auto

auto-install/enable

classes

auto-install/classes

file

preseed/file

url

preseed/url

domain

netcfg/get_domain

hostname

netcfg/get_hostname

interface

netcfg/choose_interface

protocol

mirror/protocol

suite

mirror/suite

modules

anna/choose_modules

recommends

base-installer/install-recommends

tasks

tasksel:tasksel/first

desktop

tasksel:tasksel/desktop

dmraid

disk-detect/dmraid/enable

keymap

keyboard-configuration/xkb-keymap

preseed-md5

preseed/file/checksum


All parameters need to be in a single line for an LPAR installation. For an z/VM guest installation they need to be placed in the PARMFILE - more on that later.

z Systems specific boot parameter

Especially for the initial stage, which is quite system dependent, there are several mainframe-specific parameters available. These have the prefix: "s390-..." (don't care about the missing 'x' Wink ;-) ) With the help of these you can overcome/answer even the initial questions.

Some sample s390 bot parameters are:

1) Network device type s390-netdevice/choose_networktype=qeth 2) OSA-Express QDIO / HiperSockets device s390-netdevice/qeth/choose=0.0.0600-0.0.0601-0.0.0602 3) Layer2 or Layer3 mode s390-netdevice/qeth/layer2=true 4) Relative port s390-netdevice/qeth/port=0

There is not much documentation about these 's390-' parameters, the best way to look them up is therefore the full list of debconf templates available here: * https://anonscm.debian.org/cgit/d-i/
Especially the templates about the: * https://anonscm.debian.org/cgit/d-i/s390-netdevice.git/tree/debian/s390-netdevice.templates
* https://anonscm.debian.org/cgit/d-i/s390-dasd.git/plain/debian/s390-dasd.templates and
* https://anonscm.debian.org/cgit/d-i/s390-zfcp.git/plain/debian/s390-zfcp.templates

The following tables show the most relevant s390-specific boot parameters:

Table: s390-netdevice parameters

Key

Value

Description

s390-netdevice/choose_networktype

selection; choices: ctc, qeth, iucv, virtio

Network device type

s390-netdevice/ctc/choose_read

selection; choices: {choices}

TC read device

s390-netdevice/ctc/choose_write

selection; choices: {choices}

CTC write device

s390-netdevice/ctc/confirm

boolean, default: true

Acceptance of configuration

s390-netdevice/ctc/protocol

selection, choices: S/390 (0), Linux (1), OS/390 (3); Default: S/390 (0)

Protocol for this connection

s390-netdevice/qeth/choose

selection, choices: {choices}

OSA-Express QDIO or HiperSockets device

s390-netdevice/qeth/confirm

boolean, default: true

Acceptance of configuration

s390-netdevice/qeth/port

string, default: 0

Relative Port

s390-netdevice/qeth/layer2

boolean, default: false

Device in layer2 mode

s390-netdevice/iucv/confirm

boolean, default: true

Acceptance of configuration

s390-netdevice/iucv/peer

string

Name of VM peer

For further details see: Template: s390-netdevice

Table: s390-dasd

Key

Value

Description

s390-dasd/choose_select

s390-dasd/choose_select

Available devices, select "Finish" when done

s390-dasd/choose

string

Choose complete device number, including leading zeros

s390-dasd/format

boolean, default: false

Format the device, in case device is already low-level formatted

s390-dasd/format_required

boolean, default: true

Format the device, in case device is not low-level formatted

For further details see: Template: s390-dasd

Table: s390-zfcp

Key

Value

Description

||s390-zfcp/zfcp||string||internal use; one ore more SCSI devices with comma ',' to separate multiple entries; each entry consists of a zfcp host adapter, optionally followed by the WWPN and LUN, like: 0.0.1234,0.0.5678:0x2005000e11159c32:0x1234567800000000||

s390-zfcp/select_zfcp_host

selection, {choices}, Finish

available FCP devices

s390-zfcp/remove_zfcp_config

boolean, default: false

removal of FCP device configuration

s390-zfcp/add_zfcp_luns

selection, choices: {LUNS}, add LUN, Finish

Available LUNs for installation

s390-zfcp/get_lun

string

WWPN and LUN for SCSI device, e.g. 0x2005000e11159c32:0x1234567800000000

s390-zfcp/remove_lun

boolean, default: false

removal of the LUN {LUN}

For further details see: Template: s390-zfcp

The preseed commands of the second stage can either specified as boot parameters (they don't have the 's390-'), at least partly, or in a preseed config file, like "url=http://<your_preseed_server>/preseed.cfg" (use http or ftp). If there was already an ftp server prepared for an ftp-based installation, the same system can be used as preseed server, which would ensure that the preseed file can be found during boot and install time at the same system. In case the Ubuntu servers have no direct access to the internet, hence the public update server can't be directly used, this install and preseed system may even act a local update server. In case of a full automated installation with dynamic network some additional resources are obviously needed, like DHCP and DNS.

Here is an example of a boot paramater set (single line):
ro locale=en_US s390-netdevice/choose_networktype=qeth s390-netdevice/qeth/choose=0.0.0600-0.0.0601-0.0.0602 s390-netdevice/qeth/layer2=true s390-netdevice/qeth/port=0 netcfg/get_ipaddress=10.245.236.11 netcfg/get_netmask=255.255.255.0 netcfg/get_gateway=10.245.236.1 netcfg/get_nameservers=10.245.236.1 netdevice/qeth/layer2=true netcfg/confirm_static=true netcfg/disable_dhcp=true netcfg/get_hostname=HWE0001 netcfg/get_domain=canonical.com network-console/password=0123456789 network-console/password-again=0123456789 url=http://install-server/ubuntu1604/s390x/preseed.cfg

It's worth to consider using the cio_ignore parameter to hide some of the devices from Linux, which may speedup the boot and install process significantly - expecially in LPAR.
Here is a brief overview: http://linuxmain.blogspot.de/2011/10/using-cioignore-under-zvm.html
Keep in mind that the boot parameters are case sensitive (like 'locale=en_US')! A common locale, especially for the early install stage is btw. 'locale=C'.
Consider to put 'auto=true priority=critical' in front of 'url=...’ parameter as well: https://help.ubuntu.com/16.04/installation-guide/s390x/apbs02.html#preseed-auto
IPv6 addresses of servers hosting preseed configuration files are possible.

Open Issues

Please notice that fully automated DASD installations are currently not possible. There is already a hint about that in the release notes: https://wiki.ubuntu.com/XenialXerus/ReleaseNotes#Fully_automated_preseed_install and as stated there there are two tickets open right now. There is work going on to get that fixed.

In between you may temporary format the DASDs prior to the automated installation from a manual installed system. Btw. in case you have (Hyper)PAV in place you may be able to now speed up the tedious dasdfmt performance via the ‘requestsize’ argument quite a bit: http://linuxmain.blogspot.de/2016/05/dasdfmt-performance.html

z/VM guest preseed installation

In case of a z/VM guest installation and now with the required boot parameters for preseed in mind the standard PARMFILE can now either be modified, or the existing PARMFILE copied into a new one with doing some modifications afterwards. In this case the exec file needs to be copied and modified as well: the 'PUNCH' statement need to be adjusted with the new name of the PARMFILE.

Have a look at the relevant files located in the xenial-server-s390x.iso file's boot folder: kernel.ubuntu and initrd.ubuntu but especially parmfile.ubuntu and ubuntu.exec

If the PARMFILE.ubuntu and ubuntu.exec files are going to be modified on a workstation (and not - as sown below - on z/VM CMS), simple LF must be used instead of CR/LF and the files need to be transfered in ASCII mode, rather than BINARY mode in combination with 'site fix 80', which is required for the kernel.ubuntu and initrd.ubuntu files. In this case it's recommended to open the files after the transfer to CMS with xedit to verify the format (EBCDIC) and line-ending (LF). The following steps show a sample procedure.

The file name slightly change if transfered from the workstation to z/VM CMS:

Workstation

Mainframe

initrd.ubuntu

INITRD UBUNTU A

kernel.ubuntu

KERNEL UBUNTU A

parmfile.ubuntu

PARMFILE UBUNTU A

ubuntu.exec

UBUNTU EXEC A

(The drive letter 'A' may be different on other machines.)

Upload these files as usual to the ftp sserver - if not already done. Using ASCII mode for parmfile.ubuntu and ubuntu.exec and BINARY mode with 'site fix 80' for kernel.ubuntu and initrd.ubuntu. Now copy the parameter and exec file: COPYfile PARMFILE UBUNTU A PARMFILE UBUAUTO A COPYfile UBUNTU EXEC A UBUAUTO EXEC A edit file 'UBUNTU EXEC A': xedit UBUNTU EXEC A and modify the line: 'PUNCH PARMFILE  UBUNTU   * (NOHEADER' to: 'PUNCH PARMFILE  UBUAUTO  * (NOHEADER'

Now the content of the 'PARMFILE UBUAUTO A' file, which is btw empty by default, needs to be expanded with the boot parameters, taking CMS's 80 charachter column limit into account. A (non-complete) example may look like this:
ro locale=en_US
s390-netdevice/choose_networktype=qeth
s390-netdevice/qeth/layer2=true s390-netdevice/qeth/port=0
s390-netdevice/qeth/choose=0.0.0600-0.0.0601-0.0.0602
netcfg/get_ipaddress=10.245.236.11 netcfg/get_netmask=255.255.255.0
netcfg/get_gateway=10.245.236.1 netcfg/get_nameservers=10.245.236.1
netdevice/qeth/layer2=true netcfg/confirm_static=true netcfg/disable_dhcp=true
netcfg/get_hostname=ZLIN11 netcfg/get_domain=ubuntu.com
network-console/password=01234567 network-console/password-again=01234567
url=http://<install-server>/ubuntu1604/s390x/preseed.cfg

These changes can also be done with the help of the 'filelIST' command, which is a simple file manangement tool.
If a command is typed beginning with upper case and at some point with lower case, like 'COPYfile', it will be sufficient to us the upper case part to execute the command 'copy', but the full name and long version of the command is still 'filelist'.