Red Hat Training

A Red Hat training course is available for Red Hat Satellite

Chapter 3. Configuring Provisioning Resources

Red Hat Satellite 6 provides a set of provisioning resources that contribute to the creation of a new host. This section explores some of these resources and how they contribute to host provisioning.

Supported Architectures

Only Intel x86_64 architecture is supported for provisioning via PXE, Discovery, and boot disk. For full details see Red Hat Knowledgebase solution Architectures Supported for Satellite 6 Provisioning.

3.1. Creating Installation Media

Installation media are sources of files the Satellite Server uses to install the base operating system on a machine. Installation media must be in the format of an operating system installation tree, and must be accessible to the machine hosting the installer through a HTTP URL. Available installation media appears in the Hosts > Installation Media menu.

Importing kickstart trees from Red Hat’s CDN creates new entries in the Installation Media page. This process is described in Selecting Red Hat Repositories to Synchronize in the Red Hat Satellite 6 Content Management Guide. For installation media that has been synchronized from a repository, there is no need to define it manually. The installation media will be available as Synced content in the Operating System tab when creating a host or a host group.

For other installation media, for example, a locally mounted ISO image, users can add their own custom media paths using the following procedure:

For Web UI Users

Navigate to Hosts > Installation Media and click New Medium. The UI provides a set of fields where you can input details for the installation medium:

  • Name - A name to represent the installation media entry in the user interface.
  • Path - The URL containing the installation tree. The following variables can be used in the path to represent multiple different system architectures and versions:

    • $arch - The system architecture, for example x86_64.
    • $version - The operating system version, for example 7.2.
    • $major - The operating system major version, for example 7.
    • $minor - The operating system minor version, for example 2.

      Example HTTP path:

      http://download.example.com/rhel/$version/Server/$arch/os/
      Note

      Synchronized content on Capsule Servers always use a HTTP path.

  • Operating system family - The distribution or family of the medium. For example, Red Hat Enterprise Linux, CentOS, and Fedora would be in the Red Hat family.

The Satellite Server adds the installation medium to the current provisioning context. You can choose additional contexts from the Organizations and Locations tabs, which will help with future debugging.

Click Submit to save your installation medium.

For CLI Users

Create the installation medium using the hammer medium create command:

# hammer medium create --name "CustomOS" --os-family "Redhat" \
--path 'http://download.example.com/rhel/$version/Server/$arch/os/' \
--organizations "ACME" --locations "New York"

3.2. Creating Partition Tables

A partition table is a set of directives that defines the way the Satellite Server configures the disks available on a new host. Red Hat Satellite 6 contains a set of default partition tables to use, including a Kickstart default. You can also edit partition table entries to configure the preferred partitioning scheme, or create a new partition table entry and add it to the Red Hat Enterprise Linux operating system entry.

For Web UI Users

Navigate to Hosts > Partition tables and click New Partition Table. The UI provides a set of fields where you can input details for the partition table:

  • Name - A name to represent the partition table.
  • Default - Defines if the partition is automatically associated with new organizations or locations.
  • Snippet - Defines if the partition is a reusable snippet for other partition table layouts.
  • Operating system family - The distribution or family of the partitioning layout. For example, Red Hat Enterprise Linux, CentOS, and Fedora would be in the Red Hat family.
  • Template editor - A text area to enter the layout for the disk partition. For example:

    zerombr
    clearpart --all --initlabel
    autopart

    You can also use the Template file browser to upload a template file.

    Note

    The format of the layout must match that for the intended operating system. For example, Red Hat Enterprise Linux 7.2 requires a layout that matches a kickstart file.

  • Audit Comment - A field for a summary of changes to the partition layout.

Satellite adds the partition table to the current provisioning context. You can choose additional contexts from the Organizations and Locations tabs.

Click Submit to save your partition table.

For CLI Users

Before creating a partition table with the CLI, create a plain text file that contains the partition layout. This example uses the ~/my-partition file. Create the installation medium using the hammer partition-table create command:

# hammer partition-table create --name "My Partition" --snippet false \
--os-family Redhat --file ~/my-partition --organizations "ACME" \
--locations "New York"

3.3. Creating Provisioning Templates

A provisioning template defines the way the Satellite Server installs an operating system on a host. There are various types of provisioning templates, including:

  • provision - The main template that defines the provisioning process. For example, a kickstart template. For more information about kickstart template syntax, see the Kickstart Syntax Reference in the Red Hat Enterprise Linux 7 Installation Guide.
  • PXELinux, iPXE, PXEGrub - PXE-based network boot templates.
  • finish - Post-configuration scripts for after the completion of the main provisioning process. This is completed as a SSH task.
  • Bootdisk - Templates for PXE-less boot methods.
  • kexec - Kernel execution templates for PXE-less boot methods.
  • user_data - Post-configuration scripts for providers that accept user data, such as cloud-init scripts.
  • script - An arbitrary script not used by default but useful for custom tasks.
  • ZTP - Zero Touch Provisioning templates.
  • POAP - PowerOn Auto Provisioning templates.

Red Hat Satellite includes many template examples. Navigate to Hosts > Provisioning templates to view them. You can clone and adjust any of them, or create your own. Templates accept the Embedded Ruby (ERB) syntax, for more information see Template Writing Reference in the Red Hat Satellite 6 Host Configuration Guide.

Provisioning templates can be downloaded. In order to be allowed to do that, you will need to create a debug certificate first, see Creating an Organization Debug Certificate in the Red Hat Satellite 6 Server Administration Guide.

Note

To view the history of changes applied to a template, navigate to Hosts > Provisioning templates, select one of the templates, and click History. Click Revert to override the editor content with the previous version. It is possible to revert to an earlier change as well. Click Show Diff to see information about a specific change:

  1. Template Diff tab shows changes in the body of a provisioning template.
  2. Details tab shows changes in the template description.
  3. History tab shows the user who made a change to the template and date of the change.
Note

Finishing templates are only designed to be used for imaged based provisioning in virtual environments. Do not confuse an image with a foreman discovery ISO, which is sometimes called a Foreman discovery image. An image in this context is an install image in a virtualized environment for easy deployment.

For Web UI Users

Navigate to Hosts > Provisioning templates and click New Template. The UI provides a set of fields where you can input details for the provisioning template. Alternatively, you can select one of the template examples, click Clone to duplicate it, and modify its preset details:

  • In the Template tab:

    • Name - Plain text name for the provisioning template.
    • Default - Defines if the template is automatically associated with new organizations or locations.
    • Template editor - A text area to enter the body of the provisioning template. You can also use the Template file browser to upload a template file.
    • Audit Comment - A field for a summary of changes to the provisioning template.
  • In the Type tab:

    • Snippet - Designates the provisioning template as a snippet. A snippet is not a standalone provisioning template, but a part of a provisioning template that can be inserted into other provisioning templates.
    • Type - Defines the type of template. For example, Provisioning template.
  • In the Association tab.

    • From the All items list in the Applicable Operating Systems section, click the name of an operating system entry to move that operating system entry to the Selected items list and make the provisioning template available to that operating system entry.
    • Optionally, click Add combination and select a host group from the Host Group list or an environment from the Environment list to make the provisioning template available to the specified combination of host groups and environments.

Satellite adds the provisioning template to the current provisioning context. You can choose additional contexts from the Organizations and Locations tabs.

Click Submit to save your provisioning template.

For CLI Users

Before creating a template with the CLI, create a plain text file that contains the template. This example uses the ~/my-template file. Create the installation medium using the hammer template create command and specify the type with the --type option:

# hammer template create --name "My Provisioning Template" \
--file ~/my-template --type provision --organizations "ACME" \
--locations "New York"

3.4. Creating Operating Systems

An operating system is a collection of resources that define how the Satellite Server installs a base operating system on a host. Operating system entries combine previously defined resources, such as installation media, partition tables, provisioning templates, and others.

Importing operating systems from Red Hat’s CDN creates new entries in the Hosts > Operating Systems page. Users can also add custom operating systems using the following procedure:

For Web UI Users

Navigate to Hosts > Operating systems and click New Operating system. The UI provides a set of fields where you can input details for the operating system:

  • In the Operating System tab:

    • Name - A plain text name to represent the operating system entry.
    • Major version - The number corresponding to the major version of the operating system.
    • Minor version - The number corresponding to the minor version of the operating system.
    • Description - A text field for the operating system’s description.
    • Family - The operating system family to categorize the new operating system.
    • Root password hash - Defines the encoding method for the root password.
    • Architectures - Select the architectures the operating system uses. Create additional architectures in the Hosts > Architectures menu.
  • In the Partition table tab:

    • Select the possible partition tables that apply to this operating system.
  • In the Installation media tab:

  • In the Templates tab:

    • Select a template for each type applicable to the operating system.

Click Submit to save your provisioning template.

For CLI Users

Create the operating system using the hammer os create command:

# hammer os create --name "MyOS" \
--description "My custom operating system" \
--major 7 --minor 3 --family "Redhat" --architectures "x86_64" \
--partition-tables "My Partition" --media "Red Hat" \
--provisioning-templates "My Provisioning Template"

Note the following:

  • We use the resources created in previous sections in this example: installation media, partition tables, and provisioning templates.
  • Operating systems do not have a provisioning context. Only the resources that form an operating system have a provisioning context.

3.5. Creating Compute Profiles

Compute profiles are used in conjunction with compute resources, such as virtualization infrastructure and cloud providers. Compute profiles allow users to predefine hardware such as CPUs, memory, and storage. A default installation of Red Hat Satellite 6 contains three predefined profiles:

  • 1-Small
  • 2-Medium
  • 3-Large

For our example, we create a fourth profile called 4-Example.

For Web UI Users

Navigate to Infrastructure > Compute profiles, which displays a list of existing profiles. Click New Compute Profile.

Enter the Name of the profile (for example 4-Example) and click Submit.

For CLI Users

The compute profile CLI commands are not yet implemented in Red Hat Satellite 6.2.

3.6. Creating an Activation Key

Before creating new hosts, it is recommended to have an activation key. This activation key is used to register systems in the provisioning scenarios. For the scenarios in this guide, the aim is to create an example activation key to attach subscriptions and repositories from the Red Hat Satellite 6 Content Management Guide.

For Web UI Users

Navigate to Content > Activation keys and click Create Activation Key. Provide the activation key with the following information:

  • Name - The name of the activation key. We use this name during the system registration process. Enter example.
  • Content Host Limit - Defines how many systems the Satellite Server allows to register for this activation key. Select Unlimited Content Hosts.
  • Description - A plain text description for the activation key. Enter Example activation key.
  • Environment - The environment to use. Select Production.
  • Content View - The Content View (and, by extension, the repository) in the environment to use. Select Base.

Click Save. The activation key details screen displays.

Now we must define which products to attach and repositories to enable upon registration. Navigate to the Subscriptions tab. An empty subscription listing appears. Click Add, select both the Red Hat Enterprise Linux subscription, and click Add Selected.

Note

The Auto-Attach option is enabled by default. When auto-attach is enabled on an activation key and there are subscriptions associated with the key, the subscription management service selects and attaches the best-matched associated subscriptions based on a set of criteria. You can enable auto-attach and have no subscriptions associated with the key. This type of key is commonly used to register virtual machines when you do not want the virtual machine to consume a RHEL subscription but to inherit a RHEL Virtual Data Center (VDC) subscription from the hypervisor. If auto-attach is disabled, the subscription management service will attempt to attach all associated subscriptions during host registration. If any of the subscriptions cannot be attached, host registration will fail.

Navigate to the Product Content page. This displays all the repositories associated with the activation key’s products. As default, the Satellite Server only enables:

  • The repository that best matches the system requirements. In this case, it is only the Red Hat Enterprise Linux 7 Server RPMs.
  • Any custom content.

Our scenario should have the following defaults set:

Red Hat Enterprise Linux Server:

  • Red Hat Enterprise Linux 7 Server (Kickstart) - Enabled: No (Default)
  • Red Hat Satellite Tools 6.2 (for RHEL 7 Server) (RPMs) - Enabled: No (Default)
  • Red Hat Enterprise Linux 7 Server (RPMs) - Enabled: Yes (Default)

Enable the Red Hat Satellite Tools repository because that contains the configuration tools (such as katello-agent and puppet). Change it to the following:

  • Red Hat Satellite Tools 6.2 (for RHEL 7 Server) (RPMs) - Enabled: Override to Yes

Click Save

For CLI Users

Create the activation key:

# hammer activation-key create --name "example" \
--unlimited-content-hosts true --description "Example activation key" \
--lifecycle-environment "Production" --content-view "Base"  \
--organization "ACME"

Obtain a list of your subscription IDs:

# hammer subscription list --organization "ACME"

Attach the Red Hat Enterprise Linux subscription UUID to the activation key:

# hammer activation-key add-subscription --name "example" \
--subscription-id ff808181533518d50152354246e901aa \
--organization "ACME"

List the product content associated with the activation key:

# hammer activation-key product-content --name "example" \
--organization "ACME"

Override the default auto-enable status for the Red Hat Satellite Tools 6.2 repository. The default status is set to disabled. This command enables it:

# hammer activation-key content-override --name "example" \
--content-label rhel-7-server-satellite-tools-6.2-rpms \
--value 1 --organization "ACME"

The example activation key is ready for registering our provisioned systems.

3.7. Chapter Summary

In this chapter, we examined the resources used for provisioning new hosts. This includes installation media, partition tables, provisioning templates, compute profiles, and activation keys. Future scenarios in this guide show how to apply these resources to the host provisioning process.

The next chapter looks at configuring our network infrastructures for provisioning.