Connect from Compute Engine

This guide gives instructions on creating a single Compute Engine client and connecting it to your Google Cloud Managed Lustre instance. Managed Lustre supports connections from up to 4000 clients.

For better performance, client Compute Engine VMs should be created in the same zone as the Managed Lustre instance.

Required permissions

You must have the following IAM role in order to create a Compute Engine VM:

Create a Compute Engine VM

Follow the instructions to create a Compute Engine VM using one of the following images:

  • Rocky Linux 8
  • Ubuntu 20.04 LTS; specifically ubuntu-2004-focal-v20250213.
  • Ubuntu 22.04 LTS; specifically one of:
    • ubuntu-2204-jammy-v20250128
    • ubuntu-2204-jammy-v20250409
    • ubuntu-2204-jammy-v20250415

You can choose any machine type and boot disk. We recommend at least a c2-standard-4 machine type.

Network throughput can be affected by your choice of machine type. In general, to obtain the best throughput:

  • Increase the number of vCPUs. Per-instance maximum egress bandwidth is generally 2 Gbps per vCPU, up to the machine type maximum.
  • Select a machine series that supports higher ingress and egress limits. For example, C2 instances with Tier_1 networking support up to 100Gbps egress bandwidth. C3 instances with Tier_1 networking support up to 200Gbps.
  • Enable per VM Tier_1 networking performance with larger machine types.

For detailed information, refer to Network bandwidth.

Google Cloud console

  1. In the Google Cloud console, go to the VM instances page.

    Go to VM instances

  2. Select your project and click Continue.

  3. Click Create instance.

  4. Enter a name for your VM in Name. For more information, see Resource naming convention.

  5. Select the Region and Zone from the drop-down menus for this VM. Your VM should be in the same zone as your Managed Lustre instance.

  6. Select a Machine configuration for your VM from the list.

  7. Click OS and storage in the left nav.

  8. Under Operating system and storage, click Change.

  9. From the Operating system drop-down, select one of HPC VM image (for Rocky 8) or Ubuntu.

  10. From the Version drop-down, select one of: HPC Rocky Linux 8, Ubuntu 20.04 LTS, or Ubuntu 22.04 LTS. Select either the x86/64 version or the Arm64 version to match your machine type.

    Note the "built on" date; this must match a supported image as listed at the beginning of this section.

  11. To confirm your boot disk options, click Select.

  12. From the left nav, click Networking.

  13. Under Network interfaces, select the VPC network you created in Configure a VPC network.

  14. To create and start the VM, click Create.

gcloud

Use the gcloud command line tool to create a VM:

HPC Rocky Linux 8

gcloud compute instances create VM_NAME \
  --project=PROJECT_ID \
  --zone=LOCATION \
  --machine-type=c2d-standard-112 \
  --network-interface=stack-type=IPV4_ONLY,subnet=NETWORK_NAME,nic-type=GVNIC \
  --network-performance-configs=total-egress-bandwidth-tier=TIER_1 \
  --create-disk=auto-delete=yes,boot=yes,device-name=VM_NAME,\
image=projects/cloud-hpc-image-public/global/images/hpc-rocky-linux-8-v20240126,\
mode=rw,size=100,type=pd-balanced

Ubuntu 20.04 LTS

For image ubuntu-2004-focal-v20250213, use the following command:

gcloud compute instances create VM_NAME \
  --project=PROJECT_ID \
  --zone=LOCATION \
  --machine-type=c2d-standard-112 \
  --network-interface=stack-type=IPV4_ONLY,subnet=NETWORK_NAME,nic-type=GVNIC \
  --network-performance-configs=total-egress-bandwidth-tier=TIER_1 \
  --create-disk=auto-delete=yes,boot=yes,device-name=VM_NAME,\
image=projects/ubuntu-os-cloud/global/images/ubuntu-2004-focal-v20250213,\
mode=rw,size=100,type=pd-balanced

Ubuntu 22.04 LTS

For image ubuntu-2204-jammy-v20250128, use the following command:

gcloud compute instances create VM_NAME \
  --project=PROJECT_ID \
  --zone=LOCATION \
  --machine-type=c2d-standard-112 \
  --network-interface=stack-type=IPV4_ONLY,subnet=NETWORK_NAME,nic-type=GVNIC \
  --network-performance-configs=total-egress-bandwidth-tier=TIER_1 \
  --create-disk=auto-delete=yes,boot=yes,device-name=VM_NAME,\
image=projects/ubuntu-os-cloud/global/images/ubuntu-2204-jammy-v20250128,\
mode=rw,size=100,type=pd-balanced

For image ubuntu-2204-jammy-v20250409, use the following command:

gcloud compute instances create VM_NAME \
  --project=PROJECT_ID \
  --zone=LOCATION \
  --machine-type=c2d-standard-112 \
  --network-interface=stack-type=IPV4_ONLY,subnet=NETWORK_NAME,nic-type=GVNIC \
  --network-performance-configs=total-egress-bandwidth-tier=TIER_1 \
  --create-disk=auto-delete=yes,boot=yes,device-name=VM_NAME,\
image=projects/ubuntu-os-cloud/global/images/ubuntu-2204-jammy-v20250409,\
mode=rw,size=100,type=pd-balanced

For image ubuntu-2204-jammy-v20250415, use the following command:

gcloud compute instances create VM_NAME \
  --project=PROJECT_ID \
  --zone=LOCATION \
  --machine-type=c2d-standard-112 \
  --network-interface=stack-type=IPV4_ONLY,subnet=NETWORK_NAME,nic-type=GVNIC \
  --network-performance-configs=total-egress-bandwidth-tier=TIER_1 \
  --create-disk=auto-delete=yes,boot=yes,device-name=VM_NAME,\
image=projects/ubuntu-os-cloud/global/images/ubuntu-2204-jammy-v20250415,\
mode=rw,size=100,type=pd-balanced

For more information about available options, see the Compute Engine documentation.

SSH to the client VM

Google Cloud console

To SSH to your Compute Engine VM, you must first create a firewall rule allowing SSH.

  1. In the Google Cloud console, go to the Firewall policies page.

    Go to Firewall policies

  2. Click Create firewall rule.

  3. Enter a Name for the rule.

  4. For Network, select the VPC network you created earlier.

  5. Select Ingress as the Direction of traffic, and Allow as the Action on match.

  6. From the Targets drop-down, select All instances in the network.

  7. In the Source IPv4 ranges field, enter 0.0.0.0/0.

  8. From Protocols and ports, select Specified protocols and ports.

  9. Select TCP and enter 22 in the Ports field.

  10. Click Create.

Then, SSH to your VM:

  1. In the Google Cloud console, go to the VM instances page.

    Go to VM instances

  2. In the instances table, find your instance's row, and click SSH in the column titled Connect.

  3. If prompted to do so, click Authorize to allow the connection.

gcloud

To SSH to your Compute Engine VM, you must first create a firewall rule allowing SSH.

gcloud compute firewall-rules create FIREWALL_RULE_NAME \
  --allow=tcp:22 \
  --network=NETWORK_NAME \
  --source-ranges=0.0.0.0/0 \
  --project=PROJECT_ID

Then connect using gcloud compute ssh:

gcloud compute ssh VM_NAME --zone=ZONE --project=PROJECT_ID

Install the Lustre client packages

The Lustre client packages are hosted in the lustre-client-binaries project in Artifact Registry.

Configure access to the repository

To configure your VM to install from Artifact Registry, run gcloud beta artifacts print-settings to show the installation commands.

Rocky 8

gcloud beta artifacts print-settings yum \
  --repository=lustre-client-rocky-8 \
  --location=us --project=lustre-client-binaries

Ubuntu 20.04 LTS

gcloud beta artifacts print-settings apt \
  --repository=lustre-client-ubuntu-focal \
  --location=us --project=lustre-client-binaries

Ubuntu 22.04 LTS

gcloud beta artifacts print-settings apt \
  --repository=lustre-client-ubuntu-jammy \
  --location=us --project=lustre-client-binaries

Install the Lustre client packages

Follow the instructions to install the Lustre client packages.

Rocky 8

sudo yum --enablerepo=lustre-client-rocky-8 install kmod-lustre-client
sudo yum --enablerepo=lustre-client-rocky-8 install lustre-client

Ubuntu 20.04 LTS

For image ubuntu-2004-focal-v20250213, use the following command:

sudo apt update
sudo apt install \
  lustre-client-modules-5.15.0-1075-gcp/lustre-client-ubuntu-focal
sudo apt install \
  lustre-client-utils/lustre-client-ubuntu-focal

Ubuntu 22.04 LTS

For image ubuntu-2204-jammy-v20250128, use the following command:

sudo apt update
sudo apt install \
  lustre-client-modules-6.8.0-1021-gcp/lustre-client-ubuntu-jammy
sudo apt install \
  lustre-client-utils/lustre-client-ubuntu-jammy

For image ubuntu-2204-jammy-v20250409, use the following command:

sudo apt update
sudo apt install \
  lustre-client-modules-6.8.0-1026-gcp/lustre-client-ubuntu-jammy
sudo apt install \
  lustre-client-utils/lustre-client-ubuntu-jammy

For image ubuntu-2204-jammy-v20250415, use the following command:

sudo apt update
sudo apt install \
  lustre-client-modules-6.8.0-1027-gcp/lustre-client-ubuntu-jammy
sudo apt install \
  lustre-client-utils/lustre-client-ubuntu-jammy

Configure LNet for gke-support-enabled instances

This section applies only to Compute Engine clients connecting to Managed Lustre instances with --gke-support-enabled specified.

To configure LNet to use accept_port 6988:

  1. Create or edit /etc/modprobe.d/lnet.conf.
  2. Add the following line:

    options lnet accept_port=6988
    
  3. Reboot the VM:

    sudo reboot
    

Mount a Managed Lustre instance

Mount the Managed Lustre instance using the mount command.

export IP_ADDRESS=IP_ADDRESS
export FS_NAME=FILESYSTEM_NAME
sudo mkdir -p /lustre
sudo mount -t lustre ${IP_ADDRESS}:/${FS_NAME} /lustre

To retrieve the IP address and file system name for your instance, use the gcloud lustre instances describe command:

gcloud lustre instances describe INSTANCE_NAME \
  --location=ZONE

Access your Managed Lustre instance

Your Managed Lustre instance is now mounted to your Compute Engine VM and readable/writable using standard POSIX syntax, with some exceptions.

Run the following command to check your mounted directory:

sudo lfs df -h /lustre

You can test file copy and write with the following commands:

# sample file copy/file write
sudo dd if=/dev/zero of=/lustre/testmnt/bigfile1 bs=1M count=8000
sudo dd if=/dev/urandom of=/lustre/testmnt/bigfile1 bs=1M count=1000

To confirm disk space usage:

sudo lfs df -h /lustre/testmnt

Unmount the instance

The Managed Lustre instance can be unmounted using the following command:

sudo umount /lustre/

What's next