AutomatedInstallsWithPreseed

Differences between revisions 31 and 32
Revision 31 as of 2016-05-27 19:37:04
Size: 14068
Editor: fheimes
Comment:
Revision 32 as of 2016-05-27 19:37:43
Size: 14061
Editor: fheimes
Comment:
Deletions are marked like this. Additions are marked like this.
Line 185: Line 185:
`url=ftp://10.13.0.2/preseed/preseed-jfh.cfg ` <<BR>> `url=ftp://server/preseed/preseed.cfg ` <<BR>>

Automated Ubuntu Server Installations on s390x with preseed

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

The (d-i) installer on s390x runs in netboot mode and has two stages - the initial stage (before networking has been started in the installer, usually run at the console) and the second stage that is usually run via ssh.

Automating the installation can be done in multiple ways:

  • Pass preseed keys or aliases via parmfile: e.g. debian-installer/locale=en_US domain=myhostname
  • Append complete preseed.cfg to the initrd.ubuntu
  • Preseed networking information via parmfile, and use url= parameter to fetch the rest of the config over the network

Depending on your setup, you may want to preseed some or all keys one one of the above methods, or combination of methods.

For details information on d-i preseeding please see the installation guide at https://help.ubuntu.com/lts/installation-guide/index.html

Some hints and examples are available below.

In the paramfile the format of the keys is simple space separated key=value pairs, e.g.: ` priority=critical locale=en_US preseed/url=http://example.com/preseed.cfg ... `

In the preseed files as fetched by preseed/url, preseed/file, or appended to the initrd.ubuntu the formatting is slightly more verbose - standard debconf: ` d-i debconf/priority string critical d-i debian-installer/locale string en_US ... `

Aliases

Because the boot prompt can become quite long, there are short forms available, called aliases, at least for some parameters, like 'locale' instead of 'debian-installer/locale' or 'url' instead of 'preseed/url'. The boot parameters as well as their aliases form key/value pairs with an equal sign '=' as link.

Alias

Normal

priority

debconf/priority

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

Please find a table with all aliases here.
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', it also works on s390x, means 64-bit)
With the help of these you can overcome/answer even the initial questions.

Some example 's390-' boot 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:

Especially the following 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/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/port

string, default: 0

Relative Port

s390-netdevice/qeth/layer2

boolean, default: false

Device in layer2 mode

s390-netdevice/iucv/peer

string

Name of VM peer

For further details see: Template: s390-netdevice

Table: s390-dasd

Key

Value

Description

s390-dasd/dasd

string

one or more DASD devices using comma ',' to separate multiple entries

complete dasd device number, incl. leading zeros, separated by dots '.'

s390-dasd/auto_format

boolean

format DASD device automatically in case it is not low-level formatted

s390-dasd/force_format

boolean

force DASD device format even in case it was already low-level formatted

For further details see: Template: s390-dasd

Note:
Since the dasd parameters listed above were recently added, they are currently only included in the 16.10 (Yakkety Yak) daily build image and not yet in the standard 16.04 (Xenial Xerus) image, but will be integrated there as an SRU (Stable Release Update) soon.
To use these not yet released dasd parameters already with Xenial via the proposed repository, they need to be explicitly allowed with the parameter:
apt-setup/proposed=true
e.g. apt-setup/proposed=true s390-dasd/dasd=0.0.0200 ...
This apt-setup/proposed=true parameter will not longer be required on Xenial, once the SRU is released and is not required at all on Yakkety!

Table: s390-zfcp

Key

Value

Description

s390-zfcp/zfcp

string

internal use; one or more SCSI devices using 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

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 parameter set:
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.12 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/use_autoconfig=1 netcfg/get_hostname=ZLIN12 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 - especially 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 thoroughly 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 transferred 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 transferred 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 server - 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 'UBUAUTO EXEC A':
xedit UBUAUTO 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 the z/VM reader's 80 byte limit into account.
xedit PARMFILE UBUAUTO A
A (non-complete) example may look like this:

ro locale=en_US auto=true priority=critical apt-setup/proposed=true
url=ftp://server/preseed/preseed.cfg                        
s390-netdevice/choose_networktype=qeth                             
s390-netdevice/qeth/layer2=true s390-netdevice/qeth/port=0         
s390-netdevice/qeth/choose=0.0.0200-0.0.0201-0.0.0202              
netcfg/get_ipaddress=10.245.236.12 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/use_autoconfig=1 netcfg/disable_dhcp=true                   
hostname=ZLIN12 domain=canonical.com network-console/start=note   
network-console/password=<your_password>                           
network-console/password-again=<your_password>                     

A sample preseed file can be found here.

These changes can also be done with the help of the 'FILEList' command, which is a simple file management tool.

If a command is typed beginning with upper case and at some character position with lower case, like 'COPYfile', it will be sufficient to use the upper case part to execute the command 'copy', but the full name and long version of the command is still 'copyfile'.

S390X/InstallationGuide/AutomatedInstallsWithPreseed (last edited 2023-04-19 11:38:50 by fheimes)