Example: Using a site-aware zipl environment
![]()
This example demonstrates how to set up a flexible boot configuration for the next boot, using variables in a site-aware zipl environment.
About this task

Procedure
- Choose a kernel image, an initial RAM disk, and a kernel command line, that contains zipl environment variables.
- In the environment file, define sections for each failover site and values for the variables.
- Run zipl to create a boot configuration.
- As usual, you can use zipl-editenv to modify the environment on the boot volume. You can also target a specific section with --S.
- Activate the site-specific values with loadparm, either by preparing a reboot with chreipl, or by specifying loadparm with a site specification at when initiating the boot process.
- Boot the Linux instance.
Example
- Assume that you want to create three variables in the kernel command line and use them to define
different values for different sites. For example, define the following variables in your kernel
command line:
${VAR_A} ${VAR_B} ${VAR_C} - Create a zipl environment
file,
/etc/ziplenv, with two sites, site 1, and site 2, as follows:
For details about the syntax for sites, see Defining sections in the zipl environment file.VAR_A=A [site 1] VAR_A=A1 [site 2] VAR_B=B2This environment file assigns multiple values of keyword VAR_A. First, the value A is assigned in the common space, before any site definition. Second, the value A1 is assigned for site 1.
- Run zipl to create a boot configuration.
- Modify the installed zipl environment
block.Check the installed environment with the zipl-editenv command:
# zipl-editenv --list Common variables: VAR_A=A Site 1: VAR_A=A1 Site 2: VAR_B=B2
Define, for example, one more value for the keyword VAR_A for site 2, and a value C for the new keyword VAR_C in the common space:For details about the zipl-editenv command, see zipl-editenv - Edit the zipl environment block.# zipl-editenv --set VAR_C=C # zipl-editenv --set VAR_A=A2 --site 2 # zipl-editenv --list Common variables: VAR_A=A VAR_C=C Site 1: VAR_A=A1 Site 2: VAR_A=A2 VAR_B=B2
- Use loadparm to activate the keywords for the desired site, for example site 2. To do this, use
chreipl with the loadparm option:
# chreipl ccw 0.0.1000 -L "S2" Re-IPL type: ccw Device: 0.0.1000 Loadparm: "S2" Bootparms: "" clear: 0
For details about loadparm and how to specify menu configurations and sites, see Booting as a z/VM guest from a DASD. - Boot the Linux instance. If you used chreipl to set up the boot, in z/VM,
issue:
# cp ipl 1000
Alternatively, if you did not use chreipl, you can specify the loadparm option with the ipl command:# cp ipl 1000 loadparm S2
What to do next
cat /proc/cmdline to read the
command line. You should see the following values:
C A2 B2Value C was
obtained from the common area. Values A2 and B2 were obtained from the site 2 section in the
environment file.