Menu Close

Chapter 9. Deploying a RHEL for Edge image in a non-network-base environment

Deploying a RHEL for Edge image in a non-network-based environment involves the following high-level steps:

  1. Download the RHEL for Edge Container. See Downloading a RHEL for Edge image for information on how to download the RHEL for Edge image.
  2. Load the RHEL for Edge Container image into Podman
  3. Run the RHEL for Edge Container image into Podman
  4. Load the Installer blueprint
  5. Build the RHEL for Edge Installer image
  6. Prepare a qcow disk
  7. Boot the Virtual Machine (VM)
  8. Install the image

9.1. Creating a RHEL for Edge Container image for non-network-based deployments

You can build a running container by loading the downloaded RHEL for Edge Container OSTree commit into Podman. For that, follow the steps:

Prerequisites

Procedure

  1. Navigate to the directory where you have downloaded the RHEL for Edge Container OSTree commit.
  2. Load the RHEL for Edge Container OSTree commit into Podman.

    $ cat ./commit_ID-container.tar | sudo podman load

    The command output provides the image ID, for example: @8e0d51f061ff1a51d157804362bc875b649b27f2ae1e66566a15e7e6530cec63

  3. Tag the new RHEL for Edge Container image, using the image ID generated by the previous step.

    $ sudo podman tag image-ID localhost/edge-container

    The podman tag command assigns an additional name to the local image.

  4. Run the container named edge-container.

    $ sudo podman run --name=edge-container -p 8080:8080 localhost/edge-container

    The podman run --name=edge-container command assigns a name to your container based on the localhost/edge-container image.

  5. List containers:

    $ sudo podman ps -a
    CONTAINER ID  IMAGE                               	COMMAND	CREATED    	STATUS                	PORTS   NAMES
    2988198c4c4b  …./localhost/edge-container   /bin/bash  3 seconds ago  Up 2 seconds ago      	edge-container

As a result, Podman runs a container that serves an OSTree repository with the RHEL for Edge Container commit.

9.2. Creating a RHEL for Edge Installer image for non-network-based deployments

After you have built a running container to serve a repository with the RHEL for Edge Container commit, create an RHEL for Edge Installer (.iso) image. The Installer (.iso) pulls the commit served by RHEL for Edge Container (.tar). After the RHEL for Edge container is loaded in Podman, it exposes the OSTree in the URL format.

To create the RHEL for Edge Installer image in web console, follow the steps:

Prerequisites

Procedure

  1. On the Image Builder dashboard, for the RHEL for Edge Installer blueprint that you have created for RHEL for Edge image, click Create Image.
  2. On the Create Image window, perform the following steps:

    1. In the Repository textbox, specify the RHEL for Edge container OSTree URL to embed in the image. For example, http://localhost:8080/repo
    2. In the Ref textbox, specify the same reference as you provided during the creation of the RHEL for Edge Container commit to embed in the image. For example, rhel/edge/test.
    3. Click Create.

      Image Builder pulls the commit that is being served by the running container during the image build.

      After the image build is complete, you can download the resulting (.iso) image.

  3. Download the image. See Downloading a RHEL for Edge image.

9.3. Installing the RHEL for Edge image for non-network-based deployments

To install the RHEL for Edge image, follow the steps:

Prerequisites

  • You created a RHEL for Edge ISO image.
  • You stopped the running container.
  • A disk image to install the commit you created.

Procedure

  1. Create an empty qcow image to install the (.iso). That is an image of a hard drive for the virtual machine (VM). For example:

    $  qemu-img create -f qcow2 diskfile.qcow2 5G
  2. Boot the VM using the disk as a drive and the installer ISO as a CD-ROM. For example:

    $  qemu-system-x86_64 \
              -enable-kvm \
              -m 4G \
              -cpu host \
              -net nic,model=virtio \
              -net user,hostfwd=tcp::2223-:22 \
              -cdrom $HOME/Downloads/RHEL-Installer-x86_64-33-1.2.iso \
              disk-image.img

    This command instructs qemu, the hypervisor, to:

    • Use KVM virtualization.
    • Increase memory to 4000MB (some processes are consuming lots of memory, for example dnf).
    • Use the same CPU type as the host uses.
    • Connect the guest to a virtual network bridge on the host and forward TCP port 2223 from the host to the SSH port (22) on the guest.
    • Mount the installation ISO.
    • Use the hard drive image created above.

      It gives you an Anaconda Installer. The RHEL Installer starts, loads the Kickstart file from the ISO and executes the commands, including the command to install the RHEL for Edge image commit. Once the installation is complete, the installer prompts for login details.

      Note

      Anaconda is preconfigured to use the container commit during the installation.

  3. On the Login screen, specify your user account credentials and click Enter.

Verification steps

  1. Verify whether the RHEL for Edge image is successfully installed.

    $  rpm-ostree status

As a result, the command output provides the image commit ID and shows that the installation is successful.