But there is not the image of Red Hat Enterprise Linux in Azure Staack Marketplace at this moment. So Azure Stack Operator needs to create the custom image of Red Hat Enterprise Linux and need to add this image to Azure Stack Marketplace.
Microsoft publishes the following document to add the custom image of Red Hat Enterprise Linux. But this procedure is so hard because this procedure requires us many manual operations.
So we tested another approach. It’s the way to use Azure Image Builder. This entry explains how to add Red Hat Enterprise Linux to Azure Stack with Azure Image Builder. I think that to use Azure Image Builder is better than manual operation. Because I trust the image which is running on Azure better than the image which I created manually.
I used a PAYG image. Because when I used a BYOL image, the following error raised.
Deployment failed. Correlation ID: 7f91b6c7-0eaa-45bb-af79-fe147844c3ae. Build (Azure PIR Image) step failed: VM Image (Location: westus2, Publisher: RedHat, Offer: rhel-byos, Sku: rhel-raw76, Version: 7.6.20190307) has a Purchase Plan in place
The tasks for Azure Stack
Put VHD file in the storage account of Azure Stack
At first, put the VHD file which was created by Azure Image Builder into the Storage Account of Azure Stack. You need to configure the access level of the container which you input VHD file to as “Blob” and VHD file as “Page blob”.
Import VHD file as an image
Second, in “Dashboard > Compute - VM images > Add a VM image” on Admin Portal, import VHD file in the storage account as the image of Azure Stack.
When the import completes, you can confirm the information of this image with “Get-AzureRmVMImage”.
The Virtual Machine which you created is Red Hat Enterprise Linux. But you can’t execute yum because the valid subscription doesn’t attach with this Red Hat Enterprise Linux. You need to change the configuration of Red Hat Enterprise Linux to run yum correctly on Azure Stack.
Enable a subscription
You need to prepare a valid subscription for this Red Hat Enterprise Linux and attach this subscription to this Red Hat Enterprise Linux. The detailed information is as follows.
[rhui-rhel-8-for-x86_64-baseos-rhui-rpms]name=Red Hat Enterprise Linux 8for x86_64 - BaseOS from RHUI (RPMs)baseurl=https://rhui-1.microsoft.com/pulp/repos/content/dist/rhel8/rhui/$releasever/x86_64/baseos/os
Red Hat Enterprise Linux on Azure Stack can’t access to this RHUI because only the public IP Address on Azure can access to this RHUI. So you need to change the settings about yum to not access to RHUI. For example, Removing /etc/yum.repos.d/rh-cloud.repo or converting enabled=1 to enabled=0 in /etc/yum.repos.d/rh-cloud.repo.
Update Azure Linux Agent
The version of Azure Linux Agent in this image is 220.127.116.11.
[root@rhel8-2 aimless]# waagent -version
WALinuxAgent-18.104.22.168 running on redhat 8.0
Goal state agent: 2.2.38
Unfortunately, Azure Stack doesn’t support this version. Azure Stack supports 2.2.35 (or later).
After having updated the agent, the new agent needs the python which is running on the user side although old agent doesn’t need the python which is running. I think that my operation was wrong. So I will open SR to Microsoft when I try this operation in production.
The way to add Red Hat Enterprise Linux to Azure Stack with Azure Image Builder may is better than creating an image from ISO. Because the tasks are more little. But I worry about the configuration for an operating system. I’m happy if Microsoft officially publishes the way to add Red Hat Enterprise Linux to Azure Stack with Azure Image Builder.