Cloud Service >> Knowledgebase >> General >> Create a VM instance with a high-performance computing (HPC) image
submit query

Cut Hosting Costs! Submit Query Today!

Create a VM instance with a high-performance computing (HPC) image

Preparing a virtual machine with high-performance computing images is useful for users who require heavy computation, especially for scientific analysis and machine learning users. This document describes how to launch a VM instance in Google Cloud Compute Engine and how to choose the images for HPC Worker Nodes.

 

Understanding High-Performance Computing (HPC) Images

 

HPC images are to be used with strong computing resources such as multi-core CPUs, GPUs, multiple memory, etc. These pictures are equipped with different tools and libraries to help with parallel processing and resource management, which is beneficial for demanding computational applications.

 

Prerequisites

 

Before creating a VM instance with an HPC image, ensure you have the following:

 

  1. A Google Cloud account with billing enabled.

  2. Appropriate permissions are required to create VM instances for your project.

  3. Familiarity with Google Cloud Console or the gcloud command-line tool.

 

Steps to Create a VM Instance with an HPC Image

1. Choose an HPC Image

Google Cloud offers a variety of HPC images for creating your VM instance. You can access the available images by using either the Google Cloud Console or the gcloud command.

 

Using Google Cloud Console:

 

  • Go to the Images section on the Google Cloud Console.

  • Filter the images by selecting the "HPC" category to view relevant options.

 

Using gcloud:

 

Run the following command to list available images:

gcloud compute images list --project=your-project-id

 

Substitute your actual project ID for your-project-id.

2. Create the VM Instance

You can choose to make a VM instance using either the Google Cloud Console or the gcloud command-line tool.

 

Using Google Cloud Console

 

  1. Go to the VM instances page in the Google Cloud Console.

  2. Click on Create Instance.

  3. In the Machine configuration section, select the desired machine type based on your performance needs. HPC workloads often benefit from higher CPU and memory configurations.

  4. Under the Boot disk section, click Change and select the HPC image you identified earlier.

  5. Configure additional settings such as networking, security, and management options according to your requirements.

  6. Click Create to provision the VM instance.

 

Using gcloud

 

To create a VM instance using the command line, use the following command structure:

 

gcloud compute instances create INSTANCE_NAME \

--zone=ZONE \

--machine-type=MACHINE_TYPE \

--image=IMAGE_NAME \

--image-project=IMAGE_PROJECT \

--boot-disk-size=DISK_SIZE \

--metadata=KEY=VALUE \

--tags=TAG

 

Replace the placeholders with your specific values:

 

  • INSTANCE_NAME: Name of your VM instance.

  • ZONE: The geographic zone where you want to deploy your instance (e.g., us-central1-a).

  • MACHINE_TYPE: Type of machine (e.g., n1-highcpu-8).

  • IMAGE_NAME: The name of the HPC image.

  • IMAGE_PROJECT: The project containing the HPC image.

  • DISK_SIZE: Size of the boot disk (e.g., 100GB).

  • KEY=VALUE: Metadata key-value pairs as needed.

  • TAG: Network tags for firewall rules.

3. Configure Networking and Security

When creating an HPC VM, consider the following networking and security configurations:

 

  • VPC Network: Select the correct Virtual Private Cloud (VPC) network. You can choose to use the existing network or create your own.

  • Firewall Rules: Set up firewall policies to control incoming and outgoing data flow for your virtual machine.

  • External IP Address: Decide whether your VM should have an external IP address. If not, it will only be accessible from within the VPC.

4. Optimize Performance

To maximize the performance of your HPC instance, consider the following options:

 

  • Attach GPUs: If your workloads require heavy graphical processing or parallel computation, consider adding GPUs to your VM instance. This can significantly enhance performance for certain applications.

 

Example command to add a GPU:

 

--accelerator=type=nvidia-tesla-k80,count=1

  • Use Preemptible VMs: Preemptible VMs are cheaper, but one has to beware that Google Cloud can, at some point, terminate them without prior notification.

5. Start and Manage Your VM

After creating your VM instance, it will automatically start. To recognize and manage your instance, you can use either the Google Cloud Console or the gcloud command-line tool. Monitor performance indicators and logs regularly to ensure the smooth operation of your instance.

 

Conclusion

 

Setting up a VM instance with a high-performance computing image in Google Cloud is simple: choose the appropriate image, adjust instance settings, and optimize for performance. Users can effectively use the computational power of HPC images to meet their demanding workload requirements by following the specified steps. Always consider the specific needs of your applications and workloads when configuring your VM to ensure optimal performance and cost-effectiveness.

 

Cut Hosting Costs! Submit Query Today!

Grow With Us

Let’s talk about the future, and make it happen!