Chapter 3. Installing RHEL AI on IBM Cloud
Before you can deploy Red Hat Enterprise Linux AI on IBM Cloud, you must first convert the RHEL AI image into an IBM Cloud image.
3.1. Converting the RHEL AI QCOW2 image to an IBM Cloud image Copy linkLink copied to clipboard!
To create a bootable image in IBM Cloud you must configure your IBM Cloud accounts, set up a Cloud Object Storage (COS) bucket, and create an IBM Cloud image based on the RHEL AI image.
Prerequisites
- You have installed the IBM Cloud CLI. See Installing from the shell.
Procedure
Log in to IBM Cloud. Run the following command:
ibmcloud login
$ ibmcloud loginCopy to Clipboard Copied! Toggle word wrap Toggle overflow When prompted, select the account to log in to.
Set up various required IBM Cloud configurations, create the COS bucket, and then generate the required QCOW2 image.
Install the required IBM Cloud plugins by running the following command:
ibmcloud plugin install cloud-object-storage infrastructure-service
$ ibmcloud plugin install cloud-object-storage infrastructure-serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Set the preferred resource group, for example:
ibmcloud target -g Default
$ ibmcloud target -g DefaultCopy to Clipboard Copied! Toggle word wrap Toggle overflow Set the preferred region, for example:
ibmcloud target -r us-east
$ ibmcloud target -r us-eastCopy to Clipboard Copied! Toggle word wrap Toggle overflow Select a deployment plan for the service instance.
You can list the available deployment plans by running the following command:
ibmcloud catalog service cloud-object-storage --output json | jq -r '.[].children[] | select(.children != null) | .children[].name'
$ ibmcloud catalog service cloud-object-storage --output json | jq -r '.[].children[] | select(.children != null) | .children[].name'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the
COS_DEPLOY_PLANenvironment variable with the required deployment plan, for example:COS_DEPLOY_PLAN=premium-global-deployment
$ COS_DEPLOY_PLAN=premium-global-deploymentCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a COS service instance. Run the following commands:
COS_SI_NAME=<YOUR_SERVICE_INSTANCE>
$ COS_SI_NAME=<YOUR_SERVICE_INSTANCE>Copy to Clipboard Copied! Toggle word wrap Toggle overflow ibmcloud resource service-instance-create ${COS_SI_NAME} cloud-object-storage standard global -d ${COS_DEPLOY_PLAN}$ ibmcloud resource service-instance-create ${COS_SI_NAME} cloud-object-storage standard global -d ${COS_DEPLOY_PLAN}Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Create the Cloud Resource Name (CRN)
COS_CRNvariable and create the resource. Run the following commands:COS_CRN=$(ibmcloud resource service-instance ${COS_SI_NAME} --output json| jq -r '.[] | select(.crn | contains("cloud-object-storage")) | .crn')$ COS_CRN=$(ibmcloud resource service-instance ${COS_SI_NAME} --output json| jq -r '.[] | select(.crn | contains("cloud-object-storage")) | .crn')Copy to Clipboard Copied! Toggle word wrap Toggle overflow ibmcloud cos config crn --crn ${COS_CRN} --force$ ibmcloud cos config crn --crn ${COS_CRN} --forceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the COS bucket:
COS_BUCKET=<YOUR_BUCKET_NAME>
$ COS_BUCKET=<YOUR_BUCKET_NAME>Copy to Clipboard Copied! Toggle word wrap Toggle overflow ibmcloud cos bucket-create --bucket ${COS_BUCKET}$ ibmcloud cos bucket-create --bucket ${COS_BUCKET}Copy to Clipboard Copied! Toggle word wrap Toggle overflow Allow the infrastructure service to read the buckets that are in the service instance
${COS_SI_GUID}variable by running the following commands:COS_SI_GUID=$(ibmcloud resource service-instance ${COS_SI_NAME} --output json| jq -r '.[] | select(.crn | contains("cloud-object-storage")) | .guid')$ COS_SI_GUID=$(ibmcloud resource service-instance ${COS_SI_NAME} --output json| jq -r '.[] | select(.crn | contains("cloud-object-storage")) | .guid')Copy to Clipboard Copied! Toggle word wrap Toggle overflow ibmcloud iam authorization-policy-create is cloud-object-storage Reader --source-resource-type image --target-service-instance-id ${COS_SI_GUID}$ ibmcloud iam authorization-policy-create is cloud-object-storage Reader --source-resource-type image --target-service-instance-id ${COS_SI_GUID}Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- Copy the QCOW2 image URL from the Download Red Hat Enterprise Linux AI page.
Download the QCOW2 image:
curl -Lo disk.qcow2 <QCOW2_IMAGE_URL>
$ curl -Lo disk.qcow2 <QCOW2_IMAGE_URL>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the name you want to use as the RHEL AI IBM Cloud image. Run the following command:
IMAGE_NAME=rhel-ai-3-2025v0
$ IMAGE_NAME=rhel-ai-3-2025v0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Upload the QCOW2 image to the COS bucket with your selected region:
ibmcloud cos upload --bucket ${COS_BUCKET} --key ${IMAGE_NAME}.qcow2 --file disk.qcow2 --region <REGION>$ ibmcloud cos upload --bucket ${COS_BUCKET} --key ${IMAGE_NAME}.qcow2 --file disk.qcow2 --region <REGION>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Convert the QCOW2 image that you just uploaded to an IBM Cloud image and set the IBM Cloud image configuration
IMAGE_IDvariable:IMAGE_ID=$(ibmcloud is image-create ${IMAGE_NAME} --file cos://<REGION>/${COS_BUCKET}/${IMAGE_NAME}.qcow2 --os-name red-ai-9-amd64-nvidia-byol --output json | jq -r '.id')$ IMAGE_ID=$(ibmcloud is image-create ${IMAGE_NAME} --file cos://<REGION>/${COS_BUCKET}/${IMAGE_NAME}.qcow2 --os-name red-ai-9-amd64-nvidia-byol --output json | jq -r '.id')Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
View the progress of the job by running the following command:
while ibmcloud is image --output json ${IMAGE_ID} | jq -r .status | grep -xq pending; do sleep 1; done$ while ibmcloud is image --output json ${IMAGE_ID} | jq -r .status | grep -xq pending; do sleep 1; doneCopy to Clipboard Copied! Toggle word wrap Toggle overflow View information about the newly created image:
ibmcloud is image ${IMAGE_ID}$ ibmcloud is image ${IMAGE_ID}Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2. Deploying on IBM Cloud using the CLI Copy linkLink copied to clipboard!
You can launch a Red Hat Enterprise Linux AI instance image from the IBM Cloud web console or the CLI. You can use whichever method of deployment you want to launch your instance. The following procedure describes using the IBM Cloud CLI to launch an RHEL AI instance.
Prerequisites
- You have created the RHEL AI IBM Cloud image.
- You have installed the IBM Cloud CLI. See Installing from the shell.
- You have configured a Virtual Private Cloud (VPC). See Creating and configuring a VPC.
- You have created a subnet for the RHEL AI instance. See Creating a subnet in VPC
Procedure
Log in to your IBM Cloud account, selecting the Account, Region and Resource Group by running the following command:
ibmcloud login -c <ACCOUNT_ID> -r <REGION> -g <RESOURCE_GROUP>
$ ibmcloud login -c <ACCOUNT_ID> -r <REGION> -g <RESOURCE_GROUP>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Before launching the IBM Cloud instance, you need to create several configuration variables.
Install the
infrastructure-serviceplugin for IBM Cloud by running the following command:ibmcloud plugin install infrastructure-service
$ ibmcloud plugin install infrastructure-serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create an SSH public key for your IBM Cloud account. IBM Cloud supports RSA and ed25519 keys.
ssh-keygen -f ibmcloud -t ed25519
$ ssh-keygen -f ibmcloud -t ed25519Copy to Clipboard Copied! Toggle word wrap Toggle overflow Upload the public key to your IBM Cloud account.
ibmcloud is key-create <YOUR_IBMCLOUD_SSH_PUB_KEY> --key-type ed25519
$ ibmcloud is key-create <YOUR_IBMCLOUD_SSH_PUB_KEY> --key-type ed25519Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a floating IP for the IBM Cloud instance:
ibmcloud is floating-ip-reserve my-public-ip --zone <PREFERRED_REGION>
$ ibmcloud is floating-ip-reserve my-public-ip --zone <PREFERRED_REGION>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Select the instance profile that you want to use for the deployment. List all the profiles by running the following command:
ibmcloud is instance-profiles
$ ibmcloud is instance-profilesCopy to Clipboard Copied! Toggle word wrap Toggle overflow Make a note of your preferred instance profile.
Create environment variables for the IBM Cloud instance, for example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can now launch your instance, by running the following command:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Link the Floating IP to the instance by running the following command:
ibmcloud is floating-ip-update $FLOATING_IP --nic primary --in $NAME
$ ibmcloud is floating-ip-update $FLOATING_IP --nic primary --in $NAMECopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.3. Adding more storage to the IBM Cloud instance Copy linkLink copied to clipboard!
In IBM Cloud, there is a size restriction of 250 GB of storage in the main IBM Cloud disk. You might require more disk space for model storage. You can add more storage by attaching an extra disk to your instance.
Prerequisites
- You have installed the IBM Cloud CLI. See Installing from the shell.
- You have deployed a RHEL AI instance in IBM Cloud.
Procedure
Create the
NAMEenvironment variable:NAME=rhelai-instance
$ NAME=rhelai-instanceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
DATA_VOLUME_SIZEvariable:DATA_VOLUME_SIZE=1000
$ DATA_VOLUME_SIZE=1000Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the volume and attach it the instance by running the following command:
ibmcloud is instance-volume-attachment-add data ${NAME} \ --new-volume-name ${NAME}-data \ --profile general-purpose \ --capacity ${DATA_VOLUME_SIZE}$ ibmcloud is instance-volume-attachment-add data ${NAME} \ --new-volume-name ${NAME}-data \ --profile general-purpose \ --capacity ${DATA_VOLUME_SIZE}Copy to Clipboard Copied! Toggle word wrap Toggle overflow Review the disks attached to the instance:
lsblk
$ lsblkCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
DISKvariable for the newly provisioned disk path, for example:DISK=/dev/vdb
$ DISK=/dev/vdbCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a partition on the disk by running the following command:
sgdisk -n 1:0:0 $DISK
$ sgdisk -n 1:0:0 $DISKCopy to Clipboard Copied! Toggle word wrap Toggle overflow Format and label the partition:
mkfs.xfs -L rhelai-data ${DISK}1$ mkfs.xfs -L rhelai-data ${DISK}1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Configure the system to auto-mount to the directory. To mount the disk to the
/mntfolder, run the following command:echo LABEL=rhelai-data /mnt xfs defaults 0 0 >> /etc/fstab
$ echo LABEL=rhelai-data /mnt xfs defaults 0 0 >> /etc/fstabCopy to Clipboard Copied! Toggle word wrap Toggle overflow Reload the
systemdservice:systemctl daemon-reload
$ systemctl daemon-reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow Mount the disk:
mount -a
$ mount -aCopy to Clipboard Copied! Toggle word wrap Toggle overflow Grant write permissions to all users in the new file system by running the following command:
chmod 1777 /mnt/
$ chmod 1777 /mnt/Copy to Clipboard Copied! Toggle word wrap Toggle overflow