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. Warning 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 To authorize Insights image builder to push images to the Microsoft Azure cloud, you must: Configure Insights image builder as an authorized application for your tenant GUID Give it the role of Contributor to at least one resource group. To authorize Insights image builder as an authorized application, follow the steps: 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 and Microsoft.Compute as a resource provider. Procedure Access Insights image builder on a browser. The Insights image builder dashboard appears. Click Create image . The Create image 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 Insights image builder as an authorized application, complete the following steps: Insert your Tenant GUID . Image builder checks if your Tenant GUID is correctly formatted and the Authorize image builder button becomes available. Click Authorize image builder to authorize Insights image builder to push images to the Microsoft Azure cloud. This redirects you to the Microsoft Azure portal. Login with your credentials. Click Accept the Permission requested . Confirm that Insights image builder is authorized for your tenant. Search for Azure Active Directory and choose Enterprise applications , from the left menu. Search for Insights image builder and confirm it is authorized. Add the Enterprise application 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 the Resource Groups dashboard. Select your Resource Group . On the left menu, click Access control (IAM) to add a permission so the Insights image builder application can access your resource group. From the menu, click the tab Role assignments . Click +Add . 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 +Select members and type Red Hat in the search bar. Press enter. Select: Insights image builder application The Insights image builder application is now authorized to push images to Microsoft Azure cloud. Note Even though any user can add an application to the resources group, the application is not able to locate any resource unless 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 Insights image builder set as a Contributor of the Resource Group you selected. Additional resources Manage Microsoft Azure Resource Manager resources group by using the Microsoft Azure portal 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 the x86_64 architecture, uploads it to the resource group account you specified, and creates a Microsoft 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. Note The 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 How to find your Microsoft Azure Active Directory tenant ID 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. Note If 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 VM . You are redirected to the Create a virtual machine dashboard. 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 Create new . A pop-up prompts you to create the Resource Group Name container. Insert a name and click OK . 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 . You are redirected to the Review + create tab. You receive a confirmation that the validation passed. Review the details and click Create . To change options, click . A Generates New Key Pair pop-up opens. Click Download private key and create resources . Save the key file in the yourKey .pem file format. After the deployment is complete, click Go to resource . 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. 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: 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. Note The default user is azureuser and the password is azureuser .

Commands:
ssh -i <yourKey.pem file location> <username>@<IP_address>
ssh -i ./Downloads/yourKey.pem azureuser@10.111.12.123