Este contenido no está disponible en el idioma seleccionado.
Chapter 8. Booting hosts with the discovery image
The Assisted Installer uses an initial image to run an agent that performs hardware and network validations before attempting to install OpenShift Container Platform. You can boot hosts with the discovery image using three methods:
- USB drive
- Redfish virtual media
- iPXE
8.1. Creating an ISO image on a USB drive Copiar enlaceEnlace copiado en el portapapeles!
You can install the Assisted Installer agent using a USB drive that contains the discovery ISO image. Starting the host with the USB drive prepares the host for the software installation.
Procedure
- On the administration host, insert a USB drive into a USB port.
Copy the ISO image to the USB drive, for example:
dd if=<path_to_iso> of=<path_to_usb> status=progress
# dd if=<path_to_iso> of=<path_to_usb> status=progressCopy to Clipboard Copied! Toggle word wrap Toggle overflow where:
- <path_to_iso>
-
is the relative path to the downloaded discovery ISO file, for example,
discovery.iso. - <path_to_usb>
is the location of the connected USB drive, for example,
/dev/sdb.After the ISO is copied to the USB drive, you can use the USB drive to install the Assisted Installer agent on the cluster host.
8.2. Booting with a USB drive Copiar enlaceEnlace copiado en el portapapeles!
To register nodes with the Assisted Installer using a bootable USB drive, use the following procedure.
Procedure
- Insert the RHCOS discovery ISO USB drive into the target host.
- Configure the boot drive order in the server firmware settings to boot from the attached discovery ISO, and then reboot the server.
Wait for the host to boot up.
- For web console installations, on the administration host, return to the browser. Wait for the host to appear in the list of discovered hosts.
For API installations, refresh the token, check the enabled host count, and gather the host IDs:
source refresh-token
$ source refresh-tokenCopy to Clipboard Copied! Toggle word wrap Toggle overflow curl -s -X GET "https://api.openshift.com/api/assisted-install/v2/clusters/$CLUSTER_ID" \ --header "Content-Type: application/json" \ -H "Authorization: Bearer $API_TOKEN" \ | jq '.enabled_host_count'
$ curl -s -X GET "https://api.openshift.com/api/assisted-install/v2/clusters/$CLUSTER_ID" \ --header "Content-Type: application/json" \ -H "Authorization: Bearer $API_TOKEN" \ | jq '.enabled_host_count'Copy to Clipboard Copied! Toggle word wrap Toggle overflow curl -s -X GET "https://api.openshift.com/api/assisted-install/v2/clusters/$CLUSTER_ID" \ --header "Content-Type: application/json" \ -H "Authorization: Bearer $API_TOKEN" \ | jq '.host_networks[].host_ids'
$ curl -s -X GET "https://api.openshift.com/api/assisted-install/v2/clusters/$CLUSTER_ID" \ --header "Content-Type: application/json" \ -H "Authorization: Bearer $API_TOKEN" \ | jq '.host_networks[].host_ids'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
[ "1062663e-7989-8b2d-7fbb-e6f4d5bb28e5" ]
[ "1062663e-7989-8b2d-7fbb-e6f4d5bb28e5" ]Copy to Clipboard Copied! Toggle word wrap Toggle overflow
8.3. Booting from an HTTP-hosted ISO image using the Redfish API Copiar enlaceEnlace copiado en el portapapeles!
You can provision hosts in your network using ISOs that you install using the Redfish Baseboard Management Controller (BMC) API.
Prerequisites
- Download the installation Red Hat Enterprise Linux CoreOS (RHCOS) ISO.
Procedure
- Copy the ISO file to an HTTP server accessible in your network.
Boot the host from the hosted ISO file, for example:
Call the redfish API to set the hosted ISO as the
VirtualMediaboot media by running the following command:curl -k -u <bmc_username>:<bmc_password> \ -d '{"Image":"<hosted_iso_file>", "Inserted": true}' \ -H "Content-Type: application/json" \ -X POST <host_bmc_address>/redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/CD/Actions/VirtualMedia.InsertMedia$ curl -k -u <bmc_username>:<bmc_password> \ -d '{"Image":"<hosted_iso_file>", "Inserted": true}' \ -H "Content-Type: application/json" \ -X POST <host_bmc_address>/redfish/v1/Managers/iDRAC.Embedded.1/VirtualMedia/CD/Actions/VirtualMedia.InsertMediaCopy to Clipboard Copied! Toggle word wrap Toggle overflow Where:
- <bmc_username>:<bmc_password>
- Is the username and password for the target host BMC.
- <hosted_iso_file>
-
Is the URL for the hosted installation ISO, for example:
https://example.com/rhcos-live-minimal.iso. The ISO must be accessible from the target host machine. - <host_bmc_address>
- Is the BMC IP address of the target host machine.
Set the host to boot from the
VirtualMediadevice by running the following command:curl -k -u <bmc_username>:<bmc_password> \ -X PATCH -H 'Content-Type: application/json' \ -d '{"Boot": {"BootSourceOverrideTarget": "Cd", "BootSourceOverrideMode": "UEFI", "BootSourceOverrideEnabled": "Once"}}' \ <host_bmc_address>/redfish/v1/Systems/System.Embedded.1$ curl -k -u <bmc_username>:<bmc_password> \ -X PATCH -H 'Content-Type: application/json' \ -d '{"Boot": {"BootSourceOverrideTarget": "Cd", "BootSourceOverrideMode": "UEFI", "BootSourceOverrideEnabled": "Once"}}' \ <host_bmc_address>/redfish/v1/Systems/System.Embedded.1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Reboot the host:
curl -k -u <bmc_username>:<bmc_password> \ -d '{"ResetType": "ForceRestart"}' \ -H 'Content-type: application/json' \ -X POST <host_bmc_address>/redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.Reset$ curl -k -u <bmc_username>:<bmc_password> \ -d '{"ResetType": "ForceRestart"}' \ -H 'Content-type: application/json' \ -X POST <host_bmc_address>/redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.ResetCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: If the host is powered off, you can boot it using the
{"ResetType": "On"}switch. Run the following command:curl -k -u <bmc_username>:<bmc_password> \ -d '{"ResetType": "On"}' -H 'Content-type: application/json' \ -X POST <host_bmc_address>/redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.Reset$ curl -k -u <bmc_username>:<bmc_password> \ -d '{"ResetType": "On"}' -H 'Content-type: application/json' \ -X POST <host_bmc_address>/redfish/v1/Systems/System.Embedded.1/Actions/ComputerSystem.ResetCopy to Clipboard Copied! Toggle word wrap Toggle overflow
8.4. Booting hosts using iPXE Copiar enlaceEnlace copiado en el portapapeles!
The Assisted Installer provides an iPXE script including all of the artifacts needed to boot the discovery image for an infrastructure environment. Due to the limitations of the current HTTPS implementation of iPXE, the recommendation is to download and expose the needed artifacts in an HTTP server. Currently, even if iPXE supports HTTPS protocol, the supported algorithms are old and not recommended.
The full list of supported ciphers is in https://ipxe.org/crypto.
Prerequisites
- You have created an infrastructure environment by using the API or you have created a cluster by using the web console.
-
You have your infrastructure environment ID exported in your shell as
$INFRA_ENV_ID. -
You have credentials to use when accessing the API and have exported a token as
$API_TOKENin your shell.
If you configure iPXE by using the web console, the $INFRA_ENV_ID and $API_TOKEN variables are preset.
- You have an HTTP server to host the images.
IBM Power® only supports PXE, which has the following requirements:
-
GRUB2 installed at
/var/lib/tftpboot - DHCP and TFTP for PXE
Procedure
Download the iPXE script directly from the web console, or get the iPXE script from the Assisted Installer by running the following command:
curl \ --silent \ --header "Authorization: Bearer $API_TOKEN" \ https://api.openshift.com/api/assisted-install/v2/infra-envs/$INFRA_ENV_ID/downloads/files?file_name=ipxe-script > ipxe-script
$ curl \ --silent \ --header "Authorization: Bearer $API_TOKEN" \ https://api.openshift.com/api/assisted-install/v2/infra-envs/$INFRA_ENV_ID/downloads/files?file_name=ipxe-script > ipxe-scriptCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example
#!ipxe initrd --name initrd http://api.openshift.com/api/assisted-images/images/<infra_env_id>/pxe-initrd?arch=x86_64&image_token=<token_string>&version=4.10 kernel http://api.openshift.com/api/assisted-images/boot-artifacts/kernel?arch=x86_64&version=4.10 initrd=initrd coreos.live.rootfs_url=http://api.openshift.com/api/assisted-images/boot-artifacts/rootfs?arch=x86_64&version=4.10 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" boot
#!ipxe initrd --name initrd http://api.openshift.com/api/assisted-images/images/<infra_env_id>/pxe-initrd?arch=x86_64&image_token=<token_string>&version=4.10 kernel http://api.openshift.com/api/assisted-images/boot-artifacts/kernel?arch=x86_64&version=4.10 initrd=initrd coreos.live.rootfs_url=http://api.openshift.com/api/assisted-images/boot-artifacts/rootfs?arch=x86_64&version=4.10 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" bootCopy to Clipboard Copied! Toggle word wrap Toggle overflow Download the required artifacts by extracting URLs from the
ipxe-script:Download the initial RAM disk by running the following command:
awk '/^initrd /{print $NF}' ipxe-script \ | xargs curl -o initrd.img -L$ awk '/^initrd /{print $NF}' ipxe-script \ | xargs curl -o initrd.img -LCopy to Clipboard Copied! Toggle word wrap Toggle overflow Download the Linux kernel by running the following command:
awk '/^kernel /{print $2}' ipxe-script | xargs curl -o kernel -L$ awk '/^kernel /{print $2}' ipxe-script | xargs curl -o kernel -LCopy to Clipboard Copied! Toggle word wrap Toggle overflow Download the root filesystem by running the following command:
grep ^kernel ipxe_script | xargs -n1 | grep ^coreos.live.rootfs_url | cut -d = -f 2,3,4 | xargs curl -o rootfs.img -L
$ grep ^kernel ipxe_script | xargs -n1 | grep ^coreos.live.rootfs_url | cut -d = -f 2,3,4 | xargs curl -o rootfs.img -LCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Change the URLs to the different artifacts in the
ipxe-scriptto match your local HTTP server. For example:#!ipxe set webserver http://192.168.0.1 initrd --name initrd $webserver/initrd.img kernel $webserver/kernel initrd=initrd coreos.live.rootfs_url=$webserver/rootfs.img 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" boot
#!ipxe set webserver http://192.168.0.1 initrd --name initrd $webserver/initrd.img kernel $webserver/kernel initrd=initrd coreos.live.rootfs_url=$webserver/rootfs.img 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" bootCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: When installing with RHEL KVM on IBM Z® you must boot the host by specifying additional kernel arguments:
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
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,115200n8Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteWhen you install with iPXE on RHEL KVM, the VMs on the VM host might not start on the first boot. You must start them manually.
Optional: When installing on IBM Power® you must download the
initramfs,kernel, androotimages as follows:-
Copy the
initrd.imgandkernel.imgimages to the/var/lib/tftpboot/rhcosPXE directory. -
Copy the
rootfs.imgto the/var/www/html/installHTTPD directory. Add the following entry to the
/var/lib/tftpboot/boot/grub2/grub.cfgdirectory:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Copy the