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 loginWhen 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-serviceSet the preferred resource group, for example:
$ ibmcloud target -g DefaultSet the preferred region, for example:
$ ibmcloud target -r us-eastSelect 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'Set the
COS_DEPLOY_PLANenvironment variable with the required deployment plan, for example:$ COS_DEPLOY_PLAN=premium-global-deploymentCreate a COS service instance. Run the following commands:
$ COS_SI_NAME=<YOUR_SERVICE_INSTANCE>$ ibmcloud resource service-instance-create ${COS_SI_NAME} cloud-object-storage standard global -d ${COS_DEPLOY_PLAN}
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')$ ibmcloud cos config crn --crn ${COS_CRN} --forceCreate the COS bucket:
$ COS_BUCKET=<YOUR_BUCKET_NAME>$ ibmcloud cos bucket-create --bucket ${COS_BUCKET}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')$ ibmcloud iam authorization-policy-create is cloud-object-storage Reader --source-resource-type image --target-service-instance-id ${COS_SI_GUID}
- 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>Set the name you want to use as the RHEL AI IBM Cloud image. Run the following command:
$ IMAGE_NAME=rhel-ai-3-2025v0Upload 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>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')
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; doneView information about the newly created image:
$ ibmcloud is image ${IMAGE_ID}
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>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-serviceCreate an SSH public key for your IBM Cloud account. IBM Cloud supports RSA and ed25519 keys.
$ ssh-keygen -f ibmcloud -t ed25519Upload the public key to your IBM Cloud account.
$ ibmcloud is key-create <YOUR_IBMCLOUD_SSH_PUB_KEY> --key-type ed25519Create a floating IP for the IBM Cloud instance:
$ ibmcloud is floating-ip-reserve my-public-ip --zone <PREFERRED_REGION>
Select the instance profile that you want to use for the deployment. List all the profiles by running the following command:
$ ibmcloud is instance-profilesMake a note of your preferred instance profile.
Create environment variables for the IBM Cloud instance, for example:
NAME=<INSTANCE_NAME> VPC=<YOUR_VPC> ZONE=<YOUR_IBM_CLOUD_ZONE> SUBNET=<ZONE_SUBNET> INSTANCE_PROFILE=<YOUR_CLOUD_INSTANCE_PROFILE> IMAGE=<YOUR_IBM_CLOUD_RHELAI_IMAGE> SSHKEY=<YOUR_IBMCLOUD_SSH_PUB_KEY> FLOATING_IP=<PUBLIC_IP> DISK_SIZE=250You can now launch your instance, by running the following command:
$ ibmcloud is instance-create \ $NAME \ $VPC \ $ZONE \ $INSTANCE_PROFILE \ $SUBNET \ --image $IMAGE \ --keys $SSHKEY \ --boot-volume '{"name": "'${NAME}'-boot", "volume": {"name": "'${NAME}'-boot", "capacity": '${DISK_SIZE}', "profile": {"name": "general-purpose"}}}' \ --allow-ip-spoofing falseLink the Floating IP to the instance by running the following command:
$ ibmcloud is floating-ip-update $FLOATING_IP --nic primary --in $NAME
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-instanceCreate the
DATA_VOLUME_SIZEvariable:$ DATA_VOLUME_SIZE=1000Create 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}Review the disks attached to the instance:
$ lsblkCreate a
DISKvariable for the newly provisioned disk path, for example:$ DISK=/dev/vdbCreate a partition on the disk by running the following command:
$ sgdisk -n 1:0:0 $DISKFormat and label the partition:
$ mkfs.xfs -L rhelai-data ${DISK}1Optional: 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/fstabReload the
systemdservice:$ systemctl daemon-reloadMount the disk:
$ mount -aGrant write permissions to all users in the new file system by running the following command:
$ chmod 1777 /mnt/