SkillAgentSearch skills...

compute-mig-autoscaling-troubleshooting

Diagnoses and resolves Google Compute Engine Managed Instance Group (MIG) autoscaling failures, scale-out blocks, and scale-in stalls.

Install / Use

npx skills add google/skills --skill compute-mig-autoscaling-troubleshooting

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

90/100

Category

Operations

Supported Platforms

Universal

Our assessment of compute-mig-autoscaling-troubleshooting

compute-mig-autoscaling-troubleshooting scores 90/100 on our quality scale, 274th of 751 Operations skills we index (top 37%).

Its SKILL.md is 28 KB long, well organised into 19 sections with 4 code examples: a thorough specification that gives an agent plenty to work with.

With 20,340 GitHub stars, it is one of the more widely adopted skills in the catalogue.

Substance
30/30
Structure
20/20
Description
15/15
Adoption
18/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated about 2 months ago, so compute-mig-autoscaling-troubleshooting is actively maintained.
  • It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
  • Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

compute-mig-autoscaling-troubleshooting compared with similar skills

All 4 of these similar skills score higher than compute-mig-autoscaling-troubleshooting; compare them before choosing.

SkillScoreStarsUpdatedFormat
compute-mig-autoscaling-troubleshooting (this skill)by google9020.3k2mo agoSKILL.md
algorithmic-artby anthropics100177.9k2mo agoSKILL.md
pptxby anthropics100177.9k2mo agoSKILL.md
prospectingby coreyhaines3110062.2k5d agoSKILL.md
ad-creativeby coreyhaines3110062.2k5d agoSKILL.md

Frequently asked questions

How do I install compute-mig-autoscaling-troubleshooting?
Run npx skills add google/skills --skill compute-mig-autoscaling-troubleshooting. The install tabs above show the steps for each supported agent.
Which AI agents does compute-mig-autoscaling-troubleshooting work with?
It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
Is compute-mig-autoscaling-troubleshooting safe to use?
It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is compute-mig-autoscaling-troubleshooting still maintained?
The repository was last updated about 2 months ago, so compute-mig-autoscaling-troubleshooting is actively maintained.

name: compute-mig-autoscaling-troubleshooting description: >- Diagnoses and resolves Google Compute Engine Managed Instance Group (MIG) autoscaling failures, scale-out blocks, and scale-in stalls. Use ONLY when a Compute Engine MIG fails to add or remove VM instances during load changes, hits quota or zonal stockout limits, reaches maxNumReplicas (CAPPED_AT_MAX_NUM_REPLICAS), conflicts with HTTP(S) load balancer maxRate settings, fails to scale in to zero instances, or fails to read Cloud Monitoring scaling metrics. DO NOT read or use for Google Kubernetes Engine (GKE) Horizontal Pod Autoscaler (HPA), GKE Cluster Autoscaler, standalone single-VM creation, or single-VM host maintenance reboots. metadata: version: "1.0.0" category: Compute

Compute Engine Managed Instance Group (MIG) Autoscaling Troubleshooting

This skill diagnoses and resolves autoscaling failures in Google Compute Engine Managed Instance Groups (MIGs). It isolates root causes across Project Quotas vs. Physical Zonal Stockouts, Autoscaler Policy Limits (maxNumReplicas, minNumReplicas: 0 scale-to-zero rules, scaleInControl, mode, --cool-down-period, Load Balancer UTILIZATION vs. RATE), and Cloud Monitoring Metric / Service Agent IAM Availability.

MCP Tools: get_instance_group_manager_basic_info, list_instance_group_managers, list_managed_instances, list_instance_templates, get_instance_template_basic_info, get_instance_template_properties

Usage Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read and follow the instructions in Usage Attribution.


Prerequisites & Environment Setup

Any host, project, IAM, or MIG modifications (installing gcloud, configuring MCP, enabling APIs or Log Analytics, adding IAM bindings, updating autoscalers or backend services, or deleting resources) must be explicitly approved by the user before execution.

  1. Google Cloud SDK: Verify gcloud is installed (gcloud --version). If missing or outdated, seek user approval before installing via Install the gcloud CLI.
  2. Compute Engine MCP Server & Capability Boundary:
    • The Compute Engine MCP server (Use the Compute Engine MCP server) exposes read-only zonal MIG and template discovery tools (get_instance_group_manager_basic_info, list_instance_group_managers, list_managed_instances, list_instance_templates, get_instance_template_basic_info, get_instance_template_properties) and requires roles/mcp.toolUser.
    • Critical Routing Rule: get_instance_group_manager_basic_info requires a single zone (no regional MIG RPCs exist in Compute Engine MCP) and returns InstanceGroupManagerBasicInfo (name, id, instance_template, target_size, status), which omits autoscaler.status, autoscaler.statusDetails, autoscaler.recommendedSize, and autoscaler.autoscalingPolicy. Compute Engine MCP also lacks list-errors, Cloud Logging/Monitoring queries, and update-autoscaling / set-autoscaling mutations. Always route regional MIG inspection, autoscaler.* diagnostics, list-errors, Cloud Logging/Monitoring queries, and autoscaling mutations to gcloud (or Compute Engine / Monitoring / Logging REST APIs).
  3. Authentication: Local CLI (gcloud auth login), Application Default Credentials (gcloud auth application-default login), or Service Accounts (GOOGLE_APPLICATION_CREDENTIALS).
  4. Project, Region, Billing & API Enablement:
    gcloud config set project {project_id}
    gcloud config set compute/region {region}
    gcloud config set compute/zone {zone}
    gcloud services enable compute.googleapis.com logging.googleapis.com monitoring.googleapis.com
    
    Note: An active billing account attachment is required (even when using Free Tier eligible resources). Default to a well-supported region such as us-central1 if unspecified, and consult Google Cloud locations to verify regional and zonal machine family availability.
  5. Required IAM Roles:
    • Human Caller / Agent Roles: roles/compute.viewer, roles/logging.viewer (plus roles/logging.viewAccessor for Log Analytics, and roles/bigquery.jobUser + roles/bigquery.dataViewer for linked BigQuery datasets), and roles/monitoring.viewer for read-only diagnostics; roles/compute.instanceAdmin.v1 (plus roles/iam.serviceAccountUser when updating templates with a VM service account, roles/compute.loadBalancerAdmin for Backend Service updates, and roles/resourcemanager.projectIamAdmin to repair project IAM bindings) for remediation; and roles/mcp.toolUser for Compute Engine MCP calls.
    • Google-Managed Service Agents (Project-Level):
      • Compute Engine Service Agent (service-{project_number}@compute-system.iam.gserviceaccount.com): requires roles/compute.serviceAgent (includes Cloud Monitoring metric read permissions).
      • Google APIs Service Agent ({project_number}@cloudservices.gserviceaccount.com): requires roles/compute.instanceGroupManagerServiceAgent (creates and deletes MIG member VMs).

Step 1: Identify Problem Scope & Inspect Autoscaler Status

A. Inspect Live MIG Stability, Autoscaler Status & Per-VM Actuation Errors

Inspect status.isStable, autoscaler.status, autoscaler.statusDetails, autoscaler.recommendedSize, autoscaler.autoscalingPolicy, and targetSize via gcloud compute instance-groups managed describe (pass --region={region} for Regional MIGs or --zone={zone} for Zonal MIGs), and run gcloud compute instance-groups managed list-errors to surface asynchronous VM creation errors:

# 1. Inspect Autoscaler status, statusDetails, recommendedSize, and policy (Regional MIG):
gcloud compute instance-groups managed describe {mig_name} --project={project_id} --region={region} \
    --format="yaml(name, targetSize, status.isStable, autoscaler.status, autoscaler.statusDetails, autoscaler.recommendedSize, autoscaler.autoscalingPolicy)"

# (For a Zonal MIG, replace --region={region} with --zone={zone}:)
gcloud compute instance-groups managed describe {mig_name} --project={project_id} --zone={zone} \
    --format="yaml(name, targetSize, status.isStable, autoscaler.status, autoscaler.statusDetails, autoscaler.recommendedSize, autoscaler.autoscalingPolicy)"

# 2. Inspect per-instance actuation errors logged by the MIG controller:
gcloud compute instance-groups managed list-errors {mig_name} --project={project_id} --region={region} --limit=25

Authoritative autoscaler.statusDetails[] (type & message) Values & Root Causes (see Understanding autoscaler decisions): Each item in autoscaler.statusDetails[] on the REST Autoscaler resource contains a structured type enum and a human-readable message string:

  • CAPPED_AT_MAX_NUM_REPLICAS ("The number of instances has reached the maxNumReplicas. The autoscaler cannot add more instances."): Current target size has hit the configured autoscalingPolicy.maxNumReplicas ceiling while demand warrants more VMs.
  • NOT_ENOUGH_QUOTA_AVAILABLE / QUOTA_EXCEEDED ("Quota for some resources is exceeded. Increase the quota or delete resources to free up more quota.", paired with QUOTA_EXCEEDED in list-errors and Cloud Audit Logs): Project or regional quota (CPUS, IN_USE_ADDRESSES, SSD_TOTAL_GB, or GPUs) is exhausted.
  • ZONE_RESOURCE_STOCKOUT / REGION_RESOURCE_STOCKOUT (paired with ZONE_RESOURCE_POOL_EXHAUSTED or ZONE_RESOURCE_POOL_EXHAUSTED_WITH_DETAILS in list-errors and Cloud Audit Logs): Temporary physical hardware shortage in the target zone or region.
  • MISSING_CUSTOM_METRIC_DATA_POINTS / CUSTOM_METRIC_INVALID / CUSTOM_METRIC_DATA_POINTS_TOO_SPARSE ("The monitoring metric that was specified does not exist or does not have the required labels. Check the metric."): The autoscaler cannot read valid 60-second data points from the configured Cloud Monitoring metric, or service-{project_number}@compute-system.iam.gserviceaccount.com lacks roles/compute.serviceAgent.
  • UNSUPPORTED_MAX_RATE_LOAD_BALANCING_CONFIGURATION ("Autoscaling does not work with an HTTP/S load balancer configured for maxRate."), BACKEND_SERVICE_DOES_NOT_EXIST, MORE_THAN_ONE_BACKEND_SERVICE, or MISSING_LOAD_BALANCING_DATA_POINTS: Load-balancing autoscaling conflicts with a Backend Service configured in RATE (maxRate) balancing mode instead of UTILIZATION, references a deleted/multiple backend services, or receives no traffic.
  • ALL_INSTANCES_UNHEALTHY ("All instances in the instance group are unhealthy (not in RUNNING state). If this is an error, check the instances."): All MIG instances are not in RUNNING state, halting load-based scaling decisions until instances recover.
  • MODE_ONLY_SCALE_OUT / MODE_ONLY_UP / MODE_OFF / MIN_EQUALS_MAX / SCALING_SCHEDULE_AFFECTING_MIN_REPLICAS / WARNING_NO_INSTANCES: Policy mode or schedule constraints actively restricting scale-in or scale-out.

B. Query Cloud Audit Logs for Autoscaler Decisions & Instance Creation Failures

Query Cloud Audit Logs across autoscaler, gce_autoscaler, gce_instance_group_manager, gce_instance_group, and gce_instance (passing --freshness=7d because gcloud logging read defaults to 1d). See Viewing autoscaler logs:

  • Autoscaler system_event Audit Log Schemas (protoPayload.metadata):
    • Resize decisions (compute.autoscalers.resize, @type: "type.googleapis.com/autoscaler.AutoscalerSizeChangeExplanation"): Records protoPayload.metadata.oldSize, protoPayload.metadata.newSize, protoPayload.metadata.autoscalingMode, protoPayload.metadata.autoscalingReason.summary, protoPayload.metadata.autoscalingReason.scalingSignal (name, calculatedSize, calculationDetails.servingSize, calculationDetails.signalTarget, calculationDetails.signalValue), and protoPayload.metadata.autoscalingReason.scalingLimit (name, limitSize, limitPolicy, e.g., MAX_REPLICAS_LIMIT or SCALE_IN_LIMIT).
    • Status transitions (compute.autoscalers.changeStatus, @type: "type.googleapis.com/autoscaler.AutoscalerStatusChange"): Records human-readable status message transitions in protoPayload.metadata.oldStatus.details and protoPayload.metadata.newStatus.details (for example, transitioning from "OK" to "Quota for some resources is exceeded. Increase the quota or delete resources to free up more quota."; statusDetails[].type enum codes live on the REST Autoscaler resource rather than inside changeStatus log entries).
# 1. Query failed MIG resize, autoscaler, and VM insertion Admin Activity logs (projecting errors[0].code):
gcloud logging read '(resource.type="autoscaler" OR resource.type="gce_autoscaler" OR resource.type="gce_instance_group_manager" OR resource.type="gce_instance_group" OR resource.type="gce_instance") AND severity>=ERROR AND protoPayload.methodName=~"compute\.(regionInstanceGroupManagers|instanceGroupManagers|instances|instanceGroups|autoscalers|regionAutoscalers)\.(resize|insert|addInstances|removeInstances|changeStatus|update|patch)" AND protoPayload.resourceName:"{mig_name}"' \
    --project={pro

Truncated for display — read the full file on GitHub.

Related Skills

View on GitHub
GitHub Stars20.3k
CategoryOperations
Updated2mo ago
Forks1.7k

Languages

Python

Trust signals

100/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

No cautions
compute-mig-autoscaling-troubleshooting — Universal Skill: Install & Safety Check | SkillAgent