> ## Documentation Index
> Fetch the complete documentation index at: https://help.nops.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Disks of Long-Stopped GCP VMs

> Snapshot and delete persistent disks in projects where no VM has run for at least 30 days.

Persistent disks and Hyperdisks keep billing when their VM is stopped or deleted. nOps finds projects that paid for disks every day for 30 days but had no VM running at all in that time, so the disks are either unattached or belong to VMs that have been stopped for at least a month. It estimates the saving from snapshotting and deleting them.

| | |
| - | - |
| **Cloud** | Google Cloud |
| **Category** | Storage |
| **Service** | Compute Engine |
| **Action** | Delete |
| **Effort** | Low |
| **Restart needed** | No |
| **Can be rolled back** | Yes |
| **Analysis window** | Last 30 days |
| **Source** | nOps |

## Why it matters

Stopped VMs look free, but their disks are not. A project that nobody has started for a month is often a forgotten test or migration environment.

## How nOps finds it

nOps reads Compute Engine disk charges (persistent disk and Hyperdisk capacity, IOPS and throughput, not snapshots, images or local SSD) for each project over the last 30 complete days. A project is flagged when it was billed for disks on all 30 days, and in the last day, and had no Compute Engine vCPU, memory, GPU or local SSD usage, and no GKE Autopilot usage, in that time. The saving is the disk cost over the last 7 days, scaled to a month, and must be at least \$5 a month. The cost of the snapshots you keep is not deducted, and static IP charges are left to their own recommendation. Projects whose spend on the service is at least 90% paid by credits or promotions are left out.

## Before you start

Confirm with the project owner that the VMs will not be started again, or that snapshots are enough to restore them.

## How to implement

1. In the console, open **Compute Engine → Disks** for the project and list the disks with their **In use by** column.
2. Confirm with the owner that the stopped VMs and unattached disks are not needed.
3. Snapshot each disk you might need later: `gcloud compute snapshots create SNAPSHOT_NAME --source-disk=DISK_NAME --source-disk-zone=ZONE`.
4. Delete the stopped VMs you no longer need, then delete the disks: `gcloud compute disks delete DISK_NAME --zone=ZONE`.
5. Remove them from Terraform so they are not recreated.

## Risks and considerations

* Billing has no link between disks and VMs, so check each disk before deleting it.
* Deleting a disk is permanent. Restoring from a snapshot creates a new disk and takes time.
* Snapshot storage is usually much cheaper than the disk, but it is not free.

## FAQs

> [accordion] Does nOps flag a single stopped VM in a busy project?
>
> No. It flags a project only when no VM ran in it at all for 30 days, which makes a mistake much less likely.

## Related

* [Delete GCP Disk Snapshots Older Than 90 Days](https://help.nops.io/inform/supported-recommendations/delete-gcp-disk-snapshots-older-than-90-days)
* [Release Idle GCP Static IP Address](https://help.nops.io/inform/supported-recommendations/release-idle-gcp-static-ip-address)
* [Delete Idle GCS Bucket](https://help.nops.io/inform/supported-recommendations/delete-idle-gcs-bucket)
* [Supported recommendations](https://help.nops.io/inform/supported-recommendations.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.