Google CloudCompute3 min read

Check workload peaks before resizing Compute Engine VMs

Sources checked September 10, 202615-30 minutes
On this page

This check is due for a source refresh. Confirm the current documentation before you rely on provider-specific details.

THE SHORT ANSWER

Hold the resize until peak demand and memory needs are verified, because an undersized Compute Engine VM can slow or disrupt the workload and applying the recommendation stops and restarts the VM.

What you need first

Tool
Google Cloud CLI is Google's command-line tool for Google Cloud. Install and initialize it in a local Bash terminal with gcloud init. If an external identity provider is used, sign in with the federated identity first.
Access
Listing requires recommender.computeInstanceMachineTypeRecommendations.list on the target project. The request project also needs a role containing serviceusage.services.use. Ask an authorized colleague for documented results if you lack access.
If you do not use that tool
Give an authorized Google Cloud colleague the project ID and zone. Ask for the current recommendation, target resource, proposed machine type, lastRefreshTime, and CPU and memory history for the previous eight days and known workload peaks.

Why this is worth a look

Skipping this review can leave a VM too small for demand. Recommendations use Cloud Monitoring data from the previous eight days and average CPU utilization over 60-second intervals, so infrequent monthly peaks and brief CPU spikes can be missed. Insufficient available memory can make a database run slowly or crash.

Run these commands

BASH

Run this read-only Bash command after Google Cloud CLI setup. Replace PROJECT_ID and ZONE to list current machine-type recommendations for one project and zone. The output is recommendation data, not utilization history.

List Compute Engine machine recommendations
set -euo pipefail

PROJECT_ID="PROJECT_ID"
ZONE="ZONE"

# Read-only: list current VM machine-type recommendations.
gcloud recommender recommendations list \
  --project="${PROJECT_ID}" \
  --location="${ZONE}" \
  --recommender="google.compute.instance.MachineTypeRecommender" \
  --format="json"

How to confirm it

  1. 01

    Record the recommendation

    Run the command with the target project ID and zone, or use the colleague handoff. Record the target resource, proposed machine type, and lastRefreshTime. Treat the result as a suggestion, not approval to resize.

  2. 02

    Review the eight-day window

    Open the Google Cloud console, select VM instances, choose the VM, and open Details > Observability. Change the default one-hour timeframe to the previous eight days. Confirm with the workload owner that the window includes normal demand, monthly peaks, and brief CPU bursts.

  3. 03

    Check memory evidence

    Review memory utilization for the same workload periods. When the Ops Agent is installed and running, its CPU and memory metrics are automatically used for machine-type recommendations. If memory data is missing, request verified results from the workload owner.

  4. 04

    Hold before an interruption

    Ask an organizational reviewer to assess peak demand and memory needs before applying the recommendation. Hold the resize if either is unclear. Applying it in the console stops the VM, changes its machine type, and restarts it.

Before making changes

Assume the previous eight days represent normal demand only after the workload owner confirms that scope. This review does not establish a safe size for peaks outside that window. For bare-metal instances, standard CPU utilization monitoring is unavailable; use OS Reported CPU % with the Ops Agent installed.

Skip this guide if no Compute Engine machine-type change is being considered or the VM has no machine-type recommendation. This is an existing-recommendation review, not sizing from scratch.

Primary sources