Skip to main content

🛡️ Google GCE Instance is idle🟢

Logic

Description

Open File

Description

This policy identifies Google Compute Engine (GCE) instances that appear to be idle. When a linked New Relic host is available, this policy combines CPU and network metrics with New Relic memory, disk read utilization, and disk write utilization. Otherwise, it falls back to CPU and network metrics only. An instance is considered idle if it consistently meets the applicable low-utilization criteria over a 14-day period:

  • Average CPU utilization below 5%
  • Maximum CPU utilization below 15%

Additionally, when New Relic data is available:

  • Memory utilization below 20% when New Relic data is available
  • Disk read utilization below 5% when New Relic data is available
  • Disk write utilization below 5% when New Relic data is available
  • Average network I/O less than 100 MB

Rationale

Idle instances generate costs without delivering business value. By identifying and addressing these instances, organizations can reduce unnecessary GCP spending and improve overall resource efficiency.

Impact

Before terminating an instance, verify that it is not required for periodic tasks, disaster recovery, or other non-continuous workloads.

... see more

Remediation

Open File

Remediation

Before taking action, verify whether the instance is still required. Idle instances may serve non-critical purposes such as development, testing, or periodic workloads.

Stop the Instance

Stop the instance if it is temporarily not needed but may be required later. This halts billing for compute resources, although storage charges for attached persistent disks will continue.

gcloud compute instances stop {{instance-name}} \
--zone={{zone}}

Rightsize the Instance

If the instance is oversized for its workload, resize it to a smaller, more cost-effective machine type.

  1. Stop the instance.

  2. Change the machine type:

    gcloud compute instances set-machine-type {{instance-name}} \
    --zone={{zone}} \
    --machine-type={{new-machine-type}}
  3. Restart the instance:

    gcloud compute instances set-machine-type {{instance-name}} \

Delete the Instance

If the instance is no longer required, delete it to eliminate all associated costs. This action is irreversible and will also remove any attached non-boot disks configured for auto-deletion.

... see more

policy.yaml

Open File

Linked Framework Sections

SectionSub SectionsInternal RulesPoliciesFlagsCompliance
💼 Cloudaware Framework → 💼 Waste Reduction25no data
💼 Cloudaware Framework → 💼 Workload Efficiency24no data