Search

Chapter 5. Provisioning Bare Metal Hosts

download PDF

There are four main ways to provision bare metal instances with Red Hat Satellite 6.4:

Unattended Provisioning
New hosts are identified by a MAC address and Satellite Server provisions the host 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.
PXE-less Provisioning
New hosts are provisioned with a boot disk or PXE-less discovery image that Satellite Server generates.
PXE-less Provisioning with Discovery
New hosts use an ISO boot disk that loads the Satellite Discovery service. This service identifies hardware information about the host and lists it as an available host to provision.

BIOS and UEFI Support

With Red Hat Satellite, you can perform both BIOS and UEFI based PXELinux provisioning.

Both BIOS and UEFI interfaces work as interpreters between the computer’s operating system and firmware, initializing the hardware components and starting the operating system at boot time.

While BIOS reads the first section of the hard drive that contains the next address to initialize, UEFI stores all the information about initialization and startup in an .efi file instead of the firmware. UEFI systems are newer and becoming more common.

To perform PXELinux provisioning with UEFI you must use a Red Hat Enterprise Linux Server 7 or higher that has Intel x86_64. In Satellite, PXELinux provisioning with UEFI is supported only on bare-metal systems. UEFI is not supported for virtual machines. UEFI SecureBoot is also not supported.

In Satellite provisioning, the PXE loader which is a DHCP file name that defines which file to load through TFTP during PXE provisioning. For BIOS system, the file is pxelinux.0. For UEFI systems, the file is grub2/grubx64.efi.

For BIOS provisioning, you must associate a PXELinux template with the operating system.

For UEFI provisioning you must associate a PXEGrub2 template with the operating system.

If you associate both PXELinux and PXEGrub2 templates, Satellite 6 can deploy configuration files for both on a TFTP server, so that you can switch between PXE loaders easily.

5.1. Prerequisites for Bare Metal Provisioning

The requirements for bare metal provisioning include:

  • Synchronized content repositories for Red Hat Enterprise Linux 7. For more information, see Synchronizing Red Hat Repositories in the Content Management Guide.
  • 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, see Chapter 4, Configuring Networking.
  • An activation key for host registration. For more information, see Creating An Activation Key in the Content Management guide.
  • A blank bare metal host.

For information about the security token for unattended and PXE-less provisioning, see Section 5.2, “Configuring the Security Token Validity Duration”.

5.2. Configuring the Security Token Validity Duration

When performing unattended and PXE-less provisioning, as a security measure, Satellite automatically generates a unique token and adds this token to the URL of the ISO image that downloads during the Kickstart provisioning process.

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 deleted and you might receive a 404 error.

To adjust the token’s duration of validity, 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.

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

Procedure

To create a host with unattended provisioning, complete the following steps:

  1. In the Satellite web UI, navigate to Hosts > Create Host.
  2. In the Name field, enter a name for the host.
  3. Click the Organization and Location tabs and change the context to match your requirements.
  4. From the Host Group list, select a host group that you want to use to populate the form.
  5. Click the Interface tab, and on the host’s interface, click Edit.
  6. Verify that the fields are populated with values. Note in particular:

    • The Name from the Host tab becomes the DNS name.
    • Satellite Server automatically assigns an IP address for the new host.
  7. In the MAC address field, enter a MAC address for the host. This ensures the identification of the host during the PXE boot process.
  8. Ensure that Satellite Server automatically selects the Managed, Primary, and Provision options for the first interface on the host. If not, select them.
  9. Click the Operating System tab, and verify that all fields contain values. Confirm each aspect of the operating system.
  10. Click Resolve in Provisioning template to check the new host can identify the right provisioning templates to use.
  11. Optional: If you want to use VLAN tagging, you must add the VLAN ID to the PXELinux or PXEGrub2 template. To the APPEND line, add vlanid=example_vlanid.

    For more information about associating provisioning templates, see Section 3.6, “Creating Provisioning Templates”.

  12. Click the Parameters tab, and ensure that a parameter exists that provides an activation key. If not, add an activation key.
  13. Click Submit to save the host details.

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 and starts installing the 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 Tools repository.

For CLI Users

Create the host with the hammer host create command.

# hammer host create --name "My_Unattended_Host" --organization "My_Organization" \
--location "My_Location" --hostgroup "My_Host_Group" --mac "aa:aa:aa:aa:aa:aa" \
--build true --enabled true --managed true

Ensure the network interface options are set using the hammer host interface update command.

# hammer host interface update --host "test1" --managed true \
--primary true --provision true

5.4. Configuring Red Hat Satellite’s Discovery Service

Red Hat Satellite provides a method to automatically detect hosts on a network that are not in your Satellite inventory. These hosts boot the discovery image that performs hardware detection and relays this information back to Satellite Server. This method creates a list of ready-to-provision hosts in Satellite Server without needing to enter the MAC address of each host.

The Discovery service is enabled by default on Satellite Server. However, the default setting of the global templates is to boot from the local hard drive. To use discovery you must change the default entry in the template to discovery.

PXE mode

To use Satellite Server to provide the Discovery image, install the foreman-discovery-image and rubygem-smart_proxy_discovery packages:

# yum install foreman-discovery-image rubygem-smart_proxy_discovery

The foreman-discovery-image package installs the Discovery ISO to the /usr/share/foreman-discovery-image/ directory and also creates a PXE boot image from this ISO using the livecd-iso-to-pxeboot tool. The tool saves this PXE boot image in the /var/lib/tftpboot/boot directory. The rubygem-smart_proxy_discovery package configures a Capsule Server, such as Satellite Server’s integrated Capsule, to act as a proxy for the Discovery service.

When the installation completes, you can view the new menu option by navigating to Hosts > Discovered Hosts.

5.4.1. Enabling Discovery service on a Capsule Server

Complete the following procedure to enable the Discovery service on a Capsule Server.

  1. Enter the following commands on the Capsule Server:

    # yum install foreman-discovery-image rubygem-smart_proxy_discovery
    # foreman-maintain service restart
  2. In the Satellite web UI, navigate to Infrastructure > Capsule.
  3. Click the Capsule Server and select Refresh from the Actions list. Locate Discovery in the list of features to confirm the Discovery service is now running.

Subnets

All subnets with discoverable hosts require an appropriate Capsule Server selected to provide the Discovery service.

To check this, navigate to Infrastructure > Capsules and verify if the Capsule Server that you want to use lists the Discovery feature. If not, click Refresh features.

In the Satellite web UI, navigate to Infrastructure > Subnets, select a subnet, click the Capsules tab, and select the Discovery Proxy that you want to use. Perform this for each appropriate subnet.

5.4.2. Provisioning Template PXELinux Discovery Snippet

For BIOS provisioning, the PXELinux global default template in the Hosts > Provisioning Templates window contains the snippet pxelinux_discovery. The snippet has the following lines:

LABEL discovery
  MENU LABEL Foreman Discovery Image
  KERNEL boot/fdi-image/vmlinuz0
  APPEND initrd=boot/fdi-image/initrd0.img rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nomodeset proxy.url=<%= foreman_server_url %> proxy.type=foreman
  IPAPPEND 2

The KERNEL and APPEND options boot the Discovery image and ramdisk. The APPEND option contains a proxy.url parameter, with the foreman_server_url macro as its argument. This macro resolves to the full URL of Satellite Server.

For UEFI provisioning, the PXEgrub2 global default template in the Hosts > Provisioning Templates window contains the snippet pxegrub2_discovery:

menuentry Foreman Discovery Image --id discovery {
  linuxefi boot/fdi-image/vmlinuz0 rootflags=loop root=live:/fdi.iso rootfstype=auto ro rd.live.image acpi=force rd.luks=0 rd.md=0 rd.dm=0 rd.lvm=0 rd.bootif=0 rd.neednet=0 nomodeset proxy.url=<%= foreman_server_url %> proxy.type=foreman BOOTIF=01-$mac
  initrdefi boot/fdi-image/initrd0.img
}

To use a Capsule to proxy the discovery steps, edit /var/lib/tftpboot/pxelinux.cfg/default or /var/lib/tftpboot/grub2/grub.cfg and change the URL to the FQDN of the Capsule Server you want to use.

The global template is available on Satellite Server and all Capsules that have the TFTP feature enabled.

5.4.3. Changing Templates and Snippets

To use a template, in the Satellite web UI, navigate to Administer > Settings and click the Provisioning tab and set the templates that you want to use.

Templates and snippets are locked to prevent changes. If you want to edit a template or snippet, clone it, save it with a unique name, and then edit the clone.

When you change the template or a snippet it includes, the changes must be propagated to Satellite Server’s default PXE template. Navigate to Hosts > Provisioning Templates and click Build PXE Default. This refreshes the default PXE template on Satellite Server.

The proxy.url argument

During the Satellite installation process, if you use the default option --enable-foreman-plugin-discovery, you can edit the proxy.url argument in the template to set the URL of Capsule Server that provides the discovery service. You can change the proxy.url argument to the IP address or FQDN of another provisioning Capsule that you want to use, but ensure that you append the port number, for example, 9090. If you use an alternative port number with the --foreman-proxy-ssl-port option during Satellite installation, you must add that port number. You can also edit the proxy.url argument to use a Satellite IP address or FQDN so that the discovered hosts communicate directly with Satellite Server.

The proxy.type argument

If you use a Capsule Server FQDN for the proxy.url argument, ensure that you set the proxy.type argument to proxy. If you use a Satellite FQDN, update the proxy.type argument to foreman.

proxy.url=https://capsule.example.com:9090 proxy.type=proxy

Rendering the Capsule’s Host Name

Satellite 6 deploys the same template to all TFTP Capsules and there is no variable or macro available to render the Capsule’s host name. The hard-coded proxy.url does not not work with two or more TFTP Capsules. As a workaround, every time you click Build PXE Defaults, edit the configuration file in the TFTP directory using SSH.

Setting Discovery Service as Default

For both BIOS and UEFI, to set the Discovery service as the default service that boots for hosts that are not present in your current Satellite inventory, complete the following steps:

  1. In the Satellite web UI, navigate to Administer > Settings and click the Provisioning tab.
  2. For the Default PXE global template entry, in the Value column, enter discovery.

Tagged VLAN Provisioning

If you want to use tagged VLAN provisioning, and you want the discovery service to send a discovery request, add the following information to the KERNEL option in the discovery template:

fdi.vlan.primary=example_VLAN_ID

Testing

Test the Discovery service and boot a blank bare metal host on the 192.168.140.0/24 network. A boot menu has two options:

  • local, which boots from the hard disk
  • discovery, which boots to the Discovery service

Select discovery to boot the Discovery image. After a few minutes, the Discovery image completes booting and a status screen is displayed.

In the Satellite web UI, navigate to Hosts > Discovered hosts and view the newly discovered host. The discovered hosts automatically define their host name based on their MAC address. For example, Satellite sets a discovered host with a MAC address of ab:cd:ef:12:34:56 to have macabcdef123456 as the host name. You can change this host name when provisioning the host.

5.4.4. Automatic Contexts for Discovered Hosts

Satellite Server assigns organization and location to discovered hosts according to the following sequence of rules:

  1. If the Discovery organization or Discovery location values are set. To set these values, navigate to Administer > Settings > Discovered.
  2. If the foreman_organization or foreman_location facts for a host are set. To configure fact names in Administer > Settings > Puppet section as the Default organization and Default location fact setting.
  3. If a discovered host uses a subnet defined in Satellite, the host uses the first organization and location associated with the subnet.
  4. If none of the previous conditions exists, Satellite assigns the first Organization and Location ordered by name.

You can change the organization or location using the bulk actions menu of the Discovered hosts page. Select the discovered hosts to modify and select Assign Organization or Assign Location from the Select Action menu.

5.5. Creating Hosts from Discovered Hosts

Provisioning discovered hosts follows a provisioning process that is similar to PXE provisioning. The main difference is that instead of manually entering the host’s MAC address, you can select the host to provision from the list of discovered hosts.

Procedure

To create a host from a discovered host, complete the following steps:

  1. In the Satellite web UI, navigate to Hosts > Discovered host. Select the host you want to use and click Provision to the right of the list.
  2. Select from one of the two following options:

    • To provision a host from a host group, select a host group, organization, and location, and then click Create Host.
    • To provision a host with further customization, click Customize Host and enter the additional details you want to specify for the new host.
  3. Verify that the fields are populated with values. Note in particular:

    • The Name from the Host tab becomes the DNS name.
    • Satellite Server automatically assigns an IP address for the new host.
    • Satellite Server automatically populates the MAC address from the Discovery results.
  4. Ensure that Satellite Server automatically selects the Managed, Primary, and Provision options for the first interface on the host. If not, select them.
  5. Click the Operating System tab, and verify that all fields contain values. Confirm each aspect of the operating system.
  6. 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 3.6, “Creating Provisioning Templates”.

  7. Click Submit to save the host details.

When the host provisioning is complete, the discovered host becomes a content host. To view the host, navigate to Hosts > Content Hosts.

For CLI Users

  1. Identify the discovered host to use for provisioning:

    # hammer discovery list
  2. Select a host and provision it using a host group. Set a new host name with the --new-name option:

    # hammer discovery provision --name "host_name" \
    --new-name "new_host_name" --organization "My_Organization" \
    --location "My_Location" --hostgroup "My_Host_Group" --build true \
    --enabled true --managed true

    This removes the host from the discovered host listing and creates a host entry with the provisioning settings. The Discovery image automatically resets the host so that it can boot to PXE. The host detects the DHCP service on Satellite Server’s integrated Capsule and starts installing the operating system from its Kickstart tree. When the installation completes, the host also registers to Satellite Server using an activation key and installs the necessary configuration and management tools from the Red Hat Satellite Tools repository.

5.6. Creating Discovery Rules

As a method of automating the provisioning process for discovered hosts, Red Hat Satellite 6 provides a feature to create discovery rules. These rules define how discovered hosts automatically provision themselves, based on the assigned host group. For example, you can automatically provision hosts with a high CPU count as hypervisors. Likewise, you can provision hosts with large hard disks as storage servers.

NIC Considerations

Auto provisioning does not currently allow configuring NICs; all systems are being provisioned with the NIC configuration that was detected during discovery. However, you can set the NIC in an Anaconda kickstart, scriptlet, or using configuration management later on.

Procedure

To create a rule, complete the following steps:

  1. In the Satellite web UI, navigate to Configure > Discovery rules. Select Create Rule and enter the following details:
  2. In the Name field, enter a name for the rule.
  3. In the Search field, enter the rules to determine whether to provision a host. This field provides suggestions for values you enter and allows operators for multiple rules. For example: cpu_count > 8.
  4. From the Host Group list, select the host group to use as a template for this host.
  5. In the Hostname field, enter the pattern to determine host names for multiple hosts. This uses the same ERB syntax that provisioning templates use. The host name can use the @host attribute for host-specific values and the rand function for a random number.

    • myhost-<%= rand(99999) %>
    • abc-<%= @host.facts['bios_vendor'] + '-' + rand(99999).to_s %>
    • xyz-<%= @host.hostgroup.name %>
    • srv-<%= @host.discovery_rule.name %>
    • server-<%= @host.ip.gsub('.','-') + '-' + @host.hostgroup.subnet.name %>

      Because the rand() function returns an integer that cannot be concatenated with a string, use the to_s function to change the integer to a string. When creating host name patterns, ensure the resulting host names are unique, do not start with numbers, and do not contain underscores or dots. A good approach is to use unique information provided by Facter, such as the MAC address, BIOS, or serial ID.

  6. In the Hosts limit field, enter the maximum hosts you can provision with the rule. Enter 0 for unlimited.
  7. In the Priority field, enter a number to set the precedence the rule has over other rules. Rules with lower values have a higher priority.
  8. From the Enabled list, select whether you want to enable the rule.
  9. To set a different provisioning context for the rule, click the Organizations and Locations tabs and select the contexts you want to use.
  10. Click Submit to save your rule.
  11. Navigate to Hosts > Discovered Host and select one of the following two options:

    • From the Discovered hosts list on the right, select Auto-Provision to automatically provisions a single host.
    • On the upper right of the window, click Auto-Provision All to automatically provisions all hosts.

For CLI Users

Create the rule with the hammer discovery_rule create command:

# hammer discovery_rule create --name "Hypervisor" \
--search "cpu_count  > 8" --hostgroup "My_Host_Group" \
--hostname "hypervisor-<%= rand(99999) %>" \
--hosts-limit 5 --priority 5 --enabled true

Automatically provision a host with the hammer discovery auto-provision command:

# hammer discovery auto-provision --name "macabcdef123456"

5.7. Creating Hosts with PXE-less Provisioning

Some hardware does not provide a PXE boot interface. Red Hat Satellite 6 provides a PXE-less discovery service that operates without PXE-based services, such as DHCP and TFTP. 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.

Boot ISO Types

There are four types of boot ISOs:

Host image - A boot ISO for the specific host. This image contains only the boot files that are necessary to access the installation media on Satellite Server. The user defines the subnet data in Satellite and the image is created with static networking.

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.

Generic image - A boot ISO that is not associated with a specific host. The ISO sends the host’s MAC address to Satellite 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 also available from the /bootdisk/disks/generic URL on your Satellite Server, for example, https://satellite.example.com/bootdisk/disks/generic.

Subnet image - A boot ISO that is similar to the generic image but is configured with the address of a Capsule Server. This image is generic to all hosts with a provisioning NIC on the same subnet.

Procedure

To create a host with PXE-less provisioning, complete the following steps:

  1. In the Satellite web UI, navigate to Hosts > Create Host.
  2. In the Name field, enter a name that you want to become the provisioned system’s host name.
  3. Click the Organization and Location tabs and change the context to match your requirements.
  4. From the Host Group list, select a host group that you want to use to populate the form.
  5. Click the Interface tab, and on the host’s interface, click Edit.
  6. Verify that the fields are populated with values. Note in particular:

    • The Name from the Host tab becomes the DNS name.
    • Satellite Server automatically assigns an IP address for the new host.
  7. In the MAC address field, enter a MAC address for the host.
  8. Ensure that Satellite Server automatically selects the Managed, Primary, and Provision options for the first interface on the host. If not, select them.
  9. Click the Operating System tab, and verify that all fields contain values. Confirm each aspect of the operating system.
  10. 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 3.6, “Creating Provisioning Templates”.

  11. Click the Parameters tab, and ensure that a parameter exists that provides an activation key. If not, add an activation key.
  12. Click Submit to save the host details.

This creates a host entry and the host details page appears.

The options on the upper-right of the window are the Boot disk menu. From this menu, one of the following images is available for download: Host image, Full host image, Generic image, and Subnet image.

Note

The Full host image is based on SYSLINUX and works with most hardware. When using a Host image, Generic image, or Subnet image, see http://ipxe.org/appnote/hardware_drivers for a list of hardware drivers expected to work with an iPXE-based boot disk.

For CLI Users

Create the host with the hammer host create command.

# hammer host create --name "My_Bare_Metal" --organization "My_Organization" \
--location "My_Location" --hostgroup "My_Host_Group" --mac "aa:aa:aa:aa:aa:aa" \
--build true --enabled true --managed true

Ensure that your network interface options are set using the hammer host interface update command.

# hammer host interface update --host "test3" --managed true \
--primary true --provision true

Download the boot disk from Satellite Server with the hammer bootdisk host command:

  • For Host image:

    # hammer bootdisk host --host test3.example.com
  • For Full host image:

    # hammer bootdisk host --host test3.example.com --full true
  • For Generic image:

    # hammer bootdisk generic
  • For Subnet image:

    # hammer bootdisk subnet --subnet subnetName

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 Tools repository.

5.8. Implementing PXE-less Discovery

Red Hat Satellite 6 provides a PXE-less Discovery service that operates without the need for PXE-based services (DHCP and TFTP). You accomplish this using Satellite Server’s Discovery image.

PXEless mode

If you have not yet installed the Discovery service or image, follow the "Installation" section in Section 5.4, “Configuring Red Hat Satellite’s Discovery Service”.

The ISO for the Discovery service resides at /usr/share/foreman-discovery-image/ and is installed using the foreman-discover-image package.

Attended Use

This ISO acts as bootable media. Copy this media to either a CD, DVD, or a USB stick. For example, to copy to a USB stick at /dev/sdb:

# dd bs=4M \
if=/usr/share/foreman-discovery-image/foreman-discovery-image-3.4.4-5.iso \
of=/dev/sdb

Insert the Discovery boot media into a bare metal host, start the host, and boot from the media. The Discovery Image displays an option for either Manual network setup or Discovery with DHCP:

  • If selecting Manual network setup, the Discovery image requests a set of network options. This includes the primary network interface that connects to Satellite Server. This Discovery image also asks for network interface configuration options, such as an IPv4 Address, IPv4 Gateway, and an IPv4 DNS server.

    After entering these details, select Next.

  • If selecting Discovery with DHCP, the Discovery image requests only the primary network interface that connects to Satellite Server. It attempts to automatically configure the network interface using a DHCP server, such as one that a Capsule Server provides.

After the primary interface configuration, the Discovery image requests the Server URL, which is the URL of Satellite Server or Capsule Server offering the Discovery service. For example, to use the integrated Capsule on Satellite Server, use the following URL:

https://satellite.example.com:9090

Set the Connection type to Proxy, then select Next.

The Discovery image also provides a set of fields to input Custom facts for the Facter tool to relay back to Satellite Server. These are entered in a name-value format. Provide any custom facts you require and select Confirm to continue.

The Satellite reports a successful communication with Satellite Server’s Discovery service. Navigate to Hosts > Discovered Hosts and view the newly discovered host.

For more information about provisioning discovered hosts, see Section 5.5, “Creating Hosts from Discovered Hosts”.

Unattended Use and Customization

It is possible to create a customized Discovery ISO, which automates the process of configuring the image after booting. The Discovery image uses a Linux kernel for the operating system, which means you pass kernel parameters to the configure the image’s operating system. These kernel parameters include:

proxy.url
The URL of the Capsule Server providing the Discovery service.
proxy.type
The proxy type. This is usually set to proxy to connect to Capsule Server. This parameter also supports a legacy foreman option, where communication goes directly to Satellite Server instead of a Capsule Server.
fdi.pxmac
The MAC address of the primary interface in the format of AA:BB:CC:DD:EE:FF. This is the interface you aim to use for communicating with Capsule Server. In automated mode, the first NIC (using network identifiers in alphabetical order) with a link is used. In semi-automated mode, a screen appears and requests you to select the correct interface.
fdi.pxip, fdi.pxgw, fdi.pxdns
Manually configures IP address (fdi.pxip), the gateway (fdi.pxgw), and the DNS (fdi.pxdns) for the primary network interface. If your omit these parameters, the image uses DHCP to configure the network interface.
fdi.pxfactname1, fdi.pxfactname2 …​ fdi.pxfactnameN
Allows you to specify custom fact names.
fdi.pxfactvalue1, fdi.pxfactvalue2 …​ fdi.pxfactvalueN
The values for each custom fact. Each value corresponds to a fact name. For example, fdi.pxfactvalue1 sets the value for the fact named with fdi.pxfactname1.
fdi.pxauto
To set automatic or semi-automatic mode. If set to 0, the image uses semi-automatic mode, which allows you to confirm your choices through a set of dialog options. If set to 1, the image uses automatic mode and proceeds without any confirmation.

Satellite Server also provides a tool (discovery-remaster) in the foreman-discovery-image package. This tool remasters the image to include these kernel parameters. To remaster the image, run the discovery-remaster tool. For example:

# discovery-remaster ~/iso/foreman-discovery-image-3.4.4-5.iso \
"fdi.pxip=192.168.140.20/24 fdi.pxgw=192.168.140.1 \
fdi.pxdns=192.168.140.2 proxy.url=https://satellite.example.com:9090 \
proxy.type=proxy fdi.pxfactname1=customhostname \
fdi.pxfactvalue1=myhost fdi.pxmac=52:54:00:be:8e:8c fdi.pxauto=1"

The tool creates a new ISO file in the same directory as the original discovery image. In this scenario, it saves in the /usr/share/foreman-discovery-image/ directory.

Copy this media to either a CD, DVD, or a USB stick. For example, to copy to a USB stick at /dev/sdb:

# dd bs=4M \
if=/usr/share/foreman-discovery-image/foreman-discovery-image-3.4.4-5.iso \
of=/dev/sdb

Insert the Discovery boot media into a bare metal host, start the host, and boot from the media.

For more information about provisioning discovered hosts, see Section 5.5, “Creating Hosts from Discovered Hosts”.

Final Notes

The host needs to resolve to the following provisioning templates:

  • kexec Template: Discovery Red Hat kexec
  • provision Template: Satellite Kickstart Default

For more information about associating provisioning templates, see Section 3.6, “Creating Provisioning Templates”.

5.9. 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 Adding SSH Keys to a User in Administering Red Hat Satellite.

Procedure

To deploy SSH keys during provisioning, complete the following steps:

  1. In the Satellite web UI, navigate to Hosts > Provisioning Templates.
  2. Create a provisioning template, or clone and edit an existing template. For more information, see Section 3.6, “Creating Provisioning Templates”.
  3. In the template, click the Template tab.
  4. In the Template editor field, add the create_users snippet to the %post section:

    <%= snippet('create_users') %>
  5. Select the Default check box.
  6. Click the Association tab.
  7. From the Application Operating Systems list, select an operating system.
  8. Click Submit to save the provisioning template.
  9. Create a host that is associated with the provisioning template or rebuild a host using the OS associated with the modified template. For more information, see Creating a Host in the Managing Hosts guide.

    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.

5.10. Building a Satellite Discovery Image

Use this procedure to build a Satellite discovery image or rebuild an image if you change configuration files.

Do not use this procedure on your production Satellite or Capsule.

Prerequisites

Install the livecd-tools package:

# yum install livecd-tools

Because Anaconda installer cannot publish through HTTPS, you must enable publishing through HTTP for Kickstart repositories:

  1. In the Satellite web UI, navigate to Content > Products and in the Products window, click the Repositories tab.
  2. Select a Kickstart repository and for the Publish via HTTP, option, click the Edit icon, select the check box, and click Save.
  3. Repeat the previous steps for the Satellite repository.

Note that publishing via HTTP does not apply to any Red Hat repositories.

Procedure

To build the Satellite discovery image, complete the following steps:

  1. Open the /usr/share/foreman-discovery-image/foreman-discovery-image.ks file for editing:

    # vim /usr/share/foreman-discovery-image/foreman-discovery-image.ks
  2. Replace repo --name=rhel --baseurl=http://download/00000 with with your own repos for RHEL and Satellite with your repository URLs. To find the URLs, navigate to Content > Products and click the Repositories tab and copy the URL for both repositories into the file:

    repo --name=rhel --baseurl=http://download/released/RHEL-7/7.4/Server/x86_64/os/
    repo --name=sat --baseurl=http://download2/nightly/Satellite/6.4/candidate/latest-Satellite-6.4-RHEL-7/compose/Satellite/x86_64/os/
  3. Run the livecd-creator tool:

    # livecd-creator --title="Discovery-Image" \
    --compression-type=xz \
    --cache=var/cache/build-fdi \
    --config /usr/share/foreman-discovery-image/foreman-discovery-image.ks \
    --fslabel fdi \
    --tmpdir /var/tmp

    If you change fdi in the --fslabel option, you must also change the root label on the kernel command line when loading the image. fdi or the alternative name is appended to the .iso file that is created as part of this procedure. The PXE Discovery tool uses this name when converting from .iso to PXE.

    Use /var/tmp because this process requires close to 3GB of space and /tmp might have problems if the system is low on swap space.

  4. Verify that your fdi.iso file is created:

    # ls *.iso -h

When you create the .iso file, you can boot the .iso file over a network or locally. Complete one of the following procedures.

To boot the iso file over a network:

  1. To extract the initial ramdisk and kernel files from the .iso file over a network, enter the following command:

    # discovery-iso-to-pxe fdi.iso
  2. Create a directory to store your boot files:

    # mkdir /var/lib/tftpboot/boot/myimage
  3. Copy the initrd0.img and vmlinuz0 files to your new directory.
  4. Edit the KERNEL and APPEND entries in the /var/lib/tftpboot/pxelinux.cfg file to add the information about your own initial ramdisk and kernel files.

To boot the iso file locally:

If you want to create a hybrid .iso file for booting locally, complete the following steps:

  1. To convert the .iso file to an .iso hybrid file for PXE provisioning, enter the following command:

    # isohybrid --partok fdi.iso

    If you have grub2 packages installed, you can also use the following command to install a grub2 bootloader:

    # isohybrid --partok --uefi fdi.iso
  2. To add md5 checksum to the .iso file so it can pass installation media validation tests in Satellite, enter the following command:

    # implantisomd5 fdi.iso
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.