Chapter 4. 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.

4.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

  • You have a RHEL subscription.
  • You have Organization Administrator permissions.
  • You must have access to Integrations.
  • You have your public cloud connected with the Red Hat Hybrid Cloud Console if you want to launch your images to the public clouds. For details, see Configuring cloud integrations for Red Hat services.

Procedure

  1. Access Hybrid Cloud Console.
  2. Click Red Hat Insights > RHEL > Inventory > Images.

    The Insights Images dashboard appears.

  3. Click Create blueprint.

    The wizard for the blueprint creation opens.

  4. 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.
  5. On the Register page, select one of the registration methods and click Next: Automatically register and enable advanced capabilities or Register later.

    If you choose the Automatically register and enable advanced capabilities option, customize it further.

    1. Click the Show additional connection options button.

      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 to allow Red Hat connector (rhc) enable Red Hat Enterprise Linux hosts to connect to Red Hat Insights for using Red Hat Insights Remediations service.
    2. Choose the checkboxes according to your preferences.
    3. From the dropdown menu, choose an activation key to use for the image. See Creating an activation key.

      1. No activation keys found - If you do not have an activation key, you can choose the default activation key by completing the following step:

        1. Click the Create activation key button. The Select activation key dropdown menu enables the activation-key-default. It is a preset key with the basic configuration. To manage the activation key, access Activation keys.

+. Optional: On the OpenSCAP profile page, select one OpenSCAP profile and click Next:

  1. From the dropdown menu, select a regulatory compliance profile.

    1. On the File system configuration page, click one of the following options and click Next:

      • Use automatic partitioning: The recommended partitioning.
      • Manually configure partitions To configure the image file system manually.
  2. Click the Manually configure partitioning radio button. The Configure partitions section opens, showing the configuration 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.

      1. Optional: On the Content page, complete the following steps to add additional packages to your image:
  3. 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 to use the latest state of the repository.
    • Use a snapshot to select 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.
  4. On the Custom repositories page, select the custom repositories from which you can add packages to the image and click Next.
  5. On the Additional Red Hat packages page, search for the packages with the search field and choose the packages you need. Click Next.

    1. 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.

      Note that this step is available in the Preview mode only.

    2. On the Details page, enter a name for the blueprint and click Next. When creating an image from the blueprint, unless you define a name to the image, it takes the name of the parent blueprint.
    3. 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 - create 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 chose.

        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 architecture that you selected. After the image build is ready, you can see the images related to the parent blueprint in the Images dashboard.

4.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.
  2. Click Red Hat Insights > RHEL > Inventory > Images.

    The Insights Images dashboard appears.

  3. Search for the blueprint that you want to edit. You can use the Search field to search for the blueprint name.
  4. Click the blueprint that you want to edit.
  5. Click Edit blueprint. You are redirected to the Review page.
  6. From the navigation menu, select the section that you want to edit.
  7. After making the changes, click the Review page.
  8. 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.

4.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.
  2. Click Red Hat Insights > RHEL > Inventory > Images.

    The Insights Images dashboard appears.

  3. Search for the blueprint that you want to edit. You can use the Search field to search for the blueprint name.
  4. Click the blueprint that you want to edit.
  5. Click Edit blueprint. You are redirected to the Review page.
  6. 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.

4.4. Downloading a blueprint

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

Prerequisites

  • You have created a blueprint.

Procedure

  1. Access Hybrid Cloud Console.
  2. Click Red Hat Insights > RHEL > Inventory > Images.

    The Insights Images dashboard appears.

  3. Search for the blueprint that you want to download. You can use the Search field to search for the blueprint name.
  4. Click the blueprint that you want to download.
  5. 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.

4.5. 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.
  2. Click Red Hat Insights > RHEL > Inventory > Images.

    The Insights Images dashboard appears.

  3. Search for the blueprint that you want to delete. You can use the Search field to search for the blueprint name.
  4. Click the blueprint that you want to delete.
  5. From the More options menu, select the "Delete blueprint" option.
  6. Confirm the deletion by clicking Delete.