cloud computing

10 Common But Powerful Compute Engine Actions.

Introduction

What are the common Compute Engine actions on the Google Cloud Platform? In my previous article, I spotlighted Google Compute Engine (GCE), a core cloud vital to the GCP. I want to reiterate here that the need for scalable and flexible cloud computing in the Google Cloud Platform is premium. I did say that Google Cloud Platform (GCP) has stepped up offering a wide range of services to address these requirements.

One of the key services that provide scalable and flexible cloud computing solutions in the GCP is Google Compute Engine. The Google Compute Engine (GCE) is our focus, and in this article, we shall explore the common compute engine actions that users can perform on GCP with this powerful cloud-based computing service.

Some Powerful Compute Engine Actions include;

Metadata and Scripts

It can be used as a metadata server to store and retrieve instance metadata and scripts.

Cloudtek: Compute Engine Metadata and Script

Move an Instance to a new zone:

Moving an instance to a new zone is another action of the compute engine.

Compute Engine Actions: Move an Instance to a new zone

There are 2 processes for moving an instance;

  1. Automatic Process: This involves moving instances within a particular region
    – gcloud compute instances move
    – Update references to VM; not automatic
  2. Manual Process: this involves moving compute instances between different regions, and involves
    – snapshot of all PDs on the source VM
    – creating new PDs in destination zones restored from snapshots
    – Create a new VM in the destination zone and attach new PDs
    – Assign static IP to the new VM
    – Update references to VM
    – Delete the snapshots, original disks, and original VM

Snapshot Services:

Snapshot services is one of the compute engine actionsused to back up critical data in GCP,

Compute Engine Action: Snapshot Services – Backup Critical Data

Migrate data between zones

One of the powerful compute Engine actions is migrating data between zones in the GCP.

Compute Engine Services: Snapshot Services – Migrate Data Between Zones

To transfer to SSD to improve performance

Compute engine can also be used to improve performance by transferring data to SSD.

Compute Engine Actions: Snapshot Services – Transfer to SSD

Persistent Disks Snapshots: Persistent disk snapshots are another common action of the compute Engine
– Snapshot is not available for Local SSD
– creates an incremental backup to cloud storage
– Not visible in your buckets managed by the snapshot service
– Consider cron jobs for periodic incremental backup
– Snapshots can be restored to a new persistent disk
– New disk can be in another region or zone in the same project
– Basis of VM migration: moving a VM to a new zone.
– Snapshot doesn’t backup VM metadata tags etc

Resizing Persistent Disk

Another action of the compute Engine is to resize the Persistent disk.

Compute Engine Actions: Resize Persistent Disk

Note that you can only grow disks but never shrink them.

10 Common Google Compute Engine Actions in GCP

1. Creating a Virtual Machine

The first step in utilizing Google Compute Engine is creating a virtual machine (VM). You can create a VM using the Google Cloud Console, the gcloud command-line tool, or the API.

Here’s a simplified walkthrough:

  1. Log in to Google Cloud Console: Access the Google Cloud Console using your Google Cloud account credentials.
  2. Navigate to Compute Engine: In the Console, click on the “Compute Engine” option under the “Compute” section in the left sidebar.
  3. Create a VM Instance: Click the “Create Instance” button to start the VM creation process.
  4. Configure VM Settings: You can specify details such as the VM name, region, zone, machine type, boot disk, and more. You can also select an operating system image to install on the VM.
  5. Customize Advanced Options: GCE allows you to customize advanced options like network settings, security, and startup scripts as needed.
  6. Review and Create: Double-check your VM configuration settings and click the “Create” button. Google Cloud will provision the VM according to your specifications.

2. Connecting to a VM

Once your virtual machine is up and running, you might need to access it for various tasks. You can connect to a VM using SSH or the Google Cloud Console. Secure Shell (SSH) is a common method to connect to your VM. This is one of the Compute Engine actions in GCP. Here’s how you can do it:

  1. In the Compute Engine section of the Google Cloud Console, locate your VM instance.
  2. Click on the “SSH” button next to the VM you want to access. This will open a web-based SSH terminal, allowing you to interact with your VM.
  3. Alternatively, you can use an external SSH client like PuTTY (for Windows) or the built-in SSH command on Linux and macOS. Use the external IP address provided for your VM to establish an SSH connection.

3. Stopping and Starting VMs

Once you have created a VM, you can start it using the Google Cloud Console, the gcloud command-line tool, or the API. You can stop a VM when you are not using it to save resources. You can start it again later when you need it. To manage your computing costs efficiently, it’s essential to stop VMs when they’re not in use. Starting and stopping VMs are all Compute Engine actions. Here’s how to stop and start VMs:

  1. In the Google Cloud Console, navigate to Compute Engine and locate your VM.
  2. Select the VM you want to stop or start.
  3. Click on the “Stop” or “Start” button at the top of the VM details page.
  4. Confirm the action in the dialog box that appears. Stopping a VM will halt the instance and release its resources while starting it will boot the VM.

4. Snapshotting VMs

This is one of the Compute Engine actions in the GCP. Snapshots are a way to capture the current state of your VM’s disk, allowing you to create backups or clone VMs easily. Here’s how you can create a snapshot:

  1. In the Google Cloud Console, navigate to Compute Engine and locate your VM.
  2. Click on the VM you want to create a snapshot for.
  3. Go to the “Disks” tab and click on the boot disk you want to snapshot.
  4. Click the “Create Snapshot” button, provide a name and description for the snapshot, and click “Create.” The snapshot will capture the disk’s current state.

5. Managing VM Resources

You can manage the resources of your VMs, such as the amount of CPU, memory, and storage. Sometimes, you may need to add additional disks to your VMs for data storage or specific purposes. Here’s how to add and manage disks:

  1. In the Google Cloud Console, navigate to Compute Engine and locate your VM.
  2. Click on the VM to which you want to add a disk.
  3. Go to the “Disks” tab and click the “Add New Disk” button.
  4. Configure the new disk’s settings, such as the size, type, and mode (Read-Write or Read-Only).
  5. Click the “Create” button to add the new disk to your VM.

You can also resize, detach, and delete disks as needed through the “Disks” tab.

6. Setting Up Firewall Rules

Firewall rules control network traffic to and from your VM instances. You can create custom firewall rules to allow or deny specific traffic. Here’s how:

  1. In the Google Cloud Console, navigate to Compute Engine.
  2. Go to the “Firewall rules” section.
  3. Click the “Create Firewall Rule” button.
  4. Specify the firewall rule details, including a name, target tags, IP ranges, protocols, and ports.
  5. Set the action to “Allow” or “Deny”, depending on your requirements.
  6. Click “Create” to create the firewall rule.

7. Enabling Monitoring and Logging

You can log and monitor your VMs to troubleshoot problems and track performance. Monitoring and logging are crucial for maintaining the health and security of your VM instances. Google Compute Engine offers built-in monitoring and logging capabilities through Google Cloud Monitoring and Google Cloud Logging. Here’s how to enable them:

  1. In the Google Cloud Console, navigate to Compute Engine.
  2. Go to the “Monitoring” or “Logging” section to configure monitoring and logging settings for your VM instances.
  3. Set up alerts and notifications to receive timely information about the performance and health of your VMs.

8. Automating Tasks with Startup Scripts

You can automate tasks on your VM instances using startup scripts. These scripts run when the VM boots up, allowing you to configure the environment to your specifications. Here’s how to use startup scripts:

  1. In the Google Cloud Console, navigate to Compute Engine.
  2. Go to the “VM instances” section and select the VM for which you want to configure a startup script.
  3. Click the “Edit” button to modify the VM’s settings.
  4. Scroll down to the “Cloud-init” section, where you can specify a startup script in the “Startup script” field.
  5. Enter your desired script or provide a URL to a script stored in Cloud Storage.
  6. Save your changes to apply the startup script.

9. Creating Load Balancers

Load balancing is crucial for distributing incoming traffic across multiple VM instances, ensuring high availability and reliability. Google Compute Engine provides a load balancing service. Here’s how to create a load balancer:

  1. In the Google Cloud Console, navigate to Compute Engine.
  2. Go to the “Load balancing” section and click the “Create Load Balancer” button.
  3. Choose the type of load balancer you need, whether it’s HTTP(S) Load Balancing, Network Load Balancing, or Internal Load Balancing.
  4. Configure the load balancer settings, including backend services, health checks, and routing rules.
  5. Review your configuration and click “Create” to create the load balancer.

10. Deleting VM Instances

You can delete a VM when you no longer need it. When you no longer need a VM instance, it’s essential to delete it to avoid incurring unnecessary costs. Here’s how to delete a VM:

  1. In the Google Cloud Console, navigate to Compute Engine.
  2. Go to the “VM instances” section and select the VM you want to delete.
  3. Click the “Delete” button.
  4. Confirm the deletion in the dialog box that appears.

Remember that deleting a VM instance will permanently remove it, including all data stored on its disks.

Conclusion

Google Compute Engine is a powerful and versatile cloud computing resource that offers scalability, customization, and integration with other Google Cloud services. Users can perform a wide range of actions within GCE, from creating and managing VM instances to configuring networking and automating tasks.

By understanding the features and common Google Compute Engine actions in the GCP, businesses, and individuals can harness the full potential of this essential cloud computing resource to meet their computing needs efficiently and effectively. Whether you’re running a small development project or managing a large-scale production environment, Google Compute Engine provides the tools and flexibility to help you succeed in the cloud.

I hope this blog article is helpful. Please let me know if you have any questions through the comment section.

Cloudtek

Onuka Kalu is a Google-certified Associate Cloud Engineer (ACE) with vast knowledge of the Google Cloud Platform (GCP). He is a product of the Google Africa Developer Scholarship (GADS). Cloudtek was born out of his passion to give back to the society and to serve as a gateway to the world of cloud technology; His target is to simplify the complexities of cloud computing, and empower curious minds to grasp its potential fully, become world-class cloud computing experts. Hence, the slogan ... Follow the Cloud. It is ideal for everyone who wants to become a Google Associate Cloud Engineer. He holds a bachelor of science degree from the University of Nigeria Nsukka. He has authored many inspirational books, among them is ‘The Threshold of Life’. He is a technopreneur, Success enthusiast, and senior partner at Conquestlane Global Services.He is happily married with children.

Recent Posts

Latest Google Cloud Innovations: Accelerating Digital Transformation in 2023.

IntroductionAI and Machine LearningDuet AI from Google CloudGoogle Cloud TPUv5eVertex AI VisionVertex AI Natural Language Data and…

9 months ago

GCP App Engine: 2 Powerful App Engine Environments

IntroductionUnderstanding the GCP App EngineThe Standard EnvironmentThe Flexible EnvironmentComparing the 2 App Engine EnvironmentsCost ConsiderationsConclusion…

9 months ago

Disk Options: 4 Best Disk Options in Google Cloud Platform

IntroductionWhat You Should Know About Google Cloud Platform DisksDifferent Disk Options in GCPLocal SSD DisksManaging…

10 months ago

Google Compute Engine: 8 Important Features of GCE.

IntroductionWhat is Google Compute Engine (GCE)?Key Features of Google Compute EngineGoogle Compute Engine (GCE) Vs.…

10 months ago

Machine Images: 1 best way to Maintain Cloud Consistency

IntroductionWhat is a machine image in GCP?Types of Machine Images in GCPPublic images:Custom images: Instance TemplatesContainer-Optimized…

10 months ago

Shielded VMs: Ensuring Confidentiality and Integrity of Data On GCP

Introduction IntroductionWhat are Shielded VMs?What is a Shielded Coordination?Some Key Features of Shielded VMsWhy Shielded…

10 months ago