Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Nesta página, mostramos como evitar a exclusão acidental de instâncias do Filestore atuais ou novas.
Visão geral
É possível definir a opção de proteção contra exclusão ao criar uma instância ou atualizar essa opção em uma instância atual. Nos dois casos, a exclusão é feita no nível da
instância.
Planejar a exclusão
Se você planeja excluir uma instância, siga estas etapas:
Confirme se é seguro excluir a instância.
Confirme se a proteção contra exclusão está desativada. Se necessário, edite a
instância para desativar a proteção contra exclusão.
Limitações
A proteção contra exclusão não impede as seguintes operações:
Como editar uma instância
Como excluir um backup
Como reverter um snapshot
Como excluir um arquivo
Definir a proteção contra exclusão em uma nova instância
Nesta seção, mostramos como definir a opção de proteção contra exclusão ao
criar uma instância. Por padrão, o recurso fica desativado.
Se a proteção contra exclusão estiver ativada, ocorrerá uma falha ao tentar excluir a instância.
Google Cloud console
No console Google Cloud , acesse a página Instâncias do Filestore.
Siga as instruções em Criar uma instância.
Antes de clicar em Criar, adicione as seguintes especificações:
Na seção Tags, expanda Opções avançadas.
Na seção Proteção contra exclusão, marque a caixa de seleção Ativar proteção contra exclusão. Recomendamos que você informe o motivo de ativar a proteção contra exclusão para dar mais contexto.
--deletion-protection é a flag usada para ativar a proteção contra exclusão
ao criar a instância.
--deletion-protection-reason é a flag usada para adicionar uma descrição da justificativa para a configuração de proteção contra exclusão da instância escolhida. PROTECTION_REASON é o texto de descrição que você quer usar. Por exemplo, "Todos os dados genômicos precisam obedecer às políticas atuais da organização". Para mais informações, consulte Proteção contra exclusão.
deletionProtectionEnabled é a flag usada para ativar a proteção contra exclusão ao criar a instância.
deletionProtectionReason é a flag usada para adicionar uma descrição da justificativa para a configuração de proteção contra exclusão da instância escolhida. PROTECTION_REASON é o texto de descrição que você quer usar. Por exemplo, "Todos os dados genômicos precisam obedecer às políticas atuais da organização". Para mais informações, consulte Proteção contra exclusão.
Definir ou remover a proteção contra exclusão em uma instância atual
Nesta seção, mostramos como editar a opção de proteção contra exclusão em uma
instância. Por padrão, o recurso fica desativado.
Se você ativar a opção, uma tentativa subsequente de excluir a instância vai falhar.
Google Cloud console
Para editar instâncias do Filestore usando o console Google Cloud ,
navegue até a página Editar instância, em que é possível editar a descrição
da instância, gerenciar regras de controle de acesso baseadas em IP e escalonar o desempenho do compartilhamento
de arquivos:
No console Google Cloud , acesse a página Instâncias do Filestore.
Clique no código da instância que você quer editar.
Na página Detalhes da instância, clique em Editar para acessar a página Editar
instância.
Na seção Proteção contra exclusão, marque a caixa de seleção Ativar proteção contra exclusão. Recomendamos que você informe o motivo de ativar a proteção contra exclusão para dar mais contexto.
Clique em Salvar.
gcloud
Para ativar a proteção contra exclusão ao atualizar uma instância, use o comando
gcloud filestore instances update
semelhante ao seguinte:
INSTANCE_NAME é o nome da instância que você quer editar. Por exemplo, my-genomics-instance.
PROTECTION_REASON é o texto de descrição que você quer usar. Por exemplo, "Todos os dados de genômica precisam obedecer às políticas atuais da organização". Para mais informações, consulte Proteção contra exclusão.
Para desativar a proteção contra exclusão ao atualizar uma instância, use um comando
semelhante ao seguinte:
Para definir a proteção contra exclusão em uma instância, especifique true no campo
deletionProtectionEnabled. Para remover, especifique false no
campo. Use uma chamada de operação semelhante a esta:
deletionProtectionEnabled é a flag usada para ativar a proteção contra exclusão. Por exemplo, true ou false.
deletionProtectionReason é a flag usada para adicionar uma descrição da justificativa para a configuração de proteção contra exclusão da instância escolhida. Presente somente quando o recurso está ativado. PROTECTION_REASON
é o texto de descrição que você quer usar. Por exemplo, "Todos os dados genômicos precisam obedecer às políticas atuais da organização". Para mais informações, consulte
Proteção contra exclusão.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-18 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)"]]