Chapter 5. Installing RHEL AI on Microsoft Azure
There are two ways you can install and deploy Red Hat Enterprise Linux AI on Microsoft Azure:
- You can purchase RHEL AI from the Azure marketplace.
- You can download the RHEL AI VHD file from the Download Red Hat Enterprise Linux AI page and convert it to an Azure image.
5.1. Converting the RHEL AI VHD image into a Azure image Copy linkLink copied to clipboard!
To create a bootable image on Azure you must configure your Azure account, create an Azure storage container, and create an Azure image from the RHEL AI VHD image.
Prerequisites
-
You have installed the
azCLI. See Azure Command-Line Interface (CLI) documentation. - You have installed AzCopy. See Get started with AzCopy.
Procedure
Log in to Azure by running the following command:
az login
$ az loginCopy to Clipboard Copied! Toggle word wrap Toggle overflow Log in with the
azcopytool:keyctl new_session
$ keyctl new_sessionCopy to Clipboard Copied! Toggle word wrap Toggle overflow azcopy login
$ azcopy loginCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure various Azure environment variables and create your Azure storage container.
Create an environment variable defining the location of your instance with the following command:
AZ_LOCATION=eastus
$ AZ_LOCATION=eastusCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
AZ_RESOURCE_GROUPenvironment variable. For example:AZ_RESOURCE_GROUP=Default az group create --name ${AZ_RESOURCE_GROUP} --location ${AZ_LOCATION}$ AZ_RESOURCE_GROUP=Default $ az group create --name ${AZ_RESOURCE_GROUP} --location ${AZ_LOCATION}Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the Azure storage account:
AZ_STORAGE_ACCOUNT=<YOUR_STORAGE_ACCOUNT_NAME>
$ AZ_STORAGE_ACCOUNT=<YOUR_STORAGE_ACCOUNT_NAME>Copy to Clipboard Copied! Toggle word wrap Toggle overflow az storage account create \ --name ${AZ_STORAGE_ACCOUNT} \ --resource-group ${AZ_RESOURCE_GROUP} \ --location ${AZ_LOCATION} \ --sku Standard_LRS$ az storage account create \ --name ${AZ_STORAGE_ACCOUNT} \ --resource-group ${AZ_RESOURCE_GROUP} \ --location ${AZ_LOCATION} \ --sku Standard_LRSCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the Azure storage container. Run the following commands:
AZ_STORAGE_CONTAINER=<BUCKET_NAME>
$ AZ_STORAGE_CONTAINER=<BUCKET_NAME>Copy to Clipboard Copied! Toggle word wrap Toggle overflow az storage container create \ --name ${AZ_STORAGE_CONTAINER} \ --account-name ${AZ_STORAGE_ACCOUNT} \ --public-access off$ az storage container create \ --name ${AZ_STORAGE_CONTAINER} \ --account-name ${AZ_STORAGE_ACCOUNT} \ --public-access offCopy to Clipboard Copied! Toggle word wrap Toggle overflow Get the Subscription ID from the Azure account list by running the following command:
az account list --output table
$ az account list --output tableCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
AZ_SUBSCRIPTION_IDvariable. For example:AZ_SUBSCRIPTION_ID=46c08fb3-83c5-4b59-8372-bf9caf15a681
$ AZ_SUBSCRIPTION_ID=46c08fb3-83c5-4b59-8372-bf9caf15a681Copy to Clipboard Copied! Toggle word wrap Toggle overflow Grant
azcopywrite permission to user into the storage container. For example:az role assignment create \ --assignee user@example.com \ --role "Storage Blob Data Contributor" \ --scope /subscriptions/${AZ_SUBSCRIPTION_ID}/resourceGroups/${AZ_RESOURCE_GROUP}/providers/Microsoft.Storage/storageAccounts/${AZ_STORAGE_ACCOUNT}/blobServices/default/containers/${AZ_STORAGE_CONTAINER}$ az role assignment create \ --assignee user@example.com \ --role "Storage Blob Data Contributor" \ --scope /subscriptions/${AZ_SUBSCRIPTION_ID}/resourceGroups/${AZ_RESOURCE_GROUP}/providers/Microsoft.Storage/storageAccounts/${AZ_STORAGE_ACCOUNT}/blobServices/default/containers/${AZ_STORAGE_CONTAINER}Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- Download the Azure VHD image from Download Red Hat Enterprise Linux AI page.
Unzip the
vhd.gzfile with the following command:gunzip <DOWNLOADED_AZURE_GZ_IMAGE>
$ gunzip <DOWNLOADED_AZURE_GZ_IMAGE>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the Azure image name:
IMAGE_NAME=rhel-ai-azure
$ IMAGE_NAME=rhel-ai-azureCopy to Clipboard Copied! Toggle word wrap Toggle overflow Upload the VHD file to the Azure storage container by running the following command:
AZ_VHD_URL="https://${AZ_STORAGE_ACCOUNT}.blob.core.windows.net/${AZ_STORAGE_CONTAINER}/$(basename ${vhd_file})" azcopy copy "$vhd_file" "$AZ_VHD_URL"$ AZ_VHD_URL="https://${AZ_STORAGE_ACCOUNT}.blob.core.windows.net/${AZ_STORAGE_CONTAINER}/$(basename ${vhd_file})" $ azcopy copy "$vhd_file" "$AZ_VHD_URL"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create an Azure image from the uploaded VHD file. Run the following command:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
5.2. Deploying the RHEL AI instance on Azure by using the az CLI Copy linkLink copied to clipboard!
You can launch the Red Hat Enterprise Linux AI instance by using the RHEL AI image from the Azure web console or by using the az CLI.
The following procedure describes how to use the az CLI to launch the RHEL AI instance with the downloaded image.
Prerequisites
- You have created the RHEL AI Azure image.
-
You have installed the
azCLI. See Azure Command-Line Interface (CLI) documentation.
Procedure
Log in to your Azure account:
az login
$ az loginCopy to Clipboard Copied! Toggle word wrap Toggle overflow Select the instance profile that you want to use for the deployment. List all the profiles in the required region by running the following command:
az vm list-sizes --location <REGION> --output table
$ az vm list-sizes --location <REGION> --output tableCopy to Clipboard Copied! Toggle word wrap Toggle overflow Creating the Azure instance.#
Configure environment variables for the instance.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Launch the RHEL AI instance by running the following command:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow