Chapter 4. Using PXE to provision hosts You can provision bare-metal instances with Satellite by using one of the following methods: Unattended Provisioning New hosts are identified by a MAC address. Satellite Server provisions the host by using a PXE boot process. Unattended Provisioning with Discovery New hosts use PXE boot to load the Satellite Discovery service. This service identifies hardware information about the host and lists it as an available host to provision. For more information, see Chapter 6, Discovering hosts on a network . PXE-less Provisioning New hosts are provisioned with a boot disk image that Satellite Server generates. BIOS and UEFI support With Red Hat Satellite, you can perform both BIOS and UEFI based PXE provisioning. Both BIOS and UEFI interfaces work as interpreters between the operating system and firmware of a computer, initializing hardware components and starting the operating system at boot time. PXE loaders In Satellite provisioning, the PXE loader option defines the DHCP filename option to use during provisioning. For BIOS systems, use the PXELinux BIOS option to enable a provisioned host to download the pxelinux.0 file over TFTP. For UEFI systems, use the PXEGrub2 UEFI option to enable a TFTP client to download grub2/grubx64.efi file, or use the PXEGrub2 UEFI HTTP option to enable an UEFI HTTP client to download grubx64.efi from Capsule with the HTTP Boot feature. For more information about supported workflows, see Supported architectures and provisioning scenarios . Bonded network interfaces You can configure a bonded interface that Satellite will use during the installation process, for example, to download installation content. After provisioning completes, the provisioned system can also use the bonded interface. Important Satellite cannot PXE boot a bonded interface that requires configuration on a network switch as well as on your host. After your host loads the kernel of an installer or the kernel of an operating system, bonding works as expected. Therefore, you can use a boot disk to work around PXE boot limitations when your bonded interface requires configuration on both a switch and your host. 4.1. Prerequisites for bare-metal provisioning The requirements for bare-metal provisioning include: A Capsule Server managing the network for bare-metal hosts. For unattended provisioning and discovery-based provisioning, Satellite Server requires PXE server settings. For more information about networking requirements, see Chapter 3, Configuring networking . For more information about the Discovery service, Chapter 6, Discovering hosts on a network . A bare-metal host or a blank VM. You can use synchronized content repositories for Red Hat Enterprise Linux. For more information, see Syncing Repositories in Managing content . Provide an activation key for host registration. For more information, see Creating An Activation Key in Managing content . For information about the security token for unattended and PXE-less provisioning, see Section 4.2, "Configuring the security token validity duration" . 4.2. Configuring the security token validity duration When performing any kind of provisioning, as a security measure, Satellite automatically generates a unique token and adds this token to the kickstart URL in the PXE configuration file (PXELinux, Grub2). By default, the token is valid for 360 minutes. When you provision a host, ensure that you reboot the host within this time frame. If the token expires, it is no longer valid and you receive a 404 error and the operating system installer download fails. Procedure In the Satellite web UI, navigate to Administer > Settings , and click the Provisioning tab. Find the Token duration option and click the edit icon and edit the duration, or enter 0 to disable token generation. If token generation is disabled, an attacker can spoof client IP address and download kickstart from Satellite Server, including the encrypted root password. 4.3. Creating hosts with unattended provisioning Unattended provisioning is the simplest form of host provisioning. You enter the host details on Satellite Server and boot your host. Satellite Server automatically manages the PXE configuration, organizes networking services, and provides the operating system and configuration for the host. This method of provisioning hosts uses minimal interaction during the process. To use the CLI instead of the Satellite web UI, see the CLI procedure . Procedure In the Satellite web UI, navigate to Hosts > Create Host . In the Name field, enter a name for the host. Optional: Click the Organization tab and change the organization context to match your requirement. Optional: Click the Location tab and change the location context to match your requirement. From the Host Group list, select a host group that you want to assign your host to. That host group will populate the form. Click the Interfaces tab, and on the interface of the host, click Edit . Verify that the fields are populated with values. Note in particular: Satellite automatically assigns an IP address for the new host. In the MAC address field, enter a MAC address of the provisioning interface of the host. This ensures the identification of the host during the PXE boot process. The Name from the Host tab becomes the DNS name . Ensure that Satellite automatically selects the Managed , Primary , and Provision options for the first interface on the host. If not, select them. Click OK to save. To add another interface, click Add Interface . You can select only one interface for Provision and Primary . Click the Operating System tab, and verify that all fields contain values. Confirm each aspect of the operating system. Optional: Click Resolve in Provisioning template to check the new host can identify the right provisioning templates to use. For more information about associating provisioning templates, see Section 2.12, "Provisioning templates" . Click the Parameters tab, and ensure that a parameter exists that provides an activation key. If not, add an activation key. Click Submit to save the host details. For more information about network interfaces, see Adding network interfaces in Managing hosts . This creates the host entry and the relevant provisioning settings. This also includes creating the necessary directories and files for PXE booting the bare-metal host. If you start the physical host and set its boot mode to PXE, the host detects the DHCP service of Satellite Server's integrated Capsule, receives HTTP endpoint of the Kickstart tree and installs the operating system. When the installation completes, the host also registers to Satellite Server using the activation key and installs the necessary configuration and management tools from the Red Hat Satellite Client 6 repository. CLI procedure Create the host with the hammer host create command: Ensure the network interface options are set using the hammer host interface update command: 4.4. Creating hosts with PXE-less provisioning Some hardware does not provide a PXE boot interface. In Satellite, you can provision a host without PXE boot. This is also known as PXE-less provisioning and involves generating a boot ISO that hosts can use. Using this ISO, the host can connect to Satellite Server, boot the installation media, and install the operating system. Satellite also provides a PXE-less discovery service that operates without PXE-based services, such as DHCP and TFTP. For more information, see Section 6.4, "Discovery in PXE-less mode" . Boot ISO types There are the following types of boot ISOs: Full host image A boot ISO that contains the kernel and initial RAM disk image for the specific host. This image is useful if the host fails to chainload correctly. The provisioning template still downloads from Satellite Server. Subnet image A boot ISO that is not associated with a specific host. The ISO sends the host's MAC address to Capsule Server, which matches it against the host entry. The image does not store IP address details and requires access to a DHCP server on the network to bootstrap. This image is generic to all hosts with a provisioning NIC on the same subnet. The image is based on iPXE boot firmware, only a limited number of network cards is supported. Note The Full host image is based on SYSLINUX and Grub and works with most network cards. When using a Subnet image , see supported hardware on ipxe.org for a list of network card drivers expected to work with an iPXE-based boot disk. Full host image contains a provisioning token, therefore the generated image has limited lifespan. For more information about configuring security tokens, read Section 4.2, "Configuring the security token validity duration" . To use the CLI instead of the Satellite web UI, see the CLI procedure . Procedure In the Satellite web UI, navigate to Hosts > Create Host . In the Name field, enter a name for the host. Optional: Click the Organization tab and change the organization context to match your requirement. Optional: Click the Location tab and change the location context to match your requirement. From the Host Group list, select a host group that you want to assign your host to. That host group will populate the form. Click the Interfaces tab, and on the interface of the host, click Edit . Verify that the fields are populated with values. Note in particular: Satellite automatically assigns an IP address for the new host. In the MAC address field, enter a MAC address of the provisioning interface of the host. This ensures the identification of the host during the PXE boot process. The Name from the Host tab becomes the DNS name . Ensure that Satellite automatically selects the Managed , Primary , and Provision options for the first interface on the host. If not, select them. Click OK to save. To add another interface, click Add Interface . You can select only one interface for Provision and Primary . Click the Operating System tab, and verify that all fields contain values. Confirm each aspect of the operating system. Click Resolve in Provisioning Templates to check the new host can identify the right provisioning templates to use. For more information about associating provisioning templates, see Section 2.12, "Provisioning templates" . Click the Parameters tab, and ensure that a parameter exists that provides an activation key. If not, add an activation key. Click Submit to save the host details. This creates a host entry and the host details page appears. Download the boot disk from Satellite Server. For Full host image , on the host details page, click the vertical ellipsis and select Full host ' My_Host_Name ' image . For Subnet image , navigate to Infrastructure > Subnets , click the dropdown menu in the Actions column of the required subnet and select Subnet generic image . Write the ISO to a USB storage device using the dd utility or livecd-tools if required. When you start the host and boot from the ISO or the USB storage device, the host connects to Satellite Server and starts installing operating system from its Kickstart tree. When the installation completes, the host also registers to Satellite Server using the activation key and installs the necessary configuration and management tools from the Red Hat Satellite Client 6 repository. CLI procedure Create the host using the hammer host create command. Ensure that your network interface options are set using the hammer host interface update command. Download the boot disk from Satellite Server using the hammer bootdisk command: For Full host image : For Subnet image : This creates a boot ISO for your host to use. Write the ISO to a USB storage device using the dd utility or livecd-tools if required. When you start the physical host and boot from the ISO or the USB storage device, the host connects to Satellite Server and starts installing operating system from its Kickstart tree. When the installation completes, the host also registers to Satellite Server using the activation key and installs the necessary configuration and management tools from the Red Hat Satellite Client 6 repository. 4.5. Creating hosts with UEFI HTTP boot provisioning You can provision hosts from Satellite using the UEFI HTTP Boot. This is the only method with which you can provision hosts in IPv6 network. To use the CLI instead of the Satellite web UI, see the CLI procedure . Prerequisites Ensure that you meet the requirements for HTTP booting. For more information, see HTTP Booting Requirements in Overview, concepts, and deployment considerations . Procedure On Capsule that you use for provisioning, update the grub2-efi package to the latest version: Enable foreman-proxy-http , foreman-proxy-httpboot , and foreman-proxy-tftp features. Ensure that the Capsule has TFTP and HTTPBoot features recognized. In the Satellite web UI, navigate to Infrastructure > Capsules and click on Capsule to see the list of recognized features. Click Refresh Features if any of the features are missing. Ensure that Capsule is associated with the provisioning subnet. In the Satellite web UI, navigate to Infrastructure > Subnets > Edit Subnet > Capsules and select the Capsule for both TFTP and HTTPBoot options. Click OK to save. In the Satellite web UI, navigate to Hosts > Create Host . In the Name field, enter a name for the host. Optional: Click the Organization tab and change the organization context to match your requirement. Optional: Click the Location tab and change the location context to match your requirement. From the Host Group list, select a host group that you want to assign your host to. That host group will populate the form. Click the Interfaces tab, and on the interface of the host, click Edit . Verify that the fields are populated with values. Note in particular: Satellite automatically assigns an IP address for the new host. In the MAC address field, enter a MAC address of the provisioning interface of the host. This ensures the identification of the host during the PXE boot process. The Name from the Host tab becomes the DNS name . Ensure that Satellite automatically selects the Managed , Primary , and Provision options for the first interface on the host. If not, select them. Click OK to save. To add another interface, click Add Interface . You can select only one interface for Provision and Primary . Click the Operating System tab, and verify that all fields contain values. Confirm each aspect of the operating system. From the PXE Loader list, select Grub2 UEFI HTTP . Optional: Click Resolve in Provisioning template to check the new host can identify the right provisioning templates to use. For more information about associating provisioning templates, see Section 2.14, "Creating provisioning templates" . Click the Parameters tab, and ensure that a parameter exists that provides an activation key. If not, add an activation key. Click Submit to save the host details. For more information about network interfaces, see Adding network interfaces in Managing hosts . Set the host to boot in UEFI mode from network. Start the host. From the boot menu, select Kickstart default PXEGrub2 . This creates the host entry and the relevant provisioning settings. This also includes creating the necessary directories and files for UEFI booting the bare-metal host. When you start the physical host and set its boot mode to UEFI HTTP, the host detects the defined DHCP service, receives HTTP endpoint of Capsule with the Kickstart tree and installs the operating system. When the installation completes, the host also registers to Satellite Server using the activation key and installs the necessary configuration and management tools from the Red Hat Satellite Client 6 repository. CLI procedure On Capsule that you use for provisioning, update the grub2-efi package to the latest version: Enable foreman-proxy-http , foreman-proxy-httpboot , and foreman-proxy-tftp true features: Create the host with the hammer host create command. Ensure the network interface options are set using the hammer host interface update command: Set the host to boot in UEFI mode from network. Start the host. From the boot menu, select Kickstart default PXEGrub2 . This creates the host entry and the relevant provisioning settings. This also includes creating the necessary directories and files for UEFI booting the bare-metal host. When you start the physical host and set its boot mode to UEFI HTTP, the host detects the defined DHCP service, receives HTTP endpoint of Capsule with the Kickstart tree and installs the operating system. When the installation completes, the host also registers to Satellite Server using the activation key and installs the necessary configuration and management tools from the Red Hat Satellite Client 6 repository. 4.6. Deploying SSH keys during provisioning Use this procedure to deploy SSH keys added to a user during provisioning. For information on adding SSH keys to a user, see Managing SSH Keys for a User in Administering Red Hat Satellite . Procedure In the Satellite web UI, navigate to Hosts > Templates > Provisioning Templates . Create a provisioning template, or clone and edit an existing template. For more information, see Section 2.14, "Creating provisioning templates" . In the template, click the Template tab. In the Template editor field, add the create_users snippet to the %post section: Select the Default checkbox. Click the Association tab. From the Application Operating Systems list, select an operating system. Click Submit to save the provisioning template. Create a host that is associated with the provisioning template or rebuild a host using the operating system associated with the modified template. For more information, see Creating a Host in Managing hosts . The SSH keys of the Owned by user are added automatically when the create_users snippet is executed during the provisioning process. You can set Owned by to an individual user or a user group. If you set Owned by to a user group, the SSH keys of all users in the user group are added automatically.

Commands:
hammer host create --build true --enabled true --hostgroup " My_Host_Group " --location " My_Location " --mac " My_MAC_Address " --managed true --name " My_Host_Name " --organization " My_Organization "
hammer host interface update --host "_My_Host_Name_" --managed true --primary true --provision true
hammer host create --build true --enabled true --hostgroup " My_Host_Group " --location " My_Location " --mac " My_MAC_Address " --managed true --name " My_Host_Name " --organization " My_Organization "
hammer host interface update --host " My_Host_Name " --managed true --primary true --provision true
hammer bootdisk host --full true --host My_Host_Name
hammer bootdisk subnet --subnet My_Subnet_Name
satellite-maintain packages update grub2-efi
satellite-installer --foreman-proxy-http true --foreman-proxy-httpboot true --foreman-proxy-tftp true
satellite-maintain packages update grub2-efi
satellite-installer --foreman-proxy-http true --foreman-proxy-httpboot true --foreman-proxy-tftp true
hammer host create --build true --enabled true --hostgroup " My_Host_Group " --location " My_Location " --mac " My_MAC_Address " --managed true --name " My_Host_Name " --organization " My_Organization " --pxe-loader "Grub2 UEFI HTTP"
hammer host interface update --host " My_Host_Name " --managed true --primary true --provision true
<%= snippet('create_users') %>