Persistent disks left unattached, 7+ days after a detach, that bill for their full size
What does ZopNight detect here?
Compute Engine bills persistent disks for their full provisioned size until they are deleted, attached or not. ZopNight flags a `READY` disk with no `users`, waiting 7 days after a detach but not for never-attached disks, skips disks Kubernetes manages, and reports the disk's whole monthly cost as the saving.
Signal and threshold
| Field | Value |
|---|---|
| Rule IDs | RC-112 |
| Category | orphan |
| Severity | low |
| Metric | none — pure configuration read |
| Threshold | no attached instance; 7 days since detach when a detach time exists |
| Evaluation window | 7d |
| Source | ZopNight |
| Permissions used | compute.disks.list · compute.disks.get · compute.snapshots.list |
Where it applies
Detached disks bill for every provisioned gigabyte
Disk pricing charges Persistent Disk by provisioned space: “If you provision a 200 GB disk, you are billed for that entire disk space, regardless of how you use it, until you relinquish it.” Google’s example puts a 200 GB SSD Persistent Disk at $34.00 a month in US regions.
Attachment does not change that. The
disk modification guide says
“you incur costs for a disk until you delete it, even if the disk isn’t attached to any
instances.” Disks survive VM deletion whenever autoDelete is false, which is how most orphaned
disks are born.
Listing disks nothing is using
A disk’s users field lists the instances it is attached to. The -key:* filter form matches
disks where that field is empty:
gcloud compute disks list \ --filter="-users:*" \ --format="table(name,zone,sizeGb,type,lastDetachTimestamp)"Conditions for an orphaned disk
ZopNight treats a disk as unattached when its status is READY and no instance uses it. For a disk
that was attached and later detached, it then requires at least 7 days since the detach, using the
lastDetachTimestamp Compute Engine records, so a disk moved between VMs during maintenance is not
flagged. A disk that was never attached has no detach time, so it is flagged as soon as it is seen
unattached, whatever its age.
Disks it leaves alone
Kubernetes-managed volumes are skipped: names starting pvc-, gke- or kubernetes-dynamic-pvc-,
and disks carrying the goog-gke-volume label from the GKE Persistent Disk CSI driver. Their
lifecycle belongs to the cluster, and a released volume is often reclaimed by a StatefulSet.
If ZopNight has no price for the disk, it stays silent instead of reporting a zero.
Pricing a disk nobody reads
saving = full monthly cost of the diskcost after fix = 0Deleting an unattached disk removes its whole standing charge, so no fraction is applied.
Deleting a disk safely
- Confirm no instance or instance template expects the disk; check its labels and description for an owner.
- Take a snapshot if the contents might matter:
gcloud compute snapshots create SNAPSHOT_NAME --source-disk=DISK_NAME --source-disk-zone=ZONE. - Delete the disk:
gcloud compute disks delete DISK_NAME --zone=ZONE. - Set
autoDeleteon data disks of future VMs you do not intend to keep, so they go with the instance.