gcp-cost-optimization

Analyze GCP billing and reduce costs via orphaned disk cleanup, VM rightsizing, and committed use discounts.

Updated Jul 6, 2026
One-click install
npx skills add https://github.com/Lucien-1127/strata-skill --skill gcp-cost-optimization-lucien-1127
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gcp-cost-optimization
Source: https://github.com/Lucien-1127/strata-skill/tree/main/gcp-cost-optimization
Command: npx skills add https://github.com/Lucien-1127/strata-skill --skill gcp-cost-optimization-lucien-1127

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? GCP projects accumulate hidden costs from orphaned disks, over-provisioned VMs, and missing discount commitments. This Skill provides a CLI-first playbook to identify and eliminate that waste using gcloud commands. ## Core Features & Use Cases - Orphaned Resource Cleanup: Find and delete detached persistent disks and stopped Cloud Workstations that still incur storage fees. - VM Rightsizing & Migration: Migrate Intel N2/E2 instances to AMD N2D machine types for roughly 25% savings, including the disk-preserving delete-and-recreate workflow. - Discounts & Guardrails: Purchase Committed Use Discounts, create budget alerts with threshold rules, and configure storage lifecycle policies. - Use Case: A startup's GCP bill keeps growing. Run the optimization sequence to delete orphaned disks, migrate an n2-standard-4 VM to n2d-standard-4 saving about €17/month, and set a budget alert at 50%, 90%, and 100% thresholds. ## Quick Start Analyze my GCP project for cost-saving opportunities and list orphaned disks, oversized VMs, and eligible committed use discounts.

Frequently Asked Questions about gcp-cost-optimization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find and delete orphaned disks in GCP?▼

Run gcloud compute disks list and check the USERS column; an empty value means the disk is orphaned. Confirm with gcloud compute disks describe, then delete it with gcloud compute disks delete to stop storage charges.

How to migrate a GCP VM from Intel N2 to AMD N2D?▼

Stop and delete the old instance without the --delete-disks=boot flag so the boot disk survives, then create a new n2d-standard VM reusing that disk. Direct set-machine-type fails because the Intel minimum CPU platform conflicts with AMD requirements.

Do GCP committed use discounts cover all costs?▼

No. CUDs cover CPU, memory, GPU, and local SSD for a specific machine family and region, but not premium OS licenses, network egress, or disk storage. An n2d-amd CUD does not apply to Intel n2-standard instances.

Why do GCP service-specific credits not reduce my VM bill?▼

Trial credits like the Gemini Code Assist credit are restricted to specific SKUs and do not offset Compute Engine, Vertex AI, or Cloud Storage charges. Check the credits page in the Cloud Console, since no CLI equivalent exists.

Can I set up GCP budget email alerts using gcloud CLI?▼

Not directly. The gcloud billing budgets create command supports threshold rules but not email recipients; email notifications require a PubSub topic and subscription. The simplest path is adding recipients once through the Cloud Console budgets page.