Stay organized with collections
Save and categorize content based on your preferences.
This page shows you how to help prevent the accidental deletion of existing or new Filestore instances.
Overview
You can set the deletion protection option when you create an instance or update
this option on an existing instance. In both cases, deletion is prevented at the
instance level.
Plan for deletion
If you are planning to delete an instance, complete the following steps:
Confirm that it is safe to delete the instance.
Confirm that deletion protection is deactivated. If necessary, edit the
instance to deactivate deletion protection.
Limitations
Deletion protection doesn't prevent the following operations:
Editing an instance
Deleting a backup
Reverting a snapshot
Deleting a file
Set deletion protection on a new instance
This section shows you how to set the deletion protection option when
creating a new instance. By default, the feature is deactivated.
If deletion protection is enabled, an attempt to delete the instance fails.
Google Cloud console
In the Google Cloud console, go to the Filestore Instances
page.
Follow the instructions noted in Create an instance.
Before clicking Create, add the following specifications:
In the Tags section, expand the Advanced options section.
In the Deletion protection section, select the Enable deletion protection checkbox. We recommend stating the reason for enabling deletion protection to provide more context.
--deletion-protection is the flag used to enable deletion protection
when creating the instance.
--deletion-protection-reason is the flag used to add a description of
the justification for the instance's deletion protection setting you
chose. PROTECTION_REASON is the description text you want to
use. For example, "All genomics data must adhere to current organization
policies." For more information, see Deletion protection.
deletionProtectionEnabled is the flag used to enable deletion
protection when creating the instance.
deletionProtectionReason is the flag used to add a description of
the justification for the instance's deletion protection setting you
chose. PROTECTION_REASON is the description text you want to
use. For example, "All genomics data must adhere to current organization
policies." For more information, see Deletion protection.
Set or remove deletion protection on an existing instance
This section shows you how to edit the deletion protection option on an
instance. By default, the feature is deactivated.
If you enable the option, a subsequent attempt to delete the instance fails.
Google Cloud console
To edit Filestore instances using the Google Cloud console,
navigate to the Edit instance page, where you can edit the instance
description, manage IP-based access control rules, and scale the file share
performance:
In the Google Cloud console, go to the Filestore Instances page.
Click the instance ID of the instance you want to edit.
On the Instance details page, click Edit to go to the Edit
instance page.
In the Deletion protection section, select the Enable deletion protection checkbox. We recommend stating the reason for enabling deletion protection to provide more context.
Click Save.
gcloud
To enable deletion protection when you update an instance, use the
gcloud filestore instances update
command similar to the following:
INSTANCE_NAME is the name of the instance you
want to edit. For example, my-genomics-instance.
PROTECTION_REASON is the description text you
want to use. For example, "All genomics data must adhere to current
organization policies." For more information, see Deletion protection.
To deactivate deletion protection when you update an instance, use a command
similar to the following:
To set deletion protection on an instance, specify true in the
deletionProtectionEnabled field. To remove it, specify false in the
field. Use an operation call similar to the following:
deletionProtectionEnabled is the flag used to enable deletion
protection. For example, true or false.
deletionProtectionReason is the flag used to add a description of
the justification for the instance's deletion protection setting you
chose. Only present when the feature is enabled. PROTECTION_REASON
is the description text you want to use. For example, "All genomics data
must adhere to current organization policies." For more information, see
Deletion protection.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eThis guide explains how to enable or disable deletion protection for Filestore instances to prevent accidental removal.\u003c/p\u003e\n"],["\u003cp\u003eDeletion protection can be configured during instance creation or applied to existing instances, with the option to add a description of the reason for enabling it.\u003c/p\u003e\n"],["\u003cp\u003eEnabling deletion protection will cause any attempt to delete the instance to fail, but it doesn't prevent editing the instance or other actions like deleting backups or reverting snapshots.\u003c/p\u003e\n"],["\u003cp\u003eDeletion protection is not available in the Basic HDD or Basic SSD service tiers, and it is disabled by default for all Filestore instances.\u003c/p\u003e\n"],["\u003cp\u003eTo delete a protected instance, deletion protection must first be disabled, which can be done via the Google Cloud console, gcloud command-line tool, or REST API.\u003c/p\u003e\n"]]],[],null,["# Prevent deletion of an instance\n\nThis page shows you how to help prevent the accidental deletion of existing or new Filestore instances.\n\nOverview\n--------\n\nYou can set the deletion protection option when you create an instance or update\nthis option on an existing instance. In both cases, deletion is prevented at the\ninstance level.\n\n### Plan for deletion\n\nIf you are planning to delete an instance, complete the following steps:\n\n- Confirm that it is safe to delete the instance.\n- Confirm that deletion protection is deactivated. If necessary, edit the instance to deactivate deletion protection.\n\n### Limitations\n\nDeletion protection doesn't prevent the following operations:\n\n- Editing an instance\n- Deleting a backup\n- Reverting a snapshot\n- Deleting a file\n\nSet deletion protection on a new instance\n-----------------------------------------\n\nThis section shows you how to set the deletion protection option when\ncreating a new instance. By default, the feature is deactivated.\n\nIf deletion protection is enabled, an attempt to delete the instance fails. \n\n### Google Cloud console\n\n1. In the Google Cloud console, go to the Filestore **Instances** page.\n\n[Go to the Filestore **Instances** page](https://console.cloud.google.com/filestore/instances)\n\n1. Click **Create Instance**.\n2. Follow the instructions noted in [Create an instance](/filestore/docs/creating-instances#google-cloud-console). Before clicking **Create** , add the following specifications:\n 1. In the **Tags** section, expand the **Advanced options** section.\n 2. In the **Deletion protection** section, select the **Enable deletion protection** checkbox. We recommend stating the reason for enabling deletion protection to provide more context.\n3. Click **Create**.\n\n### gcloud\n\n1. [Install and initialize the gcloud CLI](/sdk/docs).\n\n If you already have the gcloud CLI installed, update it: \n\n gcloud components update\n\n2. Run the\n [`gcloud filestore instances create`](/sdk/gcloud/reference/beta/filestore/instances/create)\n command to create a Filestore instance. Follow the instructions\n noted in [Create an instance](/filestore/docs/creating-instances#gcloud).\n Before you press \u003ckbd\u003eEnter\u003c/kbd\u003e, add the following options:\n\n --deletion-protection \\\n --deletion-protection-reason=\u003cvar translate=\"no\"\u003ePROTECTION_REASON\u003c/var\u003e\n\n Where:\n - `--deletion-protection` is the flag used to enable deletion protection when creating the instance.\n - `--deletion-protection-reason` is the flag used to add a description of the justification for the instance's deletion protection setting you chose. \u003cvar translate=\"no\"\u003ePROTECTION_REASON\u003c/var\u003e is the description text you want to use. For example, \"All genomics data must adhere to current organization policies.\" For more information, see [Deletion protection](/filestore/docs/deletion-protection).\n\n### REST API\n\n1. Have gcloud CLI [installed and initialized](/sdk/docs/install), which lets\n you generate an access token for the `Authorization` header.\n\n\n2.\n\n Use [`cURL`](http://curl.haxx.se/) to call the [Filestore API](/filestore/docs/reference/rest/v1/projects.locations.instances/create).\n Follow the instructions noted in [Create an instance](/filestore/docs/creating-instances#api-create),\n adding the following options before running the command: \n\n ```\n \"deletionProtectionEnabled\",\n \"deletionProtectionReason\":\"PROTECTION_REASON\"\n ```\n\n Where:\n - `deletionProtectionEnabled` is the flag used to enable deletion protection when creating the instance.\n - `deletionProtectionReason` is the flag used to add a description of the justification for the instance's deletion protection setting you chose. \u003cvar translate=\"no\"\u003ePROTECTION_REASON\u003c/var\u003e is the description text you want to use. For example, \"All genomics data must adhere to current organization policies.\" For more information, see [Deletion protection](/filestore/docs/deletion-protection).\n\nSet or remove deletion protection on an existing instance\n---------------------------------------------------------\n\nThis section shows you how to edit the deletion protection option on an\ninstance. By default, the feature is deactivated.\n\nIf you enable the option, a subsequent attempt to delete the instance fails. \n\n### Google Cloud console\n\nTo edit Filestore instances using the Google Cloud console,\nnavigate to the **Edit instance** page, where you can edit the instance\ndescription, manage IP-based access control rules, and scale the file share\nperformance:\n\n1. In the Google Cloud console, go to the Filestore **Instances** page.\n\n [Go to the Filestore Instances page](https://console.cloud.google.com/filestore/instances)\n2. Click the instance ID of the instance you want to edit.\n\n3. On the **Instance details** page, click **Edit** to go to the **Edit\n instance** page.\n\n4. In the **Deletion protection** section, select the **Enable deletion protection** checkbox. We recommend stating the reason for enabling deletion protection to provide more context.\n\n5. Click **Save**.\n\n### gcloud\n\nTo enable deletion protection when you update an instance, use the\n[`gcloud filestore instances update`](/sdk/gcloud/reference/filestore/instances/update)\ncommand similar to the following: \n\n gcloud filestore instances update \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e \\\n --deletion-protection \\\n --deletion-protection-reason=\u003cvar translate=\"no\"\u003ePROTECTION_REASON\u003c/var\u003e\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e is the name of the instance you want to edit. For example, `my-genomics-instance`.\n- \u003cvar translate=\"no\"\u003ePROTECTION_REASON\u003c/var\u003e is the description text you want to use. For example, \"All genomics data must adhere to current organization policies.\" For more information, see [Deletion protection](/filestore/docs/deletion-protection).\n\nTo deactivate deletion protection when you update an instance, use a command\nsimilar to the following: \n\n gcloud filestore instances update \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e \\\n --no-deletion-protection\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003eINSTANCE_NAME\u003c/var\u003e is the name of the instance you want to edit. For example, `my-genomics-instance`.\n\nOnce deactivated, the `deletion-protection-reason` field is cleared.\n\n### REST API\n\n1. Have gcloud CLI [installed and initialized](/sdk/docs/install), which lets\n you generate an access token for the `Authorization` header.\n\n\n2.\n\n Use [`cURL`](http://curl.haxx.se/) to call the [Filestore API](/filestore/docs/reference/rest/v1/projects.locations.instances/patch).\n\n To set deletion protection on an instance, specify `true` in the\n `deletionProtectionEnabled` field. To remove it, specify `false` in the\n field. Use an operation call similar to the following: \n\n ```\n curl --request PATCH \\\n 'https://file.googleapis.com/v1/projects/PROJECT/locations/LOCATION/instances?instanceId=NAME?updateMask=deletionProtectionEnabled,deletionProtectionReason' \\\n --header \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n --header 'Accept: application/json' \\\n --header 'Content-Type: application/json' \\\n --data '{\"tier\":\"TIER\",\"networks\":[{\"network\":\"NETWORK\"}],\"fileShares\":[{\"capacityGb\":CAPACITY,\"name\":\"SHARE_NAME\"}], \"deletionProtectionEnabled\": true, \"deletionProtectionReason\": \"PROTECTION_REASON\"}' \\\n --compressed\n ```\n\n Where:\n - `deletionProtectionEnabled` is the flag used to enable deletion protection. For example, `true` or `false`.\n - `deletionProtectionReason` is the flag used to add a description of the justification for the instance's deletion protection setting you chose. Only present when the feature is enabled. \u003cvar translate=\"no\"\u003ePROTECTION_REASON\u003c/var\u003e is the description text you want to use. For example, \"All genomics data must adhere to current organization policies.\" For more information, see [Deletion protection](/filestore/docs/deletion-protection).\n\nWhat's next\n-----------\n\n- [Create a new instance](/filestore/docs/creating-instances).\n- [What is a snapshot?](/filestore/docs/snapshots)\n- [What is a backup?](/filestore/docs/backups)"]]