5.5. 手动添加 IBM Z 代理
创建 PXE 资产后,您可以添加 IBM Z® 代理。仅将此流程用于 IBM Z® 集群。
根据您的 IBM Z® 环境,您可以从以下选项中选择:
- 使用 z/VM 添加 IBM Z® 代理
- 使用 RHEL KVM 添加 IBM Z® 代理
- 使用逻辑分区 (LPAR) 添加 IBM Z® 代理
目前,IBM Z® (s390x) 上的 ISO 引导支持仅适用于 Red Hat Enterprise Linux (RHEL) KVM,这为选择 PXE 或基于 ISO 的安装提供了灵活性。对于使用 z/VM 和逻辑分区 (LPAR) 的安装,只支持 PXE 引导。
5.5.1. 使用 z/VM 添加 IBM Z 代理 复制链接链接已复制到粘贴板!
使用以下步骤使用 z/VM 手动添加 IBM Z® 代理。仅对带有 z/VM 的 IBM Z® 集群使用此流程。
流程
为 z/VM 客户机创建一个参数文件:
参数文件示例
rd.neednet=1 \ console=ttysclp0 \ coreos.live.rootfs_url=<rootfs_url> \1 ip=172.18.78.2::172.18.78.1:255.255.255.0:::none nameserver=172.18.78.1 \2 zfcp.allow_lun_scan=0 \3 rd.znet=qeth,0.0.bdd0,0.0.bdd1,0.0.bdd2,layer2=1 \ rd.dasd=0.0.4411 \4 rd.zfcp=0.0.8001,0x50050763040051e3,0x4000406300000000 \5 random.trust_cpu=on rd.luks.options=discard \ ignition.firstboot ignition.platform.id=metal \ console=tty1 console=ttyS1,115200n8 \ coreos.inst.persistent-kargs="console=tty1 console=ttyS1,115200n8"- 1
- 对于
coreos.live.rootfs_url工件,请为您要引导的内核和initramfs指定匹配的rootfs工件。仅支持 HTTP 和 HTTPS 协议。 - 2
- 对于
ip参数,使用 DHCP 自动分配 IP 地址,或者手动分配 IP 地址,如"在 IBM Z® 和 IBM® LinuxONE 上使用 z/VM 安装集群"中所述。 - 3
- 默认值为
1。使用 OSA 网络适配器时省略此条目。 - 4
- 对于在 DASD 类型磁盘中安装,请使用
rd.dasd指定要安装 Red Hat Enterprise Linux CoreOS (RHCOS) 的 DASD。为 FCP 类型磁盘省略此条目。 - 5
- 对于在 FCP 类型磁盘中安装,请使用
rd.zfcp=<adapter>,<wwpn>,<lun>指定要安装 RHCOS 的 FCP 磁盘。为 DASD 类型磁盘省略这个条目。
所有其他参数保持不变。
将
kernel.img、common.parm和initrd.img文件与 z/VM 客户机虚拟机的虚拟读取器中解放。如需更多信息,请参阅 PUNCH (IBM 文档)。
提示您可以使用
CP PUNCH命令,或者使用 Linux (vmur命令) 在两个 z/VM 虚拟机之间传输文件。- 登录到 bootstrap 机器上的对话监控系统 (CMS)。
运行以下命令,从 reader IPL bootstrap 机器:
$ ipl c如需更多信息,请参阅 IPL (IBM 文档)。
5.5.2. 使用 RHEL KVM 添加 IBM Z 代理 复制链接链接已复制到粘贴板!
使用以下步骤使用 RHEL KVM 手动添加 IBM Z® 代理。仅将此流程用于带有 RHEL KVM 的 IBM Z® 集群。
流程
- 引导 RHEL KVM 机器。
要部署虚拟服务器,请使用以下参数运行
virt-install命令:$ virt-install \ --name <vm_name> \ --autostart \ --ram=16384 \ --cpu host \ --vcpus=8 \ --location <path_to_kernel_initrd_image>,kernel=kernel.img,initrd=initrd.img \1 --disk <qcow_image_path> \ --network network:macvtap ,mac=<mac_address> \ --graphics none \ --noautoconsole \ --wait=-1 \ --extra-args "rd.neednet=1 nameserver=<nameserver>" \ --extra-args "ip=<IP>::<nameserver>::<hostname>:enc1:none" \ --extra-args "coreos.live.rootfs_url=http://<http_server>:8080/agent.s390x-rootfs.img" \ --extra-args "random.trust_cpu=on rd.luks.options=discard" \ --extra-args "ignition.firstboot ignition.platform.id=metal" \ --extra-args "console=tty1 console=ttyS1,115200n8" \ --extra-args "coreos.inst.persistent-kargs=console=tty1 console=ttyS1,115200n8" \ --osinfo detect=on,require=off- 1
- 对于
--location参数,指定 HTTP 或 HTTPS 服务器中的 kernel/initrd 的位置。
5.5.3. 在逻辑分区 (LPAR) 中添加 IBM Z 代理 复制链接链接已复制到粘贴板!
使用以下步骤将 IBM Z® 代理手动添加到在 LPAR 环境中运行的集群。这个过程只适用于在 LPAR 中运行的 IBM Z® 集群。
先决条件
- 已安装 Python 3。
流程
为代理创建引导参数文件。
参数文件示例
rd.neednet=1 cio_ignore=all,!condev \ console=ttysclp0 \ ignition.firstboot ignition.platform.id=metal coreos.live.rootfs_url=http://<http_server>/rhcos-<version>-live-rootfs.<architecture>.img \1 coreos.inst.persistent-kargs=console=ttysclp0 ip=<ip>::<gateway>:<netmask>:<hostname>::none nameserver=<dns> \2 rd.znet=qeth,<network_adaptor_range>,layer2=1 rd.<disk_type>=<adapter> \3 zfcp.allow_lun_scan=0 ai.ip_cfg_override=1 \4 random.trust_cpu=on rd.luks.options=discard- 1
- 对于
coreos.live.rootfs_url工件,请为您要启动的kernel和initramfs指定匹配的rootfs工件。仅支持 HTTP 和 HTTPS 协议。 - 2
- 对于
ip参数,请手动分配 IP 地址,如 在 IBM Z 和 IBM LinuxONE 中使用 z/VM 安装集群中所述。 - 3
- 对于在 DASD 类型磁盘中安装,请使用
rd.dasd指定要安装 Red Hat Enterprise Linux CoreOS (RHCOS) 的 DASD。对于在 FCP 类型磁盘中安装,请使用rd.zfcp=<adapter>,<wwpn>,<lun>指定要安装 RHCOS 的 FCP 磁盘。 - 4
- 使用 Open Systems Adapter (OSA) 或 HiperSockets 时指定此参数。
通过运行以下 Python 脚本生成
.ins和initrd.img.addrsize文件:.ins文件是一个特殊文件,其中包含安装数据并存在于 FTP 服务器上。它可以从 HMC 系统访问。此文件包含详细信息,如映射磁盘或 FTP 服务器上安装数据的位置、要复制数据的内存位置。注意.ins和initrd.img.addrsize文件不会作为安装程序的 boot-artifacts 的一部分自动生成。您必须手动生成这些文件。将以下脚本保存到文件中,如
generate-files.py:名为
generate-files.py文件的 Python 文件示例# The following commands retrieve the size of the `kernel` and `initrd`: KERNEL_IMG_PATH='./kernel.img' INITRD_IMG_PATH='./initrd.img' CMDLINE_PATH='./generic.prm' kernel_size=(stat -c%s KERNEL_IMG_PATH) initrd_size=(stat -c%s INITRD_IMG_PATH) # The following command rounds the `kernel` size up to the next megabytes (MB) boundary. # This value is the starting address of `initrd.img`. offset=(( (kernel_size + 1048575) / 1048576 * 1048576 )) INITRD_IMG_NAME=(echo INITRD_IMG_PATH | rev | cut -d '/' -f 1 | rev) # The following commands create the kernel binary patch file that contains the `initrd` address and size: KERNEL_OFFSET=0x00000000 KERNEL_CMDLINE_OFFSET=0x00010480 INITRD_ADDR_SIZE_OFFSET=0x00010408 OFFSET_HEX=(printf '0x%08x\n' offset) # The following command converts the address and size to binary format: printf "(printf '%016x\n' $initrd_size)" | xxd -r -p > temp_size.bin # The following command concatenates the address and size binaries: cat temp_address.bin temp_size.bin > "$INITRD_IMG_NAME.addrsize" # The following command deletes temporary files: rm -rf temp_address.bin temp_size.bin # The following commands create the `.ins` file. # 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. KERNEL_IMG_PATH KERNEL_OFFSET INITRD_IMG_PATH OFFSET_HEX INITRD_IMG_NAME.addrsize INITRD_ADDR_SIZE_OFFSET CMDLINE_PATH KERNEL_CMDLINE_OFFSET运行以下命令执行脚本:
$ python3 <file_name>.py
-
将
initrd、kernel、common.ins和initrd.img.addrsize参数文件传输到文件服务器。如需更多信息,请参阅 在 LPAR 模式中引导 Linux (IBM 文档)。 - 启动机器。
- 对集群中的所有其他机器重复这个过程。