How to Find and Delete Unattached GCP Disks to Save Costs
Learn how to find and delete unattached GCP disks to optimize costs and improve security. Follow these steps to clean up your Google Cloud environment.
Learn how to find and delete unattached GCP disks to optimize costs and improve security. Follow these steps to clean up your Google Cloud environment.
Many organizations have embraced moving their IT infrastructure to the cloud to enjoy benefits like lower overhead costs, increased redundancy, and better scalability. The tradeoff is that these organizations now need to monitor the incremental costs for things like compute time, data transfers, and storage capacity. If you’re working within the Google Cloud Platform (GCP), locating and deleting unattached GCP disks is a critical practice for optimizing your cloud infrastructure spending.
Unattached GCP disks are abandoned or orphaned resources that are detached from a service and rendered inoperable. You can end up with an unattached disk, for example, by deleting a Google Compute Engine instance and orphaning a persistent disk that was once attached to it. This is helpful if you want to keep that data, but as an abandoned disk, your IT team will soon forget about its existence.
GCP disks change as developers add new items to the GCP environment. Unfortunately, that often leads to disks ending up orphaned, which ends up hurting your company's bottom line. In 2020, idle resources contributed to more than $11 billion in wasted spending.
Ideally, your company should have a GCP resource management plan in place for regular scanning of your GCP. By establishing scheduled removals, you’re consistently locating and removing unattached disks and other orphan resources. The more frequently you conduct your search, the less your organization will have to pay for unused or forgotten GCP resources.
The Blink platform helps IT organizations create practical, cost-effective applications that monitor cloud environments like GCP. That way, you can locate and track any unmanaged resources like unattached GCP disks.
You can find unattached GCP disks by connecting to Google Cloud and accessing Cloud Shell. You can also use tools like Blink to connect to Cloud Shell API using the service cloudshell.googleapis.com.
Disks that are in use have a defined user. To locate disks that do not have an associated user, issue the following command:
To delete unattached GCP disks associated with a project, issue the following command in Cloud Shell:
Before removing any resource from GCP, make sure it’s not needed. There may be situations where someone else in your IT department may require the information. The following command can help you locate any unattached GCP resources:
The above command is best suited for smaller environments. Teams should set up ongoing monitoring for more extensive operations. It’s also a good idea to use tools capable of more sophisticated detection techniques.
By finding a space to consolidate your GCP resource management, you put yourself in a better position to avoid the problem of unattached GCP disks. Automating your ability to locate and delete unused resources increases the efficiency of your operations and lowers your overall costs.
With Blink, you can run this automation to find unattached disks in your GCP account and send a report to a designated email address.
When this automation runs, it executes the following actions:
You can import this automation from the Blink library and customize it however you like. For example, you could send a weekly Slack notification with a report on unattached disks, and add a step to approve their deletion via Slack.
In Blink, you can also create automations from scratch to meet your team’s unique needs using the hundreds of drag-and-drop actions available from a wide range of tools.
Sign up for a demo today to see how easy automation can be with Blink.
Blink is secure, decentralized, and cloud-native. Get modern cloud and security operations today.