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.
Red Hat Hybrid Cloud Console does not support uploading the images that you created for the Microsoft Azure target environment to GovCloud regions.
7.1. Authorizing Insights image builder to push images to Microsoft Azure Cloud
You must authorize Insights image builder to push images to the Microsoft Azure cloud. This is a one-time action. The following are high-level steps:
- Configure Insights image builder as an authorized application for your tenant GUID
-
Give the role of
Contributor
to at least one resource group of the authorized application .
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
andMicrosoft.Compute
as a resource provider.
Procedure
- Access Hybrid Cloud Console on a browser.
- Click Red Hat Insights > RHEL > Inventory > Images. The Insights image builder dashboard appears.
Click
.The Image output dialog wizard opens.
On the Image output page, complete the following steps:
- From the Release list, select the Release that you want to use: for example, choose Red Hat Enterprise Linux (RHEL).
From the Select target environments option, select
Microsoft Azure
.Click
.
On the Target Environment - Microsoft Azure window, to add Image Builder as an authorized application, select one of the following share method options:
Use an account configured from Sources:
From the Source name dropdown menu, select the source that you previously configured. See Connecting Microsoft Azure account to the Red Hat Hybrid Cloud Console.
The Azure tenant GUID, the Subscription ID, and the Resource group are automatically completed, and the button becomes available.Image builder checks if your Tenant GUID is correctly formatted and the button becomes available.
Manually enter the account information:
Enter your Azure Tenant GUID.
Image builder checks if your Tenant GUID is correctly formatted and the Authorize image builder button becomes available.
One time action: Click Authorize image builder to authorize Image Builder to push images to the Microsoft Azure cloud.
This redirects you to the Microsoft Azure portal.
- Login with your credentials.
- Click Permission requested. Note that, if you already went through the authentication process before, you will not see the . It is already granted. the
Confirm that Image Builder is authorized for your tenant.
- In the search bar, search for Azure Active Directory.
- From the Services menu, click Microsoft Entra ID, from the left menu. The Azure Active Directory page opens.
- Search for Insights image builder and confirm it is authorized.
- In the Azure Active Directory, from the Services list, select Enterprise applications.
- In the Enterprise applications page, from the Manage list menu, click All applications. You can see Red Hat Image Builder is authorized in the Microsoft Azure cloud.
Add the Red Hat Image Builder as a contributor to your
Resource Group
.-
In the search bar, type
Resource Groups
and select the first entry under Services. This redirects you to theResource Groups
dashboard. -
Select your
Resource Group
by name. - On the left menu, click Red Hat Image Builder application can access your resource group. to add a permission so the
- From the menu, click the tab Role assignments.
- Click .
- From the dropdown menu, choose Add role assignment. A menu appears on the left side.
Insert the following details:
- Role
Assign the
Contributor
role.Assign access to: User, group, service principal.
- Add members
- Click Red Hat in the search bar. Click . and type
- Select
- Red Hat Image Builder application.
-
In the search bar, type
The Red Hat Image Builder application is now authorized to push images to the Microsoft Azure cloud.
The Red Hat Image Builder application can locate resources only when 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 Red Hat Image Builder set as a
Contributor
of theResource 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
- You have created a Microsoft Azure Storage Account.
- You have a Storage Account created.
- You authorized image builder to push images to Microsoft Azure. See Authorizing Insights image builder to push images to Microsoft Azure Cloud.
Procedure
On the Target Environment - Microsoft Azure window, complete the following steps:
- Enter your Tenant GUID: you can find your Tenant ID in the Microsoft Azure Active Directory application in Microsoft Azure portal.
- Enter your Subscription ID: you can find your Subscription ID account by accessing the Microsoft Azure console.
Enter your Resource group: is the name of your Resource Group in Microsoft Azure portal.
Click
.
On the Registration page, select the type of registration that you want to use. You can select from these options:
- Register images with Red Hat: Register and connect image instances, subscriptions and insights with Red Hat. For details on how to embed an activation key and register systems on first boot, see Creating a customized system image with an embed subscription by using Insights image builder .
- Register image instances only: Register and connect only image instances and subscriptions with Red Hat.
- Register later: Register the system after the image creation.
- Click .
- Optional: On the Packages page, add packages to your image. See Adding packages during image creation by using Insights image builder.
- On the Name image page, enter a name for your image and click . If you do not enter a name, you can find the image you created by its UUID.
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 thex86_64
architecture, uploads it to the resource group account you specified, and creates aMicrosoft 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.
NoteThe 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.
Additional resources
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
- You have access to your Microsoft Azure dashboard.
Procedure
- Access your Microsoft Azure dashboard and navigate to the Resource group page.
Verification
After you access your Microsoft Azure Account, you can see that the image successfully shared with the resource group account you specified.
NoteIf 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
- You must have a Microsoft Azure Storage Account created.
- You must have uploaded the required image to the Microsoft Azure Cloud account.
Procedure
- Click Create a virtual machine dashboard. . You are redirected to the
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:
Click
.A pop-up prompts you to create the Resource Group Name container.
Insert a name and click
.If you want to keep the Resource Group that is already pre-set.
Under Instance Details, insert:
- Virtual machine name
- Region
- Image
Size: Choose a VM size that better suits your needs.
Keep the remaining fields as in the default choice.
Under Administrator account, enter the following details:
- Username: the name of the account administrator.
- SSH public key source: from the drop-down menu, select Generate new key pair.
- Key pair name: insert a name for the key pair.
Under Inbound port rules:
- Public inbound ports: select Allow selected ports.
- Select inbound ports: Use the default set SSH (22).
- Click Review + create tab. You receive a confirmation that the validation passed. . You are redirected to the
Review the details and click
.To change options, click
.A Generates New Key Pair pop-up opens. Click .
Save the key file in the yourKey.pem file format.
After the deployment is complete, click
.You are redirected to a new window with your VM details.
- 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:
- Open a terminal.
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.Copy to Clipboard Copied! Toggle word wrap Toggle overflow ssh -i <yourKey.pem file location> <username>@<IP_address>
# 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:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ssh -i ./Downloads/yourKey.pem azureuser@10.111.12.123
# ssh -i ./Downloads/yourKey.pem azureuser@10.111.12.123
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.
NoteThe default user is
azureuser
and the password isazureuser
.