This page shows you how to delete a Filestore instance.
Delete an instance
Before deleting a Filestore instance, unmount it from client VMs first. Not doing so causes file operations to stop responding.
Google Cloud console
In the Google Cloud console, go to the Filestore Instances page.
Click the Filestore instance ID to open the instance details page.
Click Delete delete.
When prompted, type the instance ID.
Click Delete.
gcloud
Before you begin
To use the gcloud CLI, you must either install the gcloud CLI or use the Cloud Shell that's built into the Google Cloud console:
Go to the Google Cloud console
You can delete a Filestore instance by running the instances
delete command:
gcloud filestore instances delete instance-id \
--project="project-id" \
--zone=zone
--force
where:
- instance-id is the instance ID of the Filestore instance you want to delete.
project-id is the project ID of the Google Cloud project that contains the Filestore instance. You can skip this flag if the Filestore instance is in the
gclouddefault project. You can set the default project by running theconfig set projectcommand:gcloud config set project project-idzone is the zone where the Filestore instance resides. Run the
gcloud filestore zones listcommand to get a list of supported zones. You can skip this flag if the Filestore instance is in thegclouddefault zone. You can set the default zone by running theconfig set filestore/zonecommand:gcloud config set filestore/zone zone--forceOptional. Use this flag with the command to delete the Filestore instance and any associated snapshots.
REST API
Have gcloud CLI installed and initialized, which lets you generate an access token for the
Authorizationheader.Use
cURLto call the Filestore API:curl -s \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ --header "Content-Type: application/json" \ --request DELETE "https://file.googleapis.com/v1/projects/PROJECT/locations/LOCATION/instances/INSTANCE_NAME"
Where:
PROJECTis the name of the project where your instance is located. For example,my-genomics-project.LOCATIONis the location where your instance resides. For example,us-west1-a.INSTANCE_NAMEis the name of the instance you want to delete. For example,my-genomics-instance.
Zonal with a higher capacity range (previously high scale SSD) tier instances can take up to 10 minutes to delete, depending on the instance size.
The Filestore quota is released when instance deletion completes but you are not be billed for the instance during this time.
Delete instances that have snapshots
If you want to delete a zonal, regional, or enterprise instance that contains snapshots, you must complete either of the following tasks:
- Delete the instance's snapshots before deleting the instance.
- Include the
--forceflag in thegcloud filestore instances deletecommand.
The Google Cloud console allows for the deletion of instances containing snapshots and automatically deletes the snapshots.