Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 4. Installing RHEL AI on IBM cloud
For installing and deploying Red Hat Enterprise Linux AI on IBM Cloud, you must first convert the RHEL AI image into an IBM Cloud image. You can then launch an instance using the IBM Cloud image and deploy RHEL AI on an IBM Cloud machine.
4.1. Converting the RHEL AI image into a IBM Cloud image. Link kopierenLink in die Zwischenablage kopiert!
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 a IBM Cloud image using the RHEL AI image.
Prerequisites
- You installed the IBM CLI on your specific machine. For more information about installing IBM Cloud CLI, see Installing the stand-alone IBM Cloud CLI.
 
Procedure
Log in to IBM Cloud with the following command:
ibmcloud login
$ ibmcloud loginCopy to Clipboard Copied! Toggle word wrap Toggle overflow When prompted, select your desired account to log in to.
Example output of the login
Copy to Clipboard Copied! Toggle word wrap Toggle overflow You need to set up various IBM Cloud configurations and create your COS bucket before generating a QCOW2 image.
You can install the necessary 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 your preferred resource group, the following example command sets the resource group named
Default.ibmcloud target -g Default
$ ibmcloud target -g DefaultCopy to Clipboard Copied! Toggle word wrap Toggle overflow Set your preferred region, the following example command sets the
us-eastregion.ibmcloud target -r us-east
$ ibmcloud target -r us-eastCopy to Clipboard Copied! Toggle word wrap Toggle overflow You need to select a deployment plan for your service instance. Ensure you check the properties and pricing on the IBM cloud website.
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 The following example command uses the
premium-global-deploymentplan and puts it in the environment variablecos_deploy_plan:cos_deploy_plan=premium-global-deployment
$ cos_deploy_plan=premium-global-deploymentCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a Cloud Object Storage (COS) service instance and save the name in an environment variable named
cos_si_nameand create thecloud-object-storageand by running the following commands:cos_si_name=THE_NAME_OF_YOUR_SERVICE_INSTANCE
$ cos_si_name=THE_NAME_OF_YOUR_SERVICE_INSTANCECopy 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 
Get the Cloud Resource Name (CRN) for your Cloud Object Storage (COS) bucket in a variable named
cos_crnby running 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 your Cloud Object Storage (COS) bucket named as the environment variable
bucket_namewith the following commands:bucket_name=NAME_OF_MY_BUCKET
$ bucket_name=NAME_OF_MY_BUCKETCopy to Clipboard Copied! Toggle word wrap Toggle overflow ibmcloud cos bucket-create --bucket ${bucket_name}$ ibmcloud cos bucket-create --bucket ${bucket_name}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 
- Now that your IBM Cloud Object Storage (CoS) service instance bucket is set up, you need to download the QCOW2 image from Red Hat Enterprise Linux AI download page
 Copy the QCOW2 image link and add it to the following command:
curl -Lo disk.qcow2 "PASTE_HERE_THE_LINK_OF_THE_QCOW2_FILE"
$ curl -Lo disk.qcow2 "PASTE_HERE_THE_LINK_OF_THE_QCOW2_FILE"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the name you want to use as the RHEL AI IBM Cloud image
image_name=rhel-ai-20240703v0
$ image_name=rhel-ai-20240703v0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Upload the QCOW2 image to the Cloud Object Storage (COS) bucket with your selected region by running following command:
ibmcloud cos upload --bucket ${bucket_name} --key ${image_name}.qcow2 --file disk.qcow2 --region <region>$ ibmcloud cos upload --bucket ${bucket_name} --key ${image_name}.qcow2 --file disk.qcow2 --region <region>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Convert the QCOW2 you just uploaded to an IBM Cloud image with the following commands:
ibmcloud is image-create ${image_name} --file cos://<region>/${bucket_name}/${image_name}.qcow2 --os-name red-ai-9-amd64-nvidia-byol$ ibmcloud is image-create ${image_name} --file cos://<region>/${bucket_name}/${image_name}.qcow2 --os-name red-ai-9-amd64-nvidia-byolCopy to Clipboard Copied! Toggle word wrap Toggle overflow Once the job launches, set the IBM Cloud image configurations into a variable called
image_idby running the following command:image_id=$(ibmcloud is images --visibility private --output json | jq -r '.[] | select(.name=="'$image_name'") | .id')
$ image_id=$(ibmcloud is images --visibility private --output json | jq -r '.[] | select(.name=="'$image_name'") | .id')Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can view the progress of the job with 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 You can view the information of the newly created image with the following command:
ibmcloud is image ${image_id}$ ibmcloud is image ${image_id}Copy to Clipboard Copied! Toggle word wrap Toggle overflow 
4.2. Deploying your instance on IBM Cloud using the CLI Link kopierenLink in die Zwischenablage kopiert!
You can launch an instance with your new RHEL AI IBM Cloud 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 displays how you can use the CLI to launch an IBM Cloud instance with the custom IBM Cloud image
If you choose to use the CLI as a deployment option, there are several configurations you have to create, as shown in "Prerequisites".
Prerequisites
- You created your RHEL AI IBM Cloud image. For more information, see "Converting the RHEL AI image to an IBM Cloud image".
 - You installed the IBM CLI on your specific machine, see Installing the stand-alone IBM Cloud CLI.
 - You configured your Virtual private cloud (VPC).
 - You created a subnet for your instance.
 
Procedure
Log in to your IBM Cloud account and select 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 your IBM Cloud instance on the CLI, you need to create several configuration variables for your instance.
Install the
infrastructure-serviceplugin for IBM Cloud by running the following commandibmcloud plugin install infrastructure-service
$ ibmcloud plugin install infrastructure-serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow You need to create an SSH public key for your IBM Cloud account. IBM Cloud supports RSA and ed25519 keys. The following example command uses the ed25519 key types and names it
ibmcloud.ssh-keygen -f ibmcloud -t ed25519
$ ssh-keygen -f ibmcloud -t ed25519Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can now upload the public key to your IBM Cloud account by following the example command.
ibmcloud is key-create my-ssh-key @ibmcloud.pub --key-type ed25519
$ ibmcloud is key-create my-ssh-key @ibmcloud.pub --key-type ed25519Copy to Clipboard Copied! Toggle word wrap Toggle overflow You need to create a Floating IP for your IBM Cloud instance by following the example command. Ensure you change the region to your preferred zone.
ibmcloud is floating-ip-reserve my-public-ip --zone <region>
$ ibmcloud is floating-ip-reserve my-public-ip --zone <region>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 
You need to 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, you will need it for your instance deployment.
You can now start creating your IBM Cloud instance. Populate environment variables for when you create the instance.
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 
User account
					The default user account in the RHEL AI AMI is cloud-user. It has all permissions via sudo without password.
				
Verification
To verify that your Red Hat Enterprise Linux AI tools are installed correctly, run the
ilabcommand:ilab
$ ilabCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 
4.3. Adding more storage to your IBM Cloud instance Link kopierenLink in die Zwischenablage kopiert!
In [ibm-c], there is a size restriction of 250 GB of storage in the main IBM Cloud disk. RHEL AI might require more storage for models and generation data.
You can add more storage by attaching an extra disk to your instance and using it to hold data for RHEL AI.
Prerequisites
- You have a IBM Cloud RHEL AI instance.
 
Procedure
Create an environment variable called
namethat has the name of your instance by running the following command:name=my-rhelai-instance
$ name=my-rhelai-instanceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Set the size of the new volume by running the following command:
data_volume_size=1000
$ data_volume_size=1000Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create and attach the instance volume 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 You can list all the disks with the following command:
lsblk
$ lsblkCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
diskvariable with the content of the disk path your using. The following example command uses the/dev/vdbpath.disk=/dev/vdb
$ disk=/dev/vdbCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a partition on your 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 by running the following command:
mkfs.xfs -L ilab-data ${disk}1$ mkfs.xfs -L ilab-data ${disk}1Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can configure your system to auto mount to your preferred directory. The following example command uses the
/mntdirectory.echo LABEL=ilab-data /mnt xfs defaults 0 0 >> /etc/fstab
$ echo LABEL=ilab-data /mnt xfs defaults 0 0 >> /etc/fstabCopy to Clipboard Copied! Toggle word wrap Toggle overflow Reload the
systemdservice to acknowledge the new configuration on mounts by running the following command:systemctl daemon-reload
$ systemctl daemon-reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow Mount the disk with the following command:
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 
Updating Red Hat Enterprise Linux AI
To update to the latest z-stream version of RHEL AI, follow the procedures in the Updating Red Hat Enterprise Linux AI documentation.