Chapter 5. Creating blueprints and blueprint images


An image blueprint is a persistent definition of the required image customizations. that enables you to create multiple builds from it, without having to configure the blueprint for each image build. You can edit, rebuild, delete, and save a blueprint to keep rebuilding images from it. You can define and manage, by editing or deleting a blueprint, and to keep rebuilding it, removing the need to configure the build each time. When you rebuild a blueprint, all targets specified in the blueprint are rebuilt. The blueprint groups the images that were built from it, so that you can have access to all the related images when dealing with large amounts of images.

The blueprints are persistent and you can manage their customizations. Even if the resulting builds, and images from those builds have different content versions, the customizations stored in that blueprint are always applied across all builds resulting from this blueprint.

When creating an image from the blueprint, unless you define a name to the image, it takes the name of the parent blueprint.

5.1. Creating a blueprint

You can create a blueprint with a name, specify the packages that you want to install and define other customizations. You can build images from this blueprint, and the resulting images have all customizations that you specified in this blueprint.

Prerequisites

Procedure

  1. Access Hybrid Cloud Console, click Services Red Hat Enterprise Linux Inventory Images. The Insights Images dashboard appears.
  2. Click Create blueprint. The wizard for the blueprint creation opens.
  3. On the Image output page, select the following options and click Next:

    1. From the Release list, select the release that you want to use.
    2. From the Architecture list, select the architecture that you want to use.
    3. From the Select target environments options, select the environments that you want to use.
  4. Optional: On the Register page, the "Automatically register and enable advanced capabilities" is enabled by default and the activation key drop down is automatically populated. The Next button gets temporarily disabled when the activation key is loading. You can disable the automatic registration by clearing the checkbox if you prefer to register your system during initial boot.

    • If you have previously added a key during recent blueprint creation, the same key gets automatically selected.
    • If you have activation keys, but have not used any key previously, the first activation key will get selected.
    • If you have no activation keys, select "Automatically create and select a default key" to automatically create and use an activation-key-default-<ID> default activation key.
    • You can also select any of the available activation keys.

      The following steps are optional, and if you do not want to customize the image further, you can click the Review and finish button to finish the image creation process. You will be redirected to the Details step.

  5. Optional: On the OpenSCAP profile page, from the drop down menu, select one of the available options and click Next:

    OpenSCAP
    The standard option profile does not enable you to customize policies. The policy must match the RHEL version. For more details, see Supported configurations.
    None
    The default visible option. Keep this option selected if you do not want to secure your system.
    (Tech Preview) Insights compliance
    Choose this option to attach the system to a customized predefined sets of policies. The compliance system is attached to the customized policy. The images you build with image builder will automatically appear under the scap policy of the system. You must have an existing set of policies to choose from. See Creating new SCAP policies on how to create your policy. If you do not have created your set of policies, click Define new policies in Insights Compliance to create the policy, and refresh the Console to see the policy that you created under the Insights compliance drop down menu. The system is attached to the customized policy. After you create the image, the system will show up under the compliance system.
  6. Optional: On the File system configuration page, select one of the following options and click Next:

    • Use automatic partitioning: The recommended partitioning, depending on the target environment.
    • Manually configure partitions Use to manually configure the image file system partitions, by following the steps:

      1. Click the Manually configure partitioning radio button to show the Configure partitions section and configure the partitions based on Red Hat standards and security guides.

        1. From the drop-down menu, provide details to configure the partitions:
        2. For the Mount point field, select one mount point type option

          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, for example to xfs, or other type.

        3. For the Minimum size partition field of the file system, enter the desired minimum partition size. In the Minimum size drop-down menu, you can use common size units such as GiB, MiB, or KiB. The default unit is GiB.
        4. To add more partitions, click Add partition and repeat the steps for each added partition.
  7. Optional: On the Repository snapshot page, choose one of the following options and click Next. Note that this step is available in the Preview mode only.

    • Use latest content:: the image uses the latest state of the repository.
    • Use a snapshot:: The image selects a specific date of snapshot creation. If you choose the Use a snapshot option, the images will have the static state of the repository based on a date you specify.
  8. Optional: On the Custom repositories page, select the custom repositories from which you can add packages to the image and click Next.
  9. Optional: On the Additional Red Hat packages page, search for the packages with the search field and choose the packages you need. Click Next.
  10. Optional: On the First boot configuration page, include a file with an action script or write it in the </> SHELL field. That script is executed during the first boot of this image. It is useful when you want to enable your custom services or run an Ansible playbook at the boot time of the image. Click Next.

    You must start your script with a shebang, for example the #!/bin/sh for Bash shell. The first boot feature supports Python, Bash and YAML syntax.

  11. On the Details page, the blueprint name is prefilled in the "<distribution>-<architecture>-<datetimeString>" format. You can enter a name for the blueprint, and the system checks for validity and duplicity against already existing blueprint names. Click Next.
  12. On the Review page, verify the image details about the image creation and from the Create blueprint drop-down menu, choose one of the following options:

    Create blueprint
    Creates the blueprint and saves the customizations for your blueprint.
    Create blueprint and build image

    Create the blueprint, save the customizations for your blueprint and build images for the target environment or environments that you choose.

    The system verifies the build manifest of the image. After it reaches 100%, the image appears in the build queue.

Insights Images service starts to compose a RHEL image for the selected architecture. After the image build is ready, you can see the images related to the parent blueprint in the Images dashboard.

5.2. Editing an existing blueprint

You can edit a blueprint. For example, to include an extra package. After you finish the blueprint editing, all the images related to the parent blueprint are rebuilt and updated with the new package.

Prerequisites

  • You have created a blueprint.

Procedure

  1. Access Hybrid Cloud Console, click Services Red Hat Enterprise Linux Inventory Images. The Insights Images dashboard appears.
  2. Search for the blueprint that you want to edit. You can use the Search field to search for the blueprint name.
  3. Click the blueprint that you want to edit.
  4. Click Edit blueprint. You are redirected to the Review page.
  5. From the navigation menu, select the section that you want to edit.
  6. After making the changes, click the Review page.
  7. Click Save changes to the blueprint.

    The images related to the parent blueprint that you modified will be rebuilt and updated with the new changes.

5.3. Rebuilding an existing blueprint

Every time that you edit your blueprint, it creates a new version of that blueprint. It also impacts the images that are related to that blueprint, making them out of sync with the blueprint. To fix this, and ensure that you have the least updates available on your parent blueprint and the related images, you can edit your blueprint and rebuild it with the latest updates. This action updates all the packages specified in the blueprint and rebuild the related images with the updated packages.

Prerequisites

  • You have created a blueprint.

Procedure

  1. Access Hybrid Cloud Console, click Services Red Hat Enterprise Linux Inventory Images. The Insights Images dashboard appears.
  2. Search for the blueprint that you want to edit. You can use the Search field to search for the blueprint name.
  3. Click the blueprint that you want to edit.
  4. Click Edit blueprint. You are redirected to the Review page.
  5. Make the changes to the blueprint and select one of the options:

    Save
    Save the customizations for your blueprint.
    Save and build image
    Save the customizations for your blueprint and build images from the target environments that you chose.

5.4. Importing a blueprint

You can import a blueprint from an external source to the Hybrid Cloud Console.

Important

The Import feature is only available in the Preview mode.

Prerequisites

  • You have created a blueprint in the JSON format.

Procedure

  1. Access Hybrid Cloud Console, click Services Red Hat Enterprise Linux Inventory Images. The Insights Images dashboard appears.
  2. Click Import. The Import pipeline window opens.
  3. Optional: To add custom repositories from the blueprint to your repositories, select the Import missing custom repositories after file upload checkbox.

    Warning

    If the blueprint contains missing repositories, the images that you create from this blueprint might not work as expected.

  4. Upload the blueprint that you want to import either drag and drop or by selecting the file from your local storage.
  5. Click Review and finish.

5.5. Downloading a blueprint

You can export a blueprint that you created in the Hybrid Cloud Console by downloading it in the JSON format.

Important

The ability to download a blueprint is only available in the "Preview" mode.

Prerequisites

  • You have created a blueprint.

Procedure

  1. Access Hybrid Cloud Console, click Services Red Hat Enterprise Linux Inventory Images. The Insights Images dashboard appears.
  2. Search for the blueprint that you want to download. You can use the Search field to search for the blueprint name.
  3. Click the blueprint that you want to download.
  4. From the More options menu, select the "Download blueprint" option.

    The blueprint is saved as a file in the .json format to the local storage that you define in your web browser.

5.6. Deleting a blueprint

If you no longer need a blueprint, you can delete it. All the images related to this blueprint will also be deleted.

Prerequisites

  • You have created a blueprint.

Procedure

  1. Access Hybrid Cloud Console, click Services Red Hat Enterprise Linux Inventory Images. The Insights Images dashboard appears.
  2. Search for the blueprint that you want to delete. You can use the Search field to search for the blueprint name.
  3. Click the blueprint that you want to delete.
  4. From the More options menu, select the "Delete blueprint" option.
  5. Confirm the deletion by clicking Delete.
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.