Chapter 5. Installing a RHEL for Edge image

You can install the RHEL for Edge image using the RHEL installer graphical user interface or a Kickstart file.

To install the images on bare metal, use a Kickstart file.

Installing the RHEL for Edge images involves the following high-level steps:

  1. Extract the image file contents. See Section 3.4, “Downloading a RHEL for Edge image” for information on how to download the RHEL for Edge image
  2. Set up a web server
  3. Install the image

5.1. Extracting RHEL for Edge image commit

After you download the commit, you can extract the .tar file and access the ref name and the commit ID.

The downloaded file consists of a .tar file with an OSTree repository. It contains the commit and a json file that contains information metadata about the repository content. After you downloaded the commit, you can extract the .tar file and access the ref name and the commit ID.

To extract the package contents, perform the following the steps:

Procedure

  1. Extract the downloaded image tar file:

    # tar xvf <UUID>-commit.tar

    The extracted file contains a json file and a repository directory.

    • The json contains the metadata about the commit, with information such as the "Ref" (reference ) and the commit id (ostree-commit).
    • The repository folder is a OSTree repository that contains the commit.
  2. Navigate to the folder where you have extracted the .tar file
  3. Open the UUID-commit.tar folder.
  4. Open the compose.json file.

    From the compose.json file, note the commit ID number. You need this number handy when you proceed to set up a web server.

  5. List the rpm packages in the commit.

    # rpm-ostree db list rhel/8/x86_64/edge --repo=repo

    You can review the Kickstart file that is available to run the RHEL installer. The Kickstart file provides details about how to provision the file system, create a user, and how to fetch and deploy the RHEL for Edge image. The RHEL installer uses this information during the installation process.

    Note

    Ensure that the last line of the Kickstart file provides the commit number and details about the HTTP endpoint from where the RHEL installer must fetch the commit.

5.2. Setting up a web server to install RHEL for Edge image

After you have extracted the RHEL for Edge image contents, set up a web server to provide the image commit details to the RHEL installer via HTTP.

The following example provides the steps to set up a web server using a docker container.

Prerequisites

Procedure

  1. Create a dockerfile.

    On the command prompt, run the following commands:

    FROM registry.access.redhat.com/ubi8/ubi
    RUN yum -y install httpd && yum clean all
    ADD kickstart.ks/var/www/html/
    ARG commit=commit.tar
    ADD $commit /var/www/html/
    EXPOSE 80
    CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"]

    Where,

    • kickstart.ks is the name of the Kickstart file from the RHEL for Edge image. The kickstart file includes directive information. To help you manage the images later, it is advisable to include the checks and settings for Greenboot checks. To do so, you can update the Kickstart file to include the following settings:

      /etc/greenboot/check/required.d/check-dns.sh
      
      #!/bin/bash
      
      DNS_SERVER=$(grep nameserver /etc/resolv.conf | cut -f2 -d" ")
      COUNT=0
      
      # check DNS server is available
      ping -c1 $DNS_SERVER
      while [ $? != '0' ] && [ $COUNT -lt 10 ]; do
      ((COUNT++))
      echo "Checking for DNS: Attempt $COUNT ."
      sleep 10
      ping -c 1 $DNS_SERVER
      done
    • Commit.tar is the image commit number
    • `/var/www/html` is the location where the commit is saved. You can choose a different location to save the commit.

      The docker file performs the following tasks:

      1. Uses the latest Universal Base Image (ubi)
      2. Installs the web server (httpd)
      3. Adds the kickstart file to the server
      4. Adds the RHEL for Edge image commit to the server

        The line ARG commit=commit.tar allows you to specify future commits using the command-line.

  2. Build a docker container

    #  podman build -t <name-of-server> --build-arg commit=<uuid>-commit.tar .
  3. Run the container

    #  podman run --rm -p <Port>:80 <_name-of-server_>

    As a result, the server is set up and ready to launch the RHEL installer using the commit.tar repository and the kickstart file.

5.3. Downloading RHEL Boot.iso image

You can download a Red Hat Boot ISO image from the Red Hat Customer Portal. The Red Hat Boot ISO image is used to launch the RHEL installer. The installer fetches the Kickstart file that you provide for installing RHEL for Edge images.

Prerequisites

Procedure

  1. Open a browser an access https://access.redhat.com/downloads.
  2. Click the Red Hat Enterprise Linux 8.
  3. CLick the button Download Now for the option "Red Hat Enterprise Linux 8.2 Boot ISO"

For more information about downloading Boot.iso image, see Downloading the installation ISO image.

5.4. Installing the RHEL for Edge image using a Kickstart file

To install the RHEL for Edge image using a Kickstart file, use the web server. The web server uses the RHEL for Edge image commit.tar repository and the kickstart file to launch the RHEL installer.

Prerequisites

  • The server to fetch the commit in the Installer is available and running.
  • A disk image to install the commit you created.

Procedure

  1. Run the Anaconda Installer using the libvirt virt-install:

    virt-install --name rhel-edge-test-1 --memory 2048 --vcpus 2 --disk size=8 --os-variant rhel8.0 --cdrom /home/username/Downloads/rhel8-edge.iso
  2. On the installation screen, press TAB to specify an additional kernel parameter:

    inst.ks=http://edge_device_ip:port/kickstart.ks

    The kernel parameter specifies that you want to install RHEL using the Kickstart file and not the RHEL image contained in the RHEL Installer.

    The RHEL Installer starts, fetches the Kickstart file from the server (HTTP) endpoint and executes the commands, including the command to install the RHEL for Edge image commit from the HTTP endpoint. Once the installation is complete, the installer prompts for login details.

  3. On the Login screen, specify your user account credentials and click Enter.
  4. Verify whether the RHEL for Edge image is successfully installed.

    $ rpm-ostree status

    The command output provides the image commit ID and shows that the installation is successful.

    Following is a sample output:

    State: idle
    Deployments:
    * ostree://edge:rhel/8/x86_64/edge
    		  Timestamp: 2020-09-18T20:06:54Z
    			Commit: 836e637095554e0b634a0a48ea05c75280519dd6576a392635e6fa7d4d5e96