GCP VM Oversized - Downsize to Smaller Predefined Machine Type
What does ZopNight detect here?
Oversized GCE VMs on predefined machine types are stepped down one size on the family ladder. Savings equal (srcRate − dstRate) × 730 from live on- demand hourly rates for the current and target types, capped at cost; floor sizes, off-ladder or GPU families, and missing rates abstain.
Signal and threshold
| Field | Value |
|---|---|
| Rule IDs | RC-1207 |
| Category | rightsizing |
| Severity | low |
| Metric | none — pure configuration read |
| Source | vm_custom_machine.go |
Where it applies
The machine type and its downsize target
- resource.Tags: custom_machine_evaluated (skip-once after review) and machine_type_category (skip when already custom).
- resource.InstanceType: current predefined machine type, used to pick the one-step-smaller downsize target (gceDownsize ladder) and to look up SKU rates.
- PricingAware via r.pricing[UID]: per-resource monthly cost (abstain when absent/≤0).
- SKURatesAware + TargetSKUCandidatesAware: per-provider|region|sku on-demand hourly rates for both the current InstanceType and the one-step-smaller target (the service prefetch adds the target rate via TargetSKUCandidates).
The hourly rate delta of one step down
concrete-or-abstain (cost-driven rightsizing, user directive 2026-06-27; the prior advisory/SavingsUSD=0 posture and the removed hardcoded 0.30 fraction are gone). Lever = downsize one step to the next-smaller predefined machine type. savings = (srcRate − dstRate) × 730, where srcRate/dstRate are the live on-demand hourly rates of the current and target machine types (SKU-DELTA pattern, mirrors rds_rightsizing.go); capped at cost. Abstains (returns nil, never $0) when there is no nameable downsize target (family floor / off-ladder / unknown / GPU family), either SKU rate is missing, the target is not genuinely cheaper (dst ≥ src), or pricing is absent/≤0. RecommendTarget: downsize-only; the cost-increasing gceFloorUpsize branch (which turned a floor e2-micro into a larger e2-small) is removed (2026-06-26; mirrors RC-004); a floor/off-ladder SKU returns nil so the resize template skips a no-op.
Checking CPU and memory before resizing
- Review VM CPU and memory utilization in Cloud Monitoring