Search

Chapter 6. Creating and uploading a customized RHEL system image to Amazon Web Services by using Insights image builder

download PDF

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.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.