Creating customized images by using Insights image builder

Red Hat Enterprise Linux 8

Creating customized system images with Insights image builder and uploading them to cloud environments

Red Hat Customer Content Services

Abstract

Insights 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 feedback through Jira (account required)

  1. Log in to the Jira website.
  2. Click Create in the top navigation bar.
  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 Create at the bottom of the dialogue.

Chapter 1. Introducing Insights image builder on Red Hat Hybrid Cloud Console

1.1. Insights image builder on Red Hat Hybrid Cloud Console

Insights 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 Insights 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 Insights image builder on Red Hat Hybrid Cloud Console

2.1. Getting access to Insights image builder on Red Hat Hybrid Cloud Console

Follow the steps to access Insights image builder on Red Hat Hybrid Cloud Console.

Prerequisites

Procedure

  1. Access Insights 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 by using Insights image builder

You can create customized system images by using Insights 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 Insights image builder

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

Prerequisites

Procedure

  1. Access Insights image builder.

    The Insights 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 Register page, select the registration method that you want to use. You can select from these options: Automatically register and enable advanced capabilities or Register later.

    1. If you choose the Automatically register and enable advanced capabilities option, you can customize it further by clicking the Show additional connection options:

      1. The Monitor & manage subscriptions and access to Red Hat content radio button enables the following option:

        • Enable predictive analytics and management capabilities - to provide actionable intelligence about your Red Hat Enterprise Linux environments, helping to identify and address operational and vulnerability risks before an issue results in downtime.
        • Enable remote remediations and system management with automation - rhc enables Red Hat Enterprise Linux hosts to connect to Red Hat Insights to use the Red Hat Insights Remediations service.

          You can check or clear the checkboxes according to your preferences.

      2. From the dropdown menu, choose an activation key to use for the image. See Create and manage activation keys. Click Next.
    2. If you choose the Register later option, click Next.
  5. On the File system configuration page, define the partitioning of the image. You can select from these options: Use automatic partitioning (Recommended) or Manually configure partitions. Click Next.
  6. Optional: On the Additional Red Hat packages page, add packages to your image. See Adding packages during image creation by using Insights 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 information and click Create image.

    After you complete the steps in the Create image wizard, the image builder dashboard is displayed. Insights image builder starts the compose of a RHEL image for the x86_64 architecture.

    The Insights 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 4. Adding packages during image creation by using Insights 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 Insights 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 Insights 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 packages 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 packages 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 packages 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. Insights image builder starts the compose of a RHEL image for the x86_64 architecture.

    The Insights 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 Insights image builder you can customize your filesystem layouts to set up the desired partitions and sizes during the image creation process.

Warning

The support to customize filesystem partitions is available for all the image types, except for the Bare metal - Installer (.iso) type.

5.1. Manually configuring partitions during image creation

When creating a customized image with Insights image builder, you can customize the system configuration to use manual or automatic partitioning. Use the automatic partitioning, which is the default. 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 Insights 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. Insights image builder starts the compose of a RHEL image for the x86_64 architecture.

      The Insights image builder 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 Services by using Insights image builder

You can create customized RHEL system images by using Insights 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 by using Insights image builder

Complete the following steps to create customized system images using Insights image builder and upload those images to Amazon Web Services (AWS).

Prerequisites

Procedure

  1. Access Insights image builder.

    The Insights 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 Services 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. Click Next.
  7. Optional: On the Packages page, add packages to your image. See Adding packages during image creation by using Insights 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.

    Insights 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 that you 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 by 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 by 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 over SSH.

Verification

  • From a terminal, check if you are able to perform any action while connected to your instance by 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.

6.5. Sharing your AWS images to a different region

You can share the images you create to different regions and therefore access the same image in more regions, creating more images from a build with the exact same content. After the images status becomes Ready, you can start your instance to the AWS selected region. To push the image to a different region or regions, follow the steps:

Prerequisites

  • You created an AWS image.

Procedure

  1. From the Image Builder table, select the AWS image you want to upload to a different region.
  2. From the Node options icon (⫶), select Share to new region. A Share to new region wizard opens.

    1. From the Select region dropdown menu, choose the region or regions to upload your image. Click Share.

After the images status becomes Ready, you can start your new instance to the AWS selected region.

Verification

  1. Click the Node options icon (⫶) and select an AWS region to start the image.
  2. The Image Builder table shows the image or images build status that you shared to the new region or regions.

Chapter 7. Creating RHEL system image and uploading to Microsoft Azure by using Insights image builder

You can create customized RHEL system images by using Insights 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 Insights image builder to push images to Microsoft Azure Cloud

To authorize Insights image builder to push images to the Microsoft Azure cloud, you must:

  • Configure Insights image builder as an authorized application for your tenant GUID
  • Give it the role of Contributor to at least one resource group.

    To authorize Insights image builder as an authorized application, follow the steps:

Prerequisites

  • You have an existing Resource Group in Microsoft 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 Insights image builder on a browser.

    The Insights 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 Insights image builder as an authorized application, complete the following steps:

    1. Insert your Tenant GUID.

      Image builder checks if your Tenant GUID is correctly formatted and the Authorize image builder button becomes available.

    2. Click Authorize image builder to authorize Insights 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 Insights image builder is authorized for your tenant.

      1. Search for Azure Active Directory and choose Enterprise applications, from the left menu.
      2. Search for Insights 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 Insights 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: Insights image builder application

The Insights 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 as a contributor under the IAM section of the resource group. .

Verification

  • From the menu, click the tab Role assignments.

    You can see Insights 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 Microsoft 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. Click Next.
  4. Optional: On the Packages page, add packages to your image. See Adding packages during image creation by using Insights image builder.
  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 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.

    Insights 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 a Microsoft Azure Image.

    The Insights 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 finishing to build and upload 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 might have issues with the upload process. Return to the Insights image builder dashboard and check if the image is marked as Ready.

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

You can create a Virtual Machine (VM) from the image you shared with the Microsoft Azure Cloud account by using Insights 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 Microsoft 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 by using Insights image builder

You can create customized RHEL system images by using Insights image builder and upload those images to the Google Cloud Platform (GCP) target environment.

Note

You can deploy the images you created with the image builder tool in the GCP environment only by using the gcloud CLI tool.

8.1. Creating a customized RHEL system image for Google Cloud Platform by using Insights image builder

You can create customized system images by using Insights 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 Insights image builder.

Procedure

  1. Access Insights image builder.

    The Insights 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. Click Next.
  8. Optional: On the Packages page, add packages to your image. See Adding packages during image creation by using Insights image builder.
  9. 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
  10. 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.

    Insights 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 operating system release and the status of the image creation. After the new image displays a Ready status in the Status column, Insights 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 that you 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 Insights 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 through 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 Insights image builder and upload those images to the VMware vSphere client.

9.1. Creating a customized RHEL VMDK system image by using Insights image builder

With Insights image builder, you can create customized system images in the Open virtualization format (.ova) or in the Virtual disk (.vmdk) format. You can upload these images to VMware vSphere.

You can import the Virtual disk (.vmdk) format only with the govc client. As for the Open virtualization format (.ova), you can import it by using both the vSphere GUI and govc clients.

The Open virtualization format (.ova) is a .vmdk image with additional metadata about the virtual hardware, when imported it creates a VM. After importing the .ova image into vSphere, you can configure the VM with any additional hardware, such as network, disks and CD-ROM.

Procedure

  1. Access Insights image builder on the browser.

    The Insights 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.
    3. Select one of the options:

      • Open virtualization format (.ova)
      • Virtual disk (.vmdk) format

        Click Next.

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

  5. Click Next.
  6. Optional: On the Packages page, add packages to your image. See Adding packages during image creation by using Insights 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.

  9. 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 that you download the image to avoid losing it.

9.2. Deploying VMDK images to vSphere by using the GUI

After creating your Open virtualization format (.ova) image, you can deploy it to VMware vSphere by using the vSphere GUI client. It will create a VM which can be customized further before booting.

Note

The GUI wizard does not support cloud-init.

Prerequisite

  • You logged in to the vSphere UI in a browser.
  • You downloaded your (.ova) image.

Procedure

  1. In the vSphere Client, from the Actions menu, select Deploy OVF Template.
  2. On the Deploy OVF Template page, complete the settings for each configuration option and click Next.
  3. Click Finish. The .ova image starts to be deployed.

    After the image deployment is complete, you have a new virtual machine (VM) from the .ova image.

  4. In the deployed image page, perform the following steps:

    1. From the Actions menu, select Edit Setting.
    2. On the Virtual Hardware tab, configure resources such as CPU, memory, add a new network adapter, between others of your choice.

      1. On the CD/DVD drive 1 option, attach a CD or DVD Drive that contains a cloud-init.iso, to provision a user on startup.

        The VM is now ready to boot with the username and password from the cloud-init.iso file.

9.3. Deploying VMDK images to vSphere by using the CLI

After creating your image, you can deploy it to VMware vSphere by using the CLI. Then, you can create a VM and login into it.

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 by using Insights image builder

You can create customized RHEL guest system images by using Insights image builder. You can then download these images to create virtual machines from these guest images according to your requirements.

10.1. Creating a customized RHEL Guest system image by using Insights image builder

Complete the following steps to create customized RHEL Guest .qcow2 images by using Insights image builder.

Procedure

  1. Access Insights image builder in your browser.

    You are redirected to the Insights 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:

  5. Click Next.
  6. Optional: On the Packages page, add packages to your image. See Adding packages during image creation by using Insights 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.

  9. 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 that you 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 by using Insights image builder.

Prerequisites

  • You created and downloaded a QCOW2 image by using Insights 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 \
        --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 (Ootpa)
    Kernel 4.18.0-221.el8.x86_64 on an x86_64

Chapter 11. Creating a customized RHEL bare metal image by using Insights image builder

You can create customized RHEL ISO system images by using the Insights image builder. You can then download these images and install them on a bare metal system according to your requirements.

11.1. Creating a customized RHEL ISO system image by using Insights image builder

Complete the following steps to create customized RHEL ISO images by using the Insights image builder.

Procedure

  1. Access Insights image builder on the browser.

    The Insights 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.
  4. Click Next.
  5. On the Registration page, select the type of registration that you want to use. You can select from these options:

  6. Click Next.
  7. Optional: On the Packages page, add packages to your image. See Adding packages during image creation by using Insights 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. Your image is created as a .iso image.
  10. 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 that you 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 Insights image builder.

Prerequisites

  • You created and downloaded an ISO image by using Insights 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 by using Insights image builder

By accessing the Insights image builder dashboard, you are able to locate the images built for you.

12.1. Locating your customized images in the Insights 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 the image builder dashboard, complete the following steps:

Prerequisites

Procedure

  1. Access the Insights image builder dashboard.

    You are redirected to the Insights 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.

Chapter 13. Creating a new image from an existing customized build by using Insights image builder

You can recreate an existing customized RHEL image by using Insights image builder. It recreates the exact image you want to recreate, but the new image is recreated with a different UUID. Additionally, the new image fetches the package updates and refreshes the content with those updates. You can customize this new image with additional customizations according to your requirements.

13.1. Creating a new image from an existing build

To recreate a new image from an existing compose, follow the steps:

Prerequisites

  • You created an image and customized it according to your requirements.

Procedure

  1. From the Image Builder dashboard, select the image you want to create an image from.
  2. From the Node options icon (⫶), select Recreate image. The Create image wizard opens.

    Note

    If the image status is Expired, click directly the Recreate image button.

    1. Optional: If you want to make any modifications to the image, such as adding new packages, navigate to the appropriate step using the menu on the left to make the customizations. Click Next.
    2. On the Review page, click Create image.

The Insights image builder Images dashboard opens. The image build starts to recreate the image. You can see details such as the Image name, UUID, the cloud target environment, the image operating system release and the status of the image creation.

Verification

  • From the Status column, check if the image is Ready.
  • Optional: Click Image details to display additional information about the recreated image.

Legal Notice

Copyright © 2024 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.