Menu Close
Settings Close

Language and Page Formatting Options

Creating customized RHEL images using the Image Builder service

Red Hat Enterprise Linux 8

Creating customized system images with Image Builder and uploading them to cloud environments

Red Hat Customer Content Services

Abstract

Red Hat Image Builder bundled with Insights enables you to create customized images and upload the image to the target cloud environments, such as Amazon Web Services, Microsoft Azure and Google Cloud Platform, download customized images and upload them to the VMware vSphere client, or to create customized Bare Metal and Guest images. Learn how to create images and upload them to the target cloud platforms.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. We are beginning with these four terms: master, slave, blacklist, and whitelist. Because of the enormity of this endeavor, these changes will be implemented gradually over several upcoming releases. For more details, see our CTO Chris Wright’s message.

Providing feedback on Red Hat documentation

We appreciate your feedback on our documentation. Let us know how we can improve it.

Submitting comments on specific passages

  1. View the documentation in the Multi-page HTML format and ensure that you see the Feedback button in the upper right corner after the page fully loads.
  2. Use your cursor to highlight the part of the text that you want to comment on.
  3. Click the Add Feedback button that appears near the highlighted text.
  4. Add your feedback and click Submit.

Submitting feedback through Bugzilla (account required)

  1. Log in to the Bugzilla website.
  2. Select the correct version from the Version menu.
  3. Enter a descriptive title in the Summary field.
  4. Enter your suggestion for improvement in the Description field. Include links to the relevant parts of the documentation.
  5. Click Submit Bug.

Chapter 1. Introducing Red Hat Image Builder on Console.RedHat.Com

1.1. Red Hat Image Builder on console.redhat.com

Red Hat Image Builder is a tool bundled with Red Hat Insights, within console.redhat.com. The console experience is also known as the Red Hat Hybrid Cloud Console.

With Red Hat Image Builder, RHEL customers can:

  • Create customized system images, that can have a subscription activation key already embedded
  • Add additional packages to the image during image creation
  • Upload the customized images to the targeted clouds such as Amazon Web Services, Microsoft Azure, and Google Cloud Platform
  • Download your customized images and upload it to the private VMware vSphere client
  • Create customized Bare Metal and Guest images

RHEL customers can create images for a variety of deployment types, built according to the standards that are recommended for each deployment type.

Chapter 2. Accessing Red Hat Image Builder on Console.RedHat.Com

2.1. Getting access to Red Hat Image Builder on console.redhat.com

Follow the steps to access Red Hat Image Builder on console.redhat.com.

Prerequisites

Procedure

  1. Access Red Hat Image Builder.
  2. Login with your Red Hat credentials.

You are now able to create and monitor your composes.

Chapter 3. Creating a customized system image with an embed subscription using Red Hat Image Builder

You can create customized system images using Red Hat Image Builder that have a subscription activation key already embedded and upload those images to the cloud target environment.

3.1. Embedding an automatic subscription during the image creation by using Red Hat Image Builder

You can create images that have a subscription activation key already embedded in the image. Then, you can perform the registration during image creation time.

Prerequisites

Procedure

  1. Access Red Hat Image Builder on the browser.

    The Red Hat Image Builder dashboard appears.

  2. Click Create image.

    The Create image dialog wizard opens.

  3. On the Image output page, complete the following steps:

    1. From the Release list, select the Release that you want to use: for example, choose Red Hat Enterprise Linux (RHEL).
    2. From the Select target environments option, select the desired target(s) cloud environment.

      Click Next.

  4. On the Registration page, select the type of registration that you want to use. You can select from these options:

  5. Optional: On the Packages page, add packages to your image. See Chapter 4, Adding packages during image creation by Using Red Hat Image Builder.
  6. On the Name image page, enter a name for your image and click Next. If you do not enter a name, you can find the image you created by its UUID.
  7. On the Review page, review the information and click Create image.

    After you complete the steps in the Create image wizard, the Image Builder dashboard is displayed. Red Hat Image Builder starts the compose of a RHEL image for the x86_64 architecture.

    The Red Hat Image Builder Images dashboard opens. You can see details such as the Image UUID, the cloud target environment, the image OS release and the status of the image creation.

    Note

    The image build, upload and cloud registration processes can take up to ten minutes to complete.

Chapter 4. Adding packages during image creation by Using Red Hat Image Builder

You can customize your images during the creation process by adding additional packages from the BaseOS and AppStream RHEL repositories, through the UI. With that, you do not need to install the desired packages on first boot, which can be error-prone.

4.1. Adding additional packages during the image creation

When creating a customized image using Image Builder, you can add additional packages from the BaseOS and AppStream repositories. For that, follow the steps:

Prerequisites

  • You have an account on Red Hat Customer Portal with an Insights subscription.
  • Access to the Red Hat Image Builder dashboard.
  • You have already completed the following steps:

    • Image output
    • Target cloud environment
    • Optionally, Registration

Procedure

  1. On the Packages page:

    1. Type the name of the package you want to add to your image in the Available options search bar.

      Optionally, you can enter the first two letters of the package name to see the available package options. The packages are listed on the Available options dual list box.

    2. Click the package or packages you want to add.

      1. Click the >> button to add all packages shown in the package search results to the Chosen options dual list box.

        Optionally, you can click the > button to add only the selected packages.

    3. After you have finished adding the additional packages, click Next.
  2. On the Name image page, enter a name for your image and click Next. If you do not enter a name, you can find the image you created by its UUID.
  3. On the Review page, review the details about the image creation and click Create image.

    After you complete the steps in the Create image wizard, the Image Builder dashboard is displayed. Red Hat Image Builder starts the compose of a RHEL image for the x86_64 architecture.

    The Red Hat Image Builder Images dashboard opens. You can see details such as the Image UUID, the cloud target environment, the image operating system release and the status of the image creation.

    Note

    The image build, upload and cloud registration processes can take up to ten minutes to complete.

Chapter 5. Customizing file systems during the image creation

By using Red Hat Image Builder you can customize your filesystem layouts to set up the desired partitions and sizes during the image creation process.

5.1. Manually configuring partitions during image creation

When creating a customized image using Image Builder, you can customize the system configuration to use manual or automatic partitioning. Red Hat recommends using automatic partitioning, which is the default. Note that partitions can still be extended or reordered when using manual partitioning. To manually configure the partitioning of the image you are creating, complete the following steps:

Prerequisites

  • You have an account on Red Hat Customer Portal with an Insights subscription.
  • You have access to the Red Hat Image Builder dashboard.
  • You have already completed the following steps:

    • Image output
    • Target cloud environment
    • Optionally, Registration

Procedure

  1. On the System Configuration - File system configuration page:

    You can select Use automatic partitioning or Manually configure partitions for your image file system.

    1. Click the Manually configure partitions button.

      The Configure partitions section opens, showing the configuration based on Red Hat standards and security guides.

  2. From the dropdown menu, provide details to configure the partitions:

    1. For the Mount point field, select one of the following mount point type options:

      • /app
      • /data
      • /home
      • /opt
      • /srv
      • /tmp
      • /usr
      • /usr/local
      • /var
      • /

        You can also add an additional path to the Mount point, such as /tmp. For example: /var as a prefix and /tmp as an additional path results in /var/tmp.

        Note

        Depending on the Mount point type you choose, the file system type changes to xfs, and so on.

    2. For the Minimum size partition field of the file system, enter the desired minimum partition size. In the Minimum size dropdown menu, you can use common size units such as GiB, MiB, or KiB. The default unit is GiB.

      Note

      Minimum size means that Image builder can still increase the partition sizes, in case they are too small to create a working image.

  3. To add more partitions, click the Add partition button. Repeat step 2 for each partition.

    If you see the following error message: “Duplicate partitions: Only one partition at each mount point can be created.”, you can:

    • Click the remove button to remove the duplicated partition.
    • Choose a new mount point for the partition you want to create.

      After you finish the partitioning configuration, click Next.

  4. Optional: On the Packages page, add packages to your image.

    Click Next.

  5. On the Name image page, enter a name for your image and click Next. If you do not enter a name, you can find the image you created by its UUID.
  6. On the Review page, review the information.

    1. Click the System Configuration tab to review the file system configuration partitioning.
    2. Click Create image.

      After you complete the steps in the Create image wizard, the Image Builder dashboard is displayed. Red Hat Image Builder starts the compose of a RHEL image for the x86_64 architecture.

      The Red Hat Image Builder Images dashboard opens. You can see details such as the Image UUID, the cloud target environment, the image OS release and the status of the image creation.

      Note

      The image build, upload and cloud registration processes can take up to ten minutes to complete.

Chapter 6. Creating and uploading a customized RHEL system image to Amazon Web Service using Red Hat Image Builder

You can create customized RHEL system images using Red Hat Image Builder, and upload those images to the Amazon Web Services (AWS) target environment.

6.1. Creating and uploading a customized RHEL system image to AWS using Image Builder

Follow the steps to create customized system images using Red Hat Image Builder and upload those images to Amazon Web Services (AWS).

Prerequisites

Procedure

  1. Access Red Hat Image Builder on the browser.

    The Red Hat Image Builder dashboard appears.

  2. Click Create image.

    The Create image dialog wizard opens.

  3. On the Image output page, complete the following steps:

    1. From the Release list, select the Release that you want to use: for example, choose Red Hat Enterprise Linux (RHEL).
    2. From the Select target environments option, select Amazon Web Services as the target environment.

      Click Next.

  4. On the Target Environment - Amazon Web Service page, enter your AWS account ID and click Next.

    You can find your AWS account ID by accessing the option Account on the AWS console.

  5. On the Registration page, select the type of registration that you want to use. You can select from these options:

  6. Optional: On the Packages page, add packages to your image. See Chapter 4, Adding packages during image creation by Using Red Hat Image Builder.
  7. On the Name image page, enter a name for your image and click Next. If you do not enter a name, you can find the image you created by its UUID.
  8. On the Review page, review the details about the image creation and click Create image.

    After you complete the steps in the Create image wizard, the Image Builder dashboard is displayed.

    Red Hat Image Builder starts the compose of a RHEL Amazon Machine Image (AMI) for the x86_64 architecture and uploads it to AWS EC2. Then, it will share the AMI image with the account you specified.

    On the dashboard, you can see details such as the Image UUID, the cloud target environment, the image OS release and the status of the image creation.

    Possible statuses:

    • Pending: the image upload and cloud registration is being processed.
    • In Progress: the image upload and cloud registration is ongoing.
    • Ready: the image upload and cloud registration is completed
    • Failed: the image upload and cloud registration failed.

      Note

      The image build, upload and cloud registration processes can take up to ten minutes to complete.

Verification

  • Check if the image status is Ready. It means that the image upload and cloud registration is completed successfully.

    Note

    The image artifacts are saved for 14 days and expire after that. Ensure to transfer the image to your account to avoid losing it.

6.2. Accessing your customized RHEL system image for AWS from your account

After the image is built, uploaded, and the cloud registration process status is marked as Ready, you can access the Amazon Web Services (AWS) image you created and shared with your AWS EC2 account.

Prerequisites

Procedure

  1. Access your AWS account and navigate to Service→EC2.
  2. In the upper right menu, verify if you are under the correct region: us-east-1.
  3. In the left side menu, under Images, click AMIs.

    The dashboard with the Owned by me images opens.

  4. From the dropdown menu, choose Private images.

    You can see the image successfully shared with the AWS account you specified.

6.3. Launching your customized RHEL system image for AWS from your AWS EC2

You can launch the image you successfully shared with the AWS EC2 account you have specified. To do so, follow the steps:

Prerequisites

Procedure

  1. From the list of images, select the image you want to launch.
  2. On the top of the panel, click Launch. You are redirected to the Choose an Instance Type window.
  3. Choose the instance type according to the resources you need to launch your image. Click Review and Launch.
  4. Review your instance launch details. You can edit each section, such as Security, Storage, for example, if you need to make any changes. After you finish the review, click Launch.
  5. To launch the instance, you must select a public key to access it.

    Create a new key pair in EC2 and attach it to the new instance.

    1. From the drop-down menu list, select Create a new key pair.
    2. Enter the name to the new key pair. It generates a new key pair.
    3. Click Download Key Pair to save the new key pair on your local system.
  6. Then, you can click Launch Instance to launch your instance.

    You can check the status of the instance, it shows as Initializing.

  7. After the instance status is running, the Connect button turns available.
  8. Click Connect. A popup window appears with instructions on how to connect using SSH.

    1. Select the preferred connection method to A standalone SSH client and open a terminal.
    2. In the location you store your private key, make sure that your key is publicly viewable for SSH to work. To do so, run the command:

      $ chmod 400 <your-instance-name.pem>
    3. Connect to your instance using its Public DNS:

      $ ssh -i "<_your-instance-name.pem_> ec2-user@<_your-instance-IP-address_>"
    4. Type yes to confirm that you want to continue connecting.

As a result, you are connected to your instance using SSH.

Verification

  • From a terminal, check if you are able to perform any action while connected to your instance using SSH.

6.4. Copying your customized RHEL system image for AWS to a different region on your AWS EC2

You can copy the image you successfully shared with the Amazon Web Services EC2 to your own account. Doing so, you grant that the image you shared and copied is available until you delete it, instead of expiring after some time. To copy your image to your own account, follow the steps:

Prerequisites

Procedure

  1. From the list of Public images, select the image you want to copy.
  2. On the top of the panel, click Actions.
  3. From the dropdown menu, choose Copy AMI. A popup window appears.
  4. Choose the Destination region and click Copy AMI.

    After the copying process is complete, you are provided with the new AMI ID. You can launch a new instance in the new region. See Launching your customized RHEL system image for AWS from your AWS EC2

    Note

    When you copy an image to a different region, it results in a separate and new AMI in the destination region, with a unique AMI ID.

Chapter 7. Creating RHEL system image and uploading to Microsoft Azure using Red Hat Image Builder

You can create customized RHEL system images using Red Hat Image Builder, and upload those images to the Microsoft Azure cloud target environment. Then, you can create a Virtual Machine (VM) from the image you shared with the Microsoft Azure Cloud account.

7.1. Authorizing Red Hat Image Builder to push images to Microsoft Azure Cloud

Authorize Red Hat Image Builder to push images to the Microsoft Azure cloud. For that, you must:

  • Configure Red Hat Image Builder as an authorized application for your tenant GUID
  • Give it the role of Contributor to at least one resource group.

    To authorize Red Hat Image Builder as an authorized application, follow the steps:

Prerequisites

  • You have a Subscription account created in Microsoft Azure.
  • You have an existing Resource Group in Azure portal.
  • You have the User Access Administrator role rights.
  • Your Microsoft Azure subscription has Microsoft.Storage and Microsoft.Compute as a resource provider.

Procedure

  1. Access Red Hat Image Builder on a browser.

    The Red Hat Image Builder dashboard appears.

  2. Click Create image.

    The Create image dialog wizard opens.

  3. On the Image output page, complete the following steps:

    1. From the Release list, select the Release that you want to use: for example, choose Red Hat Enterprise Linux (RHEL).
    2. From the Select target environments option, select Microsoft Azure.

      Click Next.

  4. On the Target Environment - Microsoft Azure window, to add Red Hat Image Builder as an authorized application, complete the following steps:

    1. Insert your Tenant GUID.

      Image Builder checks f your Tenant GUID is correctly formatted and the Authorize Image Builder button becomes available.

    2. Click Authorize Image Builder to authorize Red Hat Image Builder to push images to the Microsoft Azure cloud.

      This redirects you to the Microsoft Azure portal.

      1. Login with your credentials.
      2. Click Accept the Permission requested.
    3. Confirm that Red Hat Image Builder is authorized for your tenant.

      1. Search for Azure Active Directory and choose Enterprise applications, from the left menu.
      2. Search for Red Hat Image Builder and confirm it is authorized.
    4. Add the Enterprise application as a contributor to your Resource Group.

      1. In the search bar, type Resource Groups and select the first entry under Services. This redirects you to the Resource Groups dashboard.
      2. Select your Resource Group.
      3. On the left menu, click Access control (IAM) to add a permission so the Red Hat Image Builder application can access your resource group.
      4. From the menu, click the tab Role assignments.
      5. Click +Add.
      6. From the dropdown menu, choose Add role assignment. A menu appears on the left side.
      7. Insert the following details:

        1. Role: Assign the Contributor role
        2. Assign access to: User, group, service principal. Add members: Click +Select members and type Red Hat in the search bar. Press enter.
        3. Select: Red Hat Image Builder application

The Red Hat Image Builder application is now authorized to push images to Microsoft Azure cloud.

Note

Even though any user can add an application to the resources group, the application is not able to locate any resource unless the account administrator adds the shared application to the IAM image.

Verification

  • From the menu, click the tab Role assignments.

    You can see Red Hat Image Builder set as a Contributor of the Resource Group you selected.

7.2. Creating a customized RHEL system image for Microsoft Azure using Image Builder

After you authorize Image Builder to push images to Microsoft Azure, create customized system images using Image Builder and upload those images to Microsoft Azure. For that, follow the steps:

Prerequisites

Procedure

  1. On the Target Environment - Microsoft Azure window, complete the following steps:

    1. Enter your Tenant GUID: you can find your Tenant ID in the Azure Active Directory application in Microsoft Azure Portal.
    2. Enter your Subscription ID: you can find your Subscription ID account by accessing the Microsoft Azure console.
    3. Enter your Resource group: is the name of your Resource Group in Microsoft Azure Portal.

      Click Next.

  2. On the Registration page, select the type of registration that you want to use. You can select from these options:

  3. Optional: On the Packages page, add packages to your image. See Chapter 4, Adding packages during image creation by Using Red Hat Image Builder.
  4. On the Name image page, enter a name for your image and click Next. If you do not enter a name, you can find the image you created by its UUID.
  5. On the Review page, review the details about the image creation and click Create image.

    After you complete the steps in the Create image wizard, the Image Builder dashboard is displayed.

    Red Hat Image Builder starts the compose of a RHEL Azure Disk Image image for the x86_64 architecture, uploads it to the resource group account you specified, and creates an Azure Image.

    The Red Hat Image Builder Images dashboard opens. You can see details such as the Image UUID, the cloud target environment, the image OS release and the status of the image creation. After the status is Ready, the Azure Disk Image is shared with the specified account.

    On the dashboard, you can see details such as the Image UUID, the cloud target environment, the image OS release and the status of the image creation.

    Possible statuses:

    • Pending: the image upload and cloud registration is being processed.
    • In Progress: the image upload and cloud registration is ongoing.
    • Ready: the image upload and cloud registration is completed
    • Failed: the image upload and cloud registration failed.

      Note

      The image build, upload and cloud registration processes can take up to ten minutes to complete.

Verification

  • Check if the image status is Ready. It means that the image upload and cloud registration completed successfully.

7.3. Accessing your customized RHEL system image from your Microsoft Azure account

After you have build and uploaded the image, and the cloud registration process status is marked as Ready, you can access the Azure Disk Image from your Microsoft Azure account.

Prerequisites

Procedure

  • Access your Microsoft Azure dashboard and navigate to the Resource group page.

Verification

  1. After you access your Microsoft Azure Account, you can see that the image successfully shared with the resource group account you specified.

    Note

    If the image is not visible there, you may have issues with the upload process. Return to the Red Hat Image Builder dashboard and check if the image is marked as Ready.

7.4. Creating a VM from the RHEL system image shared with the Azure account

You can create a Virtual Machine (VM) from the image you shared with the Microsoft Azure Cloud account by using Red Hat Image Builder.

Prerequisites

Procedure

  1. Click + Create VM. You are redirected to the Create a virtual machine dashboard.
  2. In the Basic tab under Project Details, your Subscription and the Resource Group are pre-set.

    Optional: If you want to create a new resource Group:

    1. Click Create new.

      A pop-up prompts you to create the Resource Group Name container.

    2. Insert a name and click OK.

      If you want to keep the Resource Group that is already pre-set.

  3. Under Instance Details, insert:

    1. Virtual machine name
    2. Region
    3. Image
    4. Size: Choose a VM size that better suits your needs.

      Keep the remaining fields as in the default choice.

  4. Under Administrator account, enter the following details:

    1. Username: the name of the account administrator.
    2. SSH public key source: from the drop-down menu, select Generate new key pair.
    3. Key pair name: insert a name for the key pair.
  5. Under Inbound port rules:

    1. Public inbound ports: select Allow selected ports.
    2. Select inbound ports: Use the default set SSH (22).
  6. Click Review + Create. You are redirected to the Review + create tab. You receive a confirmation that the validation passed.
  7. Review the details and click Create.

    To change options, click Previous.

  8. A Generates New Key Pair pop-up opens. Click Download private key and create resources.

    Save the key file in the yourKey.pem file format.

  9. After the deployment is complete, click Go to resource.

    You are redirected to a new window with your VM details.

  10. Select the public IP address on the top right side of the page and copy it to your clipboard.

Verification

Create an SSH connection to connect to the Virtual Machine you created. For that, follow the steps:

  1. Open a terminal.
  2. At your prompt, open an SSH connection to your virtual machine. Replace the IP address with the one from your VM, and replace the path to the .pem file with the path to where the key file was downloaded.

    # ssh -i <yourKey.pem file location> <username>@<IP_address>
    • Add the user name and replace the IP address with the one from your VM.
    • Replace the path to the .pem file with the path to where the key file was downloaded.

      For example:

      # ssh -i ./Downloads/yourKey.pem azureuser@10.111.12.123
  3. You are required to confirm if you want to continue to connect. Type yes to continue.

    As a result, the output image you shared with the Azure Storage account is started and ready to be provisioned.

    Note

    The default user is azureuser and the password is azureuser.

Chapter 8. Creating and uploading a customized RHEL system image to GCP using Red Hat Image Builder

You can create customized RHEL system images by using Red Hat Image Builder and upload those images to the Google Cloud Platform target environment.

8.1. Creating a customized RHEL system image for Google Cloud Platform using Red Hat Image Builder

You can create customized system images by using Red Hat Image Builder and upload those images to Google Cloud Platform. Then, you can start an instance from the image you uploaded.

Prerequisites

  • You have a valid Google account to share your image.
  • You have a Red Hat account. Access Portal.
  • You have access to the Red Hat Image Builder.

Procedure

  1. Access Red Hat Image Builder on the browser.

    The Red Hat Image Builder dashboard appears.

  2. Click Create image.

    The Create image dialog wizard opens.

  3. On the Image output page, complete the following steps:

    1. From the dropdown menu, select the Release: Red Hat Enterprise Linux (RHEL).
    2. From the Select target environments option, select Google Cloud Platform.

      Click Next.

  4. On the Target environment- Google Cloud Platform window, select a valid account type to share your image with: a Google account, a Service account or a domain name.

    • Google account: A Google account which interacts with Google Cloud, for example: alice@gmail.com.
    • Service account: An application account, for example: myapp@appspot.gserviceaccount.com.
    • Google group: A named collection of Google accounts and service accounts, for example: admins@example.com.
    • Google workspace domain/Cloud identity domain: A virtual group of all the Google accounts in a named organization. For example, the domain name mycompany.com.
  5. Enter the account email address or domain name, depending on the type of target environment you chose.

    Click Next.

  6. On the Registration page, select the type of registration that you want to use. You can select from these options:

  7. Optional: On the Packages page, add packages to your image. See Chapter 4, Adding packages during image creation by Using Red Hat Image Builder.
  8. On the Name image page, enter a name for your image and click Next. If you do not enter a name, you can find the image you created by its UUID
  9. On the Review page, review the details about the image creation and click Create image.

    After you complete the steps in the Create image wizard, the Image Builder dashboard is displayed.

    Red Hat Image Builder starts to compose the RHEL image for the x86_64 architecture and upload it to Google Cloud Platform. Then, it shares the image with the account you specified.

    On the dashboard you can see details such as, the Image UUID, the cloud target environment, the image OS release and the status of the image creation. After the new image displays a Ready status in the Status column, Red Hat Image Builder shares the image with the account you specified.

    Possible statuses:

    • Pending: the image upload and cloud registration is being processed.
    • In Progress: the image upload and cloud registration is ongoing.
    • Ready: the image upload and cloud registration is completed
    • Failed: the image upload and cloud registration failed.

      Note

      The image build, upload and cloud registration processes can take up to ten minutes to complete.

Verification

  • Check the status in the Images Dashboard. Click the image name to expand and show details.

    • The Ready status indicates that the image has been successfully created and shared with the Google account.

      • In addition, the window shows the number of days until image expiration.
    • You can check which account the image is shared with.

      Note

      The image artifacts are saved for 14 days and expire after that. Ensure to transfer the image to your account to avoid losing it.

8.2. Creating a VM instance using your GCE image

After the image is built, uploaded and the cloud registration process status is marked as Ready, you can create a Virtual Machine (VM) instance using the GCE image.

Prerequisites

  • You have the universally unique identifier (UUID) of the image you created.
  • You have access to the Image-builder service API endpoint.
  • You have access to your project details at Google Cloud Platform.
  • You can access Google Cloud Shell from your browser.

Procedure

  1. From the Red Hat Image Builder dashboard, copy the image UUID of the image you created.
  2. Access /composes/{composeId} API endpoint.
  3. Click the Try it Out button to activate the composeId string path.
  4. Enter the UUID into the composes/{composeId} field in the API endpoint.
  5. Click Execute. The API endpoint generates a response in the Response body, for example:

    {
      "image_status": {
        "status": "success",
        "upload_status": {
          "options": {
            "image_name": "composer-api-03f0e19c-0050-4c8a-a69e-88790219b086",
            "project_id": "red-hat-image-builder"
          },
          "status": "success",
          "type": "gcp"
        }
      }
    }
  6. From the Response body field, copy the image_name and project_id to access the image from the Google Cloud Platform environment.
  7. From your browser, access Google Cloud Shell.
  8. Set your Google Cloud Platform Project ID as the default GCP project. You can find the Product ID of your project by accessing the Google Cloud Platform dashboard.

    $ gcloud config set project PROJECT_ID
  9. In the Authorize Cloud Shell window prompt, click Authorize to allow this and future calls that require your credentials.
  10. Create a VM instance with the image by using the gcloud command in the Google Cloud Shell:

    $ gcloud compute instances create INSTANCE_NAME \
      --image-project PROJECT_ID_FROM_RESPONSE \
      --image IMAGE_NAME \
      --zone GCP_ZONE

    Where:

    • INSTANCE_NAME is the name you give to your instance;
    • PROJECT_ID_FROM_RESPONSE is the project_id generated by Response body;
    • IMAGE_NAME is the image_name generated by Response body;
    • GCP_ZONE is the GCP zone in which the instance will be created.

Verification

  1. Verify that Compute Engine created the VM:

    $ gcloud compute instances describe INSTANCE_NAME
  2. Connect to the VM instance via SSH:

    $ gcloud compute ssh --project=PROJECT_ID --zone=ZONE INSTANCE_NAME

8.3. Copying the GCE image to your project group

After the image is built, uploaded and the cloud registration process status is marked as Ready, you can create a Virtual Machine (VM) instance using the GCE image.

Prerequisites

  • The universally unique identifier (UUID) of the image you created.
  • Access to the Image-builder service API endpoint.
  • Access to the Google Cloud Shell from your browser.

Procedure

  1. From the Image Builder dashboard, copy the UUID image of the image you created.
  2. Access /composes/{composeId} API endpoint.
  3. Click the Try it Out button to activate the composeId string path.
  4. Enter the UUID into the composes/{composeId} field in the API endpoint.
  5. Click Execute. The API endpoint generates a response in the Response body, for example:

    {
      "image_status": {
        "status": "success",
        "upload_status": {
          "options": {
            "image_name": "composer-api-03f0e19c-0050-4c8a-a69e-88790219b086",
            "project_id": "red-hat-image-builder"
          },
          "status": "success",
          "type": "gcp"
        }
      }
    }
  6. From the Response body field, copy the image_name and project_id to access the image from the Google Cloud Platform environment. From the Response body:

    "image_name": "composer-api-03f0e19c-0050-4c8a-a69e-88790219b086",
    "project_id": "red-hat-image-builder"
  7. From your browser, access Google Cloud Shell.
  8. Set your Google Cloud Platform Project ID as the default GCP project. You can find the Product ID of your project by accessing the Google Cloud Platform dashboard.

    $ gcloud config set project PROJECT_ID
  9. In the Authorize Cloud Shell window prompt, click Authorize to allow this and future calls that require your credentials.
  10. Copy the image to your project by using the gcloud command:

    $ gcloud compute images create MY_IMAGE_NAME \
      --source-image-project red-hat-image-builder \
      --source-image IMAGE_NAME

    Where:

    • MY_IMAGE_NAME is the name you give to your instance;
    • red-hat-image-builder is the project_id generated by Response body;
    • IMAGE_NAME is the image_name generated by Response body;

Verification

Confirm that the image has been successfully copied to your project:

  • Using the Google Cloud Platform UI, by accessing the Compute Engine / Images section.
  • Using the gcloud tool, by running the command in Google Cloud Shell:

    $ gcloud compute images list --no-standard-images

Additional resources

Chapter 9. Creating and uploading a customized RHEL VMDK system image to VSphere

You can create customized RHEL system images by using Red Hat Image Builder and upload those images to the VMware vSphere client.

9.1. Creating a customized RHEL vmdk system image using Image Builder

You can create customized system images using Red Hat Image Builder and upload those images to VMware vSphere client.

Procedure

  1. Access Red Hat Image Builder on the browser.

    The Red Hat Image Builder dashboard appears.

  2. Click Create image.

    The Create image dialog wizard opens.

  3. On the Image output page, complete the following steps:

    1. From the Release list, select the Release that you want to use: for example, choose Red Hat Enterprise Linux (RHEL).
    2. From the Select target environments option, select VMWare.

      Click Next.

  4. On the Registration page, select the type of registration that you want to use. You can select from these options:

  5. Optional: On the Packages page, add packages to your image. See Chapter 4, Adding packages during image creation by Using Red Hat Image Builder.
  6. On the Name image page, enter a name for your image and click Next. If you do not enter a name, you can find the image you created by its UUID.
  7. On the Review page, review the details about the image creation and click Create image.

    After you complete the steps in the Create image wizard, the Image Builder dashboard is displayed.

  8. When the new image displays a Ready status in the Status column, click Download .vmdk in the Instance column.

    The .vmdk image is saved to your system and is ready for deployment.

    Note

    The .vmdk images are available for 6 hours and expire after that. Ensure to download the image to avoid losing it.

9.2. Uploading and deploying a VMDK image to VMware vSphere

Upload a .vmdk image to VMware vSphere via HTTP.

Prerequisites

  • You created an .vmdk image by using Image Builder.
  • You have access to VMware vSphere.

Procedure

  1. In the vCenter, click Upload Files .

    After you upload the image to vCenter, you can deploy it into a virtual machine (VM).

  2. Use your preferred method for VM creation in VMWare to create a virtual machine.
  3. In the New Virtual Machine wizard, complete the steps to create a new VM. The following is required for your .vmdk image to function correctly:

    • For the Customize hardware step: When you create a VM, on the Device Configuration button on the upper right, delete the default New Hard Disk and use the drop-down to select an Existing Hard Disk disk image.

      Note

      You must use an IDE device as the Virtual Device Node for the disk you create. The default SCSI value results in an unbootable virtual machine.

    • For the Ready to complete step: Review the details and click Finish to create the image.

      The new VM is created and available in vSphere Client.

9.3. Creating a user for the VMDK image with cloud-init

To be able to login into your VM, you must create a user account. For that, follow the steps on the CLI.

Note

The GUI wizard does not support cloud-init.

Prerequisites

  • You configured the govc VMware CLI tool client.

    • To use the govc VMware CLI tool client, you must set the following values in the environment:

      GOVC_URL
      GOVC_DATACENTER
      GOVC_FOLDER
      GOVC_DATASTORE
      GOVC_RESOURCE_POOL
      GOVC_NETWORK

Procedure

  1. Access the directory where you downloaded your .vmdk image.
  2. Create a file named metadata.yaml. Add the following information to this file:

    instance-id: cloud-vm
    local-hostname: vmname
  3. Create a file named userdata.yaml. Add the following information to the file:

    #cloud-config
    users
    - name: admin
      sudo: "ALL=(ALL) NOPASSWD:ALL"
      ssh_authorized_keys:
      - ssh-rsa AAA...fhHQ== your.email@example.com
    • ssh_authorized_keys is your SSH public key. You can find your SSH public key in ~/.ssh/id_rsa.pub.
  4. Export the metadata.yaml and userdata.yaml files to the environment, compressed with gzip, encoded in base64 as follows. They will be used in further steps.

    export METADATA=$(gzip -c9 <metadata.yaml | { base64 -w0 2>/dev/null || base64; }) \
    USERDATA=$(gzip -c9 <userdata.yaml | { base64 -w0 2>/dev/null || base64; })
  5. Launch the image on vSphere with the metadata.yaml and userdata.yaml files:

    1. Import the .vmdk image in to vSphere:

      $ govc import.vmdk ./composer-api.vmdk foldername
    2. Create the VM in VSphere without powering it on:

      govc vm.create \
      -net.adapter=vmxnet3 \
      -m=4096 -c=2 -g=rhel8_64Guest \
      -firmware=bios -disk=”foldername/composer-api.vmdk” \
      -disk.controller=ide -on=false \
       vmname
    3. Change the VM to add ExtraConfig variables, the cloud-init config:

      govc vm.change -vm vmname \
      -e guestinfo.metadata="${METADATA}" \
      -e guestinfo.metadata.encoding="gzip+base64" \
      -e guestinfo.userdata="${USERDATA}" \
      -e guestinfo.userdata.encoding="gzip+base64"
    4. Power-on the VM:

      govc vm.power -on vmname
    5. Retrieve the VM IP address:

      HOST=$(govc vm.ip vmname)
    6. Use SSH to log in to the VM, using the user-data specified in cloud-init file configuration:

      $ ssh admin@HOST

Additional resources

Chapter 10. Creating a customized RHEL Guest image using Red Hat Image Builder

You can create customized RHEL guest system images using Red Hat Image Builder. You can then download these images to create virtual machines from these guest images as per your requirements.

10.1. Creating a customized RHEL Guest system image using Image Builder

Follow the steps to create customized RHEL guest .qcow2 images using Red Hat Image Builder.

Procedure

  1. Access Red Hat Image Builder on the browser.

    You are redirected to the Red Hat Image Builder dashboard.

  2. Click Create image.

    The Create image wizard opens.

  3. On the Image output page, complete the following steps:

    1. From the Releases list, select the release of Red Hat Enterprise Linux (RHEL) that you want to use to create the image.
    2. From the Select target environments options, select Virtualization - Guest image.

      Click Next.

  4. On the Registration page, select the type of registration that you want to use. You can select from these options:

    1. Register images with Red Hat - Register and connect image instances, subscriptions and insights with Red Hat. For details on how to embed an activation key and register systems on first boot, see Chapter 3, Creating a customized system image with an embed subscription using Red Hat Image Builder.
    2. Register image instances only - Register and connect only image instances and subscriptions with Red Hat.
    3. Register later - Register the system after the image creation.

      Click Next.

  5. Optional: On the Packages page, add packages to your image. See Chapter 4, Adding packages during image creation by Using Red Hat Image Builder.
  6. On the Name image page, enter a name for your image and click Next. If you do not enter a name, you can find the image you created by its UUID.
  7. On the Review page, review the details about the image creation and click Create image.

    After you complete the steps in the Create image wizard, the Image Builder dashboard is displayed.

  8. When the new image displays a Ready status in the Status column, click Download .qcow2 image in the Instance column.

    The .qcow2 image is saved to your system and is ready for deployment.

    Note

    The .qcow2 images are available for 6 hours and expire after that. Ensure to download the image to avoid losing it.

10.2. Creating a Virtual Machine from the customized RHEL Guest system image

You can create a Virtual Machine (VM) from the qcow2 image that you created using Red Hat Image Builder.

Prerequisites

  • You created and downloaded a .qcow2 image using Image Builder.

Procedure

  1. Access the directory where you downloaded your .qcow2 image.
  2. Create a file named meta-data. Add the following information to this file:

    instance-id: nocloud
    local-hostname: vmname
  3. Create a file named user-data. Add the following information to the file:

    #cloud-config
    user: admin
    password: password
    chpasswd: {expire: False}
    ssh_pwauth: True
    ssh_authorized_keys:
      - ssh-rsa AAA...fhHQ== your.email@example.com
    • ssh_authorized_keys is your SSH public key. You can find your SSH public key in ~/.ssh/id_rsa.pub.
  4. Use the genisoimage command to create an ISO image that includes the user-data and meta-data files.

    # genisoimage -output cloud-init.iso -volid cidata -joliet -rock user-data meta-data
    
    I: -input-charset not specified, using utf-8 (detected in locale settings)
    Total translation table size: 0
    Total rockridge attributes bytes: 331
    Total directory bytes: 0
    Path table size(bytes): 10
    Max brk space used 0
    183 extents written (0 MB)
  5. Create a new VM from the KVM Guest Image using the virt-install command. Include the ISO image you created on step 4 as an attachment to the VM image.

    # virt-install \
        --memory 4096 \
        --vcpus 4 \
        --name myvm \
        --disk composer-api.qcow2,device=disk,bus=virtio,format=qcow2 \
        --disk cloud-init.iso,device=cdrom \
        --os-variant rhel8.5 \
        --virt-type kvm \
        --graphics none \
        --import

    Where,

    • --graphics none - indicates that it is a headless RHEL Virtual Machine.
    • --vcpus 4 - indicates that it uses 4 virtual CPUs.
    • --memory 4096 - indicates that it uses 4096 MB RAM.
  6. The VM installation starts:

    Starting install...
    Connected to domain myvm
    ...
    [  OK  ] Started Execute cloud user/final scripts.
    [  OK  ] Reached target Cloud-init target.
    
    Red Hat Enterprise Linux 8.5 (Ootpa)
    Kernel 4.18.0-221.el8.x86_64 on an x86_64

Chapter 11. Creating a customized RHEL bare metal image using Red Hat Image Builder

You can create customized RHEL ISO system images using the Red Hat Image Builder. You can then download these images and install them on a bare metal system as per your requirements.

11.1. Creating a customized RHEL ISO system image using Image Builder

Follow the steps to create custom RHEL .iso images using the Red Hat Image Builder.

Procedure

  1. Access Red Hat Image Builder on the browser.

    The Red Hat Image Builder dashboard opens.

  2. Click Create image.

    The Create image dialog wizard opens.

  3. On the Image output page, complete the following steps:

    1. From the Release list, select the Release that you want to use: for example, choose Red Hat Enterprise Linux (RHEL).
    2. From the Select target environments option, select Bare metal - Installer.

      Click Next.

  4. On the Registration page, select the type of registration that you want to use. You can select from these options:

  5. Optional: On the Packages page, add packages to your image. See Chapter 4, Adding packages during image creation by Using Red Hat Image Builder.
  6. On the Name image page, enter a name for your image and click Next. If you do not enter a name, you can find the image you created by its UUID.
  7. On the Review page, review the details about the image creation and click Create image. Your image is created as a .iso image.
  8. When the new image displays a Ready status in the Status column, click Download .iso image.

    The .iso image is saved to your system and is ready for deployment.

    Note

    The .iso images are available for 6 hours and expire after that. Ensure to download the image to avoid losing it.

11.2. Installing the customized RHEL ISO system image to a bare metal system

You can create a virtual machine (VM) from the .iso image that you created using the Red Hat Image Builder.

Prerequisites

  • You created and downloaded a .iso image using the Image Builder.
  • A 8 GB USB flash drive.

Procedure

  1. Access the directory where you downloaded your .iso image.
  2. Place the bootable ISO image file on a USB flash drive.
  3. Connect the USB flash drive to the port of the computer you want to boot.
  4. Boot the ISO image from the USB flash drive.
  5. Perform the steps to install the customized bootable ISO image.

    The boot screen shows you the following options:

    • Install Red Hat Enterprise Linux 8
    • Test this media & install Red Hat Enterprise Linux 8

Additional resources

Chapter 12. Locating the images you created using Red Hat Image Builder

By accessing the Red Hat Image Builder dashboard, you are able to locate the images built for you.

12.1. Locating your customized images in the Image Builder dashboard

After your customized images are uploaded to the cloud or clouds, you can still locate these images and, if they are still valid, you have the option to copy them and also launch them directly from the dashboard.

To locate your images in Image Builder, complete the following steps:

Prerequisites

Procedure

  1. Access the Red Hat Image Builder dashboard.

    You are redirected to the Red Hat Image Builder dashboard and can see all the images that were built for you.

  2. Locate your image by name.

    1. Type your image name in the search bar on the top left menu.
    2. If your image exists, image details appear, showing: the Image name, Creation date, Release version, cloud Target, and image Status.

      You can also see information about any customizations applied to the image, such as packages and file system configuration.

  3. Under Uploads, you can find the uploaded images.

Legal Notice

Copyright © 2022 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.