|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * installing/installing_with_agent_based_installer/prepare-pxe-infra-agent.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="adding-ibmz-lpar-agents_{context}"] |
| 7 | += Adding {ibm-z-title} agents in a Logical Partition (LPAR) |
| 8 | + |
| 9 | +Use the following procedure to manually add {ibm-z-name} agents to your cluster that runs in an LPAR environment. Use this procedure only for {ibm-z-name} clusters running in an LPAR. |
| 10 | + |
| 11 | +.Prerequisites |
| 12 | +* You have Python 3 installed. |
| 13 | +
|
| 14 | +.Procedure |
| 15 | + |
| 16 | +. Create a boot parameter file for the agents. |
| 17 | ++ |
| 18 | +.Example parameter file |
| 19 | +[source,terminal] |
| 20 | +---- |
| 21 | +rd.neednet=1 cio_ignore=all,!condev \ |
| 22 | +console=ttysclp0 \ |
| 23 | +ignition.firstboot ignition.platform.id=metal |
| 24 | +coreos.live.rootfs_url=http://<http_server>/rhcos-<version>-live-rootfs.<architecture>.img \// <1> |
| 25 | +coreos.inst.persistent-kargs=console=ttysclp0 |
| 26 | +ip=<ip>::<gateway>:<netmask>:<hostname>::none nameserver=<dns> \// <2> |
| 27 | +rd.znet=qeth,<network_adaptor_range>,layer2=1 |
| 28 | +rd.<disk_type>=<adapter> \// <3> |
| 29 | +zfcp.allow_lun_scan=0 |
| 30 | +ai.ip_cfg_override=1 \// <4> |
| 31 | +random.trust_cpu=on rd.luks.options=discard |
| 32 | +---- |
| 33 | +<1> For the `coreos.live.rootfs_url` artifact, specify the matching `rootfs` artifact for the `kernel` and `initramfs` that you are starting. Only HTTP and HTTPS protocols are supported. |
| 34 | +<2> For the `ip` parameter, manually assign the IP address, as described in _Installing a cluster with z/VM on IBM Z and IBM LinuxONE_. |
| 35 | +<3> For installations on DASD-type disks, use `rd.dasd` to specify the DASD where {op-system-first} is to be installed. For installations on FCP-type disks, use `rd.zfcp=<adapter>,<wwpn>,<lun>` to specify the FCP disk where {op-system} is to be installed. |
| 36 | +<4> Specify this parameter when you use an Open Systems Adapter (OSA) or HiperSockets. |
| 37 | + |
| 38 | +. Generate the `.ins` and `initrd.img.addrsize` files by running the following Python script: |
| 39 | ++ |
| 40 | +The `.ins` file is a special file that includes installation data and is present on the FTP server. It can be accessed from the HMC system. |
| 41 | +This file contains details such as mapping of the location of installation data on the disk or FTP server, the memory locations where the data is to be copied. |
| 42 | ++ |
| 43 | +[NOTE] |
| 44 | +==== |
| 45 | +The `.ins` and `initrd.img.addrsize` files are not automatically generated as part of boot-artifacts from the installer. You must manually generate these files. |
| 46 | +==== |
| 47 | + |
| 48 | +.. Save the following script to a file, such as `generate-files.py`: |
| 49 | ++ |
| 50 | +.Example of a Python file named `generate-files.py` file |
| 51 | +[source,python] |
| 52 | +---- |
| 53 | +# The following commands retrieve the size of the `kernel` and `initrd`: |
| 54 | +KERNEL_IMG_PATH='./kernel.img' |
| 55 | +INITRD_IMG_PATH='./initrd.img' |
| 56 | +CMDLINE_PATH='./generic.prm' |
| 57 | +kernel_size=(stat -c%s KERNEL_IMG_PATH) |
| 58 | +initrd_size=(stat -c%s INITRD_IMG_PATH) |
| 59 | +# The following command rounds the `kernel` size up to the next megabytes (MB) boundary. |
| 60 | +# This value is the starting address of `initrd.img`. |
| 61 | +offset=(( (kernel_size + 1048575) / 1048576 * 1048576 )) |
| 62 | +INITRD_IMG_NAME=(echo INITRD_IMG_PATH | rev | cut -d '/' -f 1 | rev) |
| 63 | +# The following commands create the kernel binary patch file that contains the `initrd` address and size: |
| 64 | +KERNEL_OFFSET=0x00000000 |
| 65 | +KERNEL_CMDLINE_OFFSET=0x00010480 |
| 66 | +INITRD_ADDR_SIZE_OFFSET=0x00010408 |
| 67 | +OFFSET_HEX=(printf '0x%08x\n' offset) |
| 68 | +# The following command converts the address and size to binary format: |
| 69 | +printf "(printf '%016x\n' $initrd_size)" | xxd -r -p > temp_size.bin |
| 70 | +# The following command concatenates the address and size binaries: |
| 71 | +cat temp_address.bin temp_size.bin > "$INITRD_IMG_NAME.addrsize" |
| 72 | +# The following command deletes temporary files: |
| 73 | +rm -rf temp_address.bin temp_size.bin |
| 74 | +# The following commands create the `.ins` file. |
| 75 | +# The file is based on the paths of the `kernel.img`, `initrd.img`, `initrd.img.addrsize`, and `cmdline` files and the memory locations where the data is to be copied. |
| 76 | +KERNEL_IMG_PATH KERNEL_OFFSET |
| 77 | +INITRD_IMG_PATH OFFSET_HEX |
| 78 | +INITRD_IMG_NAME.addrsize INITRD_ADDR_SIZE_OFFSET |
| 79 | +CMDLINE_PATH KERNEL_CMDLINE_OFFSET |
| 80 | +---- |
| 81 | + |
| 82 | +.. Execute the script by running the following command: |
| 83 | ++ |
| 84 | +[source,terminal] |
| 85 | +---- |
| 86 | +$ python3 <file_name>.py |
| 87 | +---- |
| 88 | + |
| 89 | +. Transfer the `initrd`, `kernel`, `generic.ins`, and `initrd.img.addrsize` parameter files to the file server. For more information, see link:https://www.ibm.com/docs/en/linux-on-systems?topic=bl-booting-linux-in-lpar-mode[Booting Linux in LPAR mode] (IBM documentation). |
| 90 | + |
| 91 | +. Start the machine. |
| 92 | + |
| 93 | +. Repeat the procedure for all other machines in the cluster. |
0 commit comments