Example: Using a site-aware zipl environment

Red Hat Enterprise Linux 9.2 LPAR mode z/VM guest KVM guest

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

This example, illustrated in Figure 1, demonstrates how to use a site-aware zipl environment with a Linux instance running as a guest of z/VM and that is booted from a DASD.
Figure 1. zipl site-aware scenario

This figure is described in the text that precedes it

Procedure

  1. Choose a kernel image, an initial RAM disk, and a kernel command line, that contains zipl environment variables.
  2. In the environment file, define sections for each failover site and values for the variables.
  3. Run zipl to create a boot configuration.
  4. As usual, you can use zipl-editenv to modify the environment on the boot volume. You can also target a specific section with --S.
  5. 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.
  6. Boot the Linux instance.

Example

Assume that you are on z/VM and your boot device is a DASD with a bus ID 0.0.1000. You have prepared the boot components kernel image, initial RAM disk, and kernel command line, for the next boot.
  1. 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}
  2. Create a zipl environment file, /etc/ziplenv, with two sites, site 1, and site 2, as follows:
    VAR_A=A
    [site 1]
    VAR_A=A1
    [site 2]
    VAR_B=B2
    For details about the syntax for sites, see Defining sections in the zipl environment file.

    This 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.

  3. Run zipl to create a boot configuration.
  4. 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:
    # 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
    For details about the zipl-editenv command, see zipl-editenv - Edit the zipl environment block.
  5. 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.
  6. 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

Log in to the Linux instance and issue cat /proc/cmdline to read the command line.
You should see the following values:
C A2 B2
Value C was obtained from the common area. Values A2 and B2 were obtained from the site 2 section in the environment file.