Este conteúdo não está disponível no idioma selecionado.
Chapter 3. 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.
3.1. Creating a blueprint Copiar o linkLink copiado para a área de transferência!
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.
- Optional: If you want to launch your images to the public clouds, you must have access to Integrations. To connect your public cloud with the Red Hat Hybrid Cloud Console, see Configuring integrations to launch RHEL images.
- Optional: You have the Activation key for the RHEL system. For details, see Creating an activation key.
Procedure
-
Access the Hybrid Cloud Console, and navigate to
. The Lightspeed Images dashboard appears. For details on how to access the Red Hat Hybrid Cloud Console, see Getting started with the Red Hat Hybrid Cloud Console. - Click . The wizard for the blueprint creation opens.
On the Image output page, select the following options and click :
From the Release list, select the release that you want to use.
ImportantThe image builder builds the latest minor version of the selected release.
- From the Architecture list, select the architecture that you want to use.
- From the Select target environments option, select the environments that you want to use.
On the Optional steps page, you can further configure your image with additional customizations. For a complete list, see Optional blueprint customizations.
To finish creating your image blueprint, click to proceed to the Review step.
- 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 .
On the Review page, verify the image details about the image creation and from the Create blueprint drop-down menu, select one of the following options:
- Create blueprint
- Create the blueprint and save the customizations for your blueprint.
- Create blueprint and build image(s)
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.
Lightspeed 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.
3.2. Optional blueprint customizations Copiar o linkLink copiado para a área de transferência!
To optimize runtime configuration of your image, you can customize and pre-configure your blueprint with optional settings.
For example, you can customize the following settings:
- Automatically register your system.
- Apply your custom compliance policies.
- Configure the file system and partitioning.
- Pre-install additional packages from your custom repositories.
- Add your custom action script for the initial boot of the image.
The additional customizations help you to create your ready to deploy images with all the settings already in place.
| Customization | Options |
|---|---|
| Register |
|
| Security |
|
| File system configuration |
|
| Repeatable build |
|
| Custom repositories | Select the custom repository to add it to your image. |
| Additional packages | Search and select additional packages to pre-install them to your image. |
| Users | In the Username field add a user, and optionally, assign a password, SSH key, groups, and an Admin role to this user. To add more users, click and provide information for those users. |
| Timezone |
|
| Locale |
|
| Hostname | Select a custom host name for your image in the Hostname field. |
| Kernel |
|
| Firewall |
|
| Systemd services |
|
| Ansible Automation Platform |
|
| First boot configuration | Add your custom script that is executed during the first boot of the image. It is useful when you want to enable your custom services or run an Ansible playbook at the boot time of the image.
You must start your script with a shebang, for example the |
3.3. Insights compliance integration in Insights image builder Copiar o linkLink copiado para a área de transferência!
With Insights image builder, you can select base profiles. Each profile comes with a predetermined set of rules that are applied to the image. You cannot change the base profile rules.
You can tailor the compliance policies by creating a policy and decide which rules to apply to your image. When you select a compliance policy, Insights Image Builder adds information about the packages and services that are included and enabled to meet the policy requirements.
When you apply a compliance policy in Image Builder, the tool automatically selects and enables the specific packages and system services required to meet that compliance policy.
To apply a compliance policy, your system must already be online and registered with a RHEL subscription with a compliance policy to be able to create compliance policies.
Insights Images always builds for the latest minor version of an operating system, but compliance policies are version-specific, leading to issues if a policy does not have a definition for the latest minor version.
3.4. Creating and applying a compliance policy to a custom image Copiar o linkLink copiado para a área de transferência!
Build a custom image that includes a predefined OpenSCAP compliance policy by using Insights image builder.
Prerequisites
- You have a RHEL subscription.
- You must have a system online and registered to be able to create compliance policies.
Procedure
Create a compliance policy:
-
Access Hybrid Cloud Console Insights, and navigate to Security
Compliance SCAP Policies. - Create the new compliance policy based on the systems you have registered. For more details, see Creating new compliance policies.
- Optional: Select or deselect rules, based on your requirements.
-
Access Hybrid Cloud Console Insights, and navigate to Security
Create a blueprint in the Hybrid Cloud Console Insights by following the Creating a blueprint procedure.
- On the Compliance step you can choose either from an Insights Compliance Policy or OpenSCAP profiles. If you have no Insights compliance policies defined, you are prompted for the OpenSCAP profiles by default.
To apply the Compliance Policy that you created, navigate to the Content section and select OpenSCAP compliance.
From the dropdown menu, select the policy you created.
Insights image builder automatically adds required packages and enables services in the blueprint configuration.
- Complete the steps for any optional customizations for your image. See Optional blueprint customizations.
- Review the blueprint details and start to build your image.
Troubleshooting
Fixing a failing build related to a version mismatch:
You might encounter a warning message that the build has failed because a definition for the OS minor version could not be found in the compliance policy. This happens because the selected compliance policy was created for an older OS minor version, for example,
RHEL-9.4and lacks support for the latest minor version, for example,RHEL-9.6that Image Builder is trying to build.To work around this issue, follow the steps:
- Ensure that your registered system is running the exact latest minor version of the target system.
- Access the Compliance service and edit the policy that you want to use.
- Update the Compliance policy by attaching your running system.
Fixing errors related to blueprint:
If you remove packages marked as required by OpenSCAP, an error pop-up appears with a "fix errors automatically" button that re-adds those packages.
- Click the button to update the blueprint.
3.5. Editing an existing blueprint Copiar o linkLink copiado para a área de transferência!
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
-
Access the Hybrid Cloud Console, and navigate to
. The Lightspeed Images dashboard appears. For details on how to access the Red Hat Hybrid Cloud Console, see Getting started with the Red Hat Hybrid Cloud Console. - Search for the blueprint that you want to edit. You can use the Search field to search for the blueprint name.
- Click the blueprint that you want to edit.
- Click . You are redirected to the Review page.
- From the navigation menu, select the section that you want to edit.
- After making the changes, click the Review page.
Click .
The images related to the parent blueprint that you modified will be rebuilt and updated with the new changes.
3.6. Rebuilding an existing blueprint Copiar o linkLink copiado para a área de transferência!
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
-
Access the Hybrid Cloud Console, and navigate to
. The Lightspeed Images dashboard appears. For details on how to access the Red Hat Hybrid Cloud Console, see Getting started with the Red Hat Hybrid Cloud Console. - Search for the blueprint that you want to edit. You can use the Search field to search for the blueprint name.
- Click the blueprint that you want to edit.
- Click . You are redirected to the Review page.
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.
3.7. Importing a blueprint Copiar o linkLink copiado para a área de transferência!
You can import a blueprint from an external source to the Hybrid Cloud Console.
The Import feature is only available in the Preview mode.
Prerequisites
- You have created a blueprint in the JSON format.
Procedure
-
Access the Hybrid Cloud Console, and navigate to
. The Lightspeed Images dashboard appears. For details on how to access the Red Hat Hybrid Cloud Console, see Getting started with the Red Hat Hybrid Cloud Console. - Click . The Import pipeline window opens.
Optional: To add custom repositories from the blueprint to your repositories, select the Import missing custom repositories after file upload checkbox.
WarningIf the blueprint contains missing repositories, the images that you create from this blueprint might not work as expected.
- Upload the blueprint that you want to import either drag and drop or by selecting the file from your local storage.
- Click .
3.8. Downloading a blueprint Copiar o linkLink copiado para a área de transferência!
You can export a blueprint that you created in the Hybrid Cloud Console by downloading it in the JSON format.
The ability to download a blueprint is only available in the "Preview" mode.
Prerequisites
- You have created a blueprint.
Procedure
-
Access the Hybrid Cloud Console, and navigate to
. The Lightspeed Images dashboard appears. For details on how to access the Red Hat Hybrid Cloud Console, see Getting started with the Red Hat Hybrid Cloud Console. - Search for the blueprint that you want to download. You can use the Search field to search for the blueprint name.
- Click the blueprint that you want to download.
From the More options menu, select the "Download blueprint" option.
The blueprint is saved as a file in the
.jsonformat to the local storage that you define in your web browser.
3.9. Deleting a blueprint Copiar o linkLink copiado para a área de transferência!
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
-
Access the Hybrid Cloud Console, and navigate to
. The Lightspeed Images dashboard appears. For details on how to access the Red Hat Hybrid Cloud Console, see Getting started with the Red Hat Hybrid Cloud Console. - Search for the blueprint that you want to delete. You can use the Search field to search for the blueprint name.
- Click the blueprint that you want to delete.
- From the More options menu, select the "Delete blueprint" option.
- Confirm the deletion by clicking .