Chapter 4. Installing RHEL AI on Google Cloud
Before you can deploy Red Hat Enterprise Linux AI on Google Cloud, you must first convert the RHEL AI image into an Google Cloud image.
4.1. Converting the RHEL AI tar file image into a Google Cloud image Copy linkLink copied to clipboard!
To create a bootable image in Google Cloud you must configure your Google Cloud account, create a Google Cloud Storage bucket, and convert the RHEL AI RAW image into a Google Cloud image.
Prerequisites
-
You have installed the
gcloudCLI. See Install the gcloud CLI. - You have a host with RHEL version 9.2+ installed.
- Your host has an additional 100GB of disk space available.
Procedure
Log in to
gcloud. Run the following command:gcloud auth login
$ gcloud auth loginCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure
gcloudand create your Google Cloud storage container.Configure the
gcloudCLI to use your project.GCLOUD_PROJECT=rhelai-gcloud-project
$ GCLOUD_PROJECT=rhelai-gcloud-projectCopy to Clipboard Copied! Toggle word wrap Toggle overflow gcloud config set project $GCLOUD_PROJECT
$ gcloud config set project $GCLOUD_PROJECTCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create an environment variable defining the region where you want to operate. For example:
gcloud_region=us-central1
$ gcloud_region=us-central1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a storage container. Run the following commands:
GCLOUD_BUCKET=<YOUR_BUCKET_NAME>
$ GCLOUD_BUCKET=<YOUR_BUCKET_NAME>Copy to Clipboard Copied! Toggle word wrap Toggle overflow gsutil mb -l $gcloud_region gs://$GCLOUD_BUCKET
$ gsutil mb -l $gcloud_region gs://$GCLOUD_BUCKETCopy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Download the
tar.gzimage from the Download Red Hat Enterprise Linux AI page. Unzip the
tar.gzfile with the following command:gunzip <DOWNLOADED_TAR_GZ_FILE>
$ gunzip <DOWNLOADED_TAR_GZ_FILE>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the
IMAGE_NAMEvariable:IMAGE_NAME=rhel-ai-gcloud
$ IMAGE_NAME=rhel-ai-gcloudCopy to Clipboard Copied! Toggle word wrap Toggle overflow Upload the
tar.gzfile to the Google Cloud Storage Container by running the following command:gsutil cp <DOWNLOADED_TAR_GZ_FILE> "gs://${GCLOUD_BUCKET}/$IMAGE_NAME.tar.gz"$ gsutil cp <DOWNLOADED_TAR_GZ_FILE> "gs://${GCLOUD_BUCKET}/$IMAGE_NAME.tar.gz"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a Google Cloud image from the
tar.gzfile:gcloud compute images create \ "$IMAGE_NAME" \ --source-uri="gs://${GCLOUD_BUCKET}/$IMAGE_NAME.tar.gz" \ --family "rhel-ai" \ --guest-os-features=GVNIC$ gcloud compute images create \ "$IMAGE_NAME" \ --source-uri="gs://${GCLOUD_BUCKET}/$IMAGE_NAME.tar.gz" \ --family "rhel-ai" \ --guest-os-features=GVNICCopy to Clipboard Copied! Toggle word wrap Toggle overflow
4.2. Deploying your instance on Google Cloud using the CLI Copy linkLink copied to clipboard!
You can launch an Google Cloud instance from an uploaded Red Hat Enterprise Linux AI image by using the Google Cloud web console or the CLI. The following procedure describes how to use the gcloud CLI to launch the instance by using the custom image.
Prerequisites
- You have created the RHEL AI image and made it available for installation in Google Cloud.
-
You have installed the
gcloudCLI. See Install the gcloud CLI.
Procedure
Log in to your Google Cloud account by running the following command:
gcloud auth login
$ gcloud auth loginCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Create several
gcloudconfiguration variables for the deployment. 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:
gcloud compute machine-types list --zones=<ZONE>
$ gcloud compute machine-types list --zones=<ZONE>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Make a note of the preferred machine type.
Create Google Cloud instance variables, for example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the zone.
gcloud config set compute/zone $ZONE
$ gcloud config set compute/zone $ZONECopy to Clipboard Copied! Toggle word wrap Toggle overflow Launch the Google Cloud instance:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow