Chapter 6. Creating and uploading a customized RHEL system image to Microsoft Azure using Red Hat Image Builder
The ability to create customized RHEL system images using Red Hat Image Builder and upload those images to the Microsoft Azure cloud target environment is available.
6.2. Creating a customized RHEL system image for Microsoft Azure using Image Builder
Follow the steps in this procedure to create customized system images using Image Builder and upload those images to Microsoft Azure.
- You have created a Azure Storage Account.
- You have a Storage account created.
Access Red Hat Image Builder on the browser of your choice.
You are redirected to the Red Hat Image Builder dashboard.
- Click .
In the Image output window:
- From the dropdown menu, select the Release: Red Hat Enterprise Linux (RHEL) 8.3.
Microsoft Azureas the Target environment.
In the Target Environment - Upload to Microsoft Azure window:
Click Authorize Image Builder on Azure to authorize Red Hat Image Builder to push images to the Microsoft Azure cloud. See Section 6.1, “Authorizing Red Hat Image Builder to push images to Microsoft Azure Cloud” for details.Note
Ensure you completed the steps from the previous section, otherwise Red Hat Image Builder will not be able to upload an image into your Microsoft Azure account.
Under Destination, enter the following details:
- Tenant ID: you can find your Tenant ID in the Azure Active Directory application in Microsoft Azure Portal.
- Subscription ID: you can find your Subscription ID account by accessing the Microsoft Azure console.
Resource Group: is the name of your Resource Group in Microsoft Azure Portal.
In the Registration window, you have the option to:
- Embed an activation key and register systems on first boot. For details on how to embed an activation key and register systems on first boot, see Chapter 3, Creating a customized system image with an embed subscription using Red Hat Image Builder.
Select the option Register the system later to register the system after the image creation.
- Optional: In the Additional package window, add packages to your image. See Chapter 4, Adding packages during image creation by Using Red Hat Image Builder.
In the Review window, review the details about the image creation and click Create.
Red Hat Image Builder starts the compose of a RHEL 8.3 Azure Disk Image image for the x86_64 architecture, uploads it to the resource group account you specified, and creates an Azure Image.
The Red Hat 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. Once the status is Ready, the Azure Disk Image is shared with the specified account.
- 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.
- Check if the image status is Ready. It means that the image upload and cloud registration is completed successfully.
6.3. Accessing your customized RHEL system image from your Microsoft Azure account
After the image is built, uploaded and the cloud registration process status is marked as Ready, you can access the Azure Disk Image from your Microsoft Azure account.
- You have access to your Microsoft Azure dashboard.
- Access your Microsoft Azure dashboard and navigate to the Resource group page.
- On the overview menu, you can see the image you uploaded is available.
Once you access your Microsoft Azure Account, you should be able to see the image successfully shared with the resource group account you specified.
- If the image is not visible there, you may have issues with the upload process. Return to the Red Hat Image Builder dashboard and check if the image is marked as Ready.
6.4. Creating a Virtual Machine from the customized RHEL system image you shared with the Microsoft Azure account
This section describes steps to create a Virtual Machine (VM) from the image you shared with the Microsoft Azure Cloud account by using Red Hat Image Builder.
- You must have a Microsoft AzureStorage Account created.
- You must have uploaded the required image to the Microsoft Azure Cloud account.
- 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:
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
Size: Choose a VM size that better suits your needs.
Keep the remaining fields as in the defaults 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 will receive a confirmation that the validation passed. . You are redirected to the
Review the details and click.
Optionally, you can clickif you want to change the previous options.
A Generates New Key Pair pop-up opens. Click .
Save the key file in the yourKey.pem file format.
Once 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.
To connect to the Virtual Machine you created, create an SSH connection. Now, to create an SSH connection with the VM to connect to the Virtual Machine.
- 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
.pemfile with the path to where the key file was downloaded.
# 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.
# ssh -i ./Downloads/yourKey.pem email@example.com
You are required to confirm if you want to continue to connect. Type
As a result, the output image you shared with the Azure Storage account is started and ready to be provisioned.