Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini menunjukkan cara membantu mencegah penghapusan instance Filestore yang ada atau yang baru secara tidak sengaja.
Ringkasan
Anda dapat menyetel opsi perlindungan penghapusan saat membuat instance atau memperbarui
opsi ini pada instance yang ada. Dalam kedua kasus tersebut, penghapusan dapat dicegah di tingkat instance.
Merencanakan penghapusan
Jika Anda berencana menghapus instance, selesaikan langkah-langkah berikut:
Pastikan bahwa instance aman untuk dihapus.
Konfirmasi bahwa perlindungan penghapusan dinonaktifkan. Jika perlu, edit instance untuk menonaktifkan perlindungan penghapusan.
Batasan
Perlindungan penghapusan tidak mencegah operasi berikut:
Mengedit instance
Menghapus cadangan
Mengembalikan snapshot
Menghapus file
Menyetel perlindungan penghapusan pada instance baru
Bagian ini menunjukkan cara menyetel opsi perlindungan penghapusan saat
membuat instance baru. Secara default, fitur ini dinonaktifkan.
Jika perlindungan penghapusan diaktifkan, upaya untuk menghapus instance akan gagal.
Google Cloud console
Di konsol Google Cloud , buka halaman Instances Filestore.
Ikuti petunjuk yang tercantum di Membuat instance.
Sebelum mengklik Buat, tambahkan spesifikasi berikut:
Di bagian Tag, luaskan bagian Opsi lanjutan.
Di bagian Deletion protection, centang kotak Enable deletion protection. Sebaiknya nyatakan alasan mengaktifkan perlindungan penghapusan untuk memberikan konteks lebih lanjut.
--deletion-protection adalah tanda yang digunakan untuk mengaktifkan perlindungan penghapusan
saat membuat instance.
--deletion-protection-reason adalah tanda yang digunakan untuk menambahkan deskripsi pembenaran setelan perlindungan penghapusan instance yang Anda pilih. PROTECTION_REASON adalah teks deskripsi yang ingin Anda
gunakan. Misalnya, "Semua data genomik harus mematuhi kebijakan organisasi saat ini." Untuk mengetahui informasi selengkapnya, lihat Perlindungan penghapusan.
deletionProtectionEnabled adalah flag yang digunakan untuk mengaktifkan perlindungan penghapusan saat membuat instance.
deletionProtectionReason adalah tanda yang digunakan untuk menambahkan deskripsi pembenaran setelan perlindungan penghapusan instance yang Anda pilih. PROTECTION_REASON adalah teks deskripsi yang ingin Anda
gunakan. Misalnya, "Semua data genomik harus mematuhi kebijakan organisasi saat ini." Untuk mengetahui informasi selengkapnya, lihat Perlindungan penghapusan.
Menyetel atau menghapus perlindungan penghapusan pada instance yang ada
Bagian ini menunjukkan cara mengedit opsi perlindungan penghapusan pada instance. Secara default, fitur ini dinonaktifkan.
Jika Anda mengaktifkan opsi ini, upaya berikutnya untuk menghapus instance akan gagal.
Google Cloud console
Untuk mengedit instance Filestore menggunakan konsol Google Cloud , buka halaman Edit instance, tempat Anda dapat mengedit deskripsi instance, mengelola aturan kontrol akses berbasis IP, dan menskalakan performa berbagi file:
Di konsol Google Cloud , buka halaman Instances Filestore.
Klik ID instance dari instance yang ingin Anda edit.
Di halaman Instance details, klik Edit untuk membuka halaman Edit
instance.
Di bagian Deletion protection, centang kotak Enable deletion protection. Sebaiknya nyatakan alasan mengaktifkan perlindungan penghapusan untuk memberikan konteks lebih lanjut.
Klik Simpan.
gcloud
Untuk mengaktifkan perlindungan penghapusan saat Anda memperbarui instance, gunakan perintah
gcloud filestore instances update
yang serupa dengan berikut ini:
INSTANCE_NAME adalah nama instance yang ingin
Anda edit. Contoh, my-genomics-instance.
PROTECTION_REASON adalah teks deskripsi yang ingin Anda gunakan. Misalnya, "Semua data genomik harus mematuhi kebijakan organisasi saat ini". Untuk mengetahui informasi selengkapnya, lihat Perlindungan penghapusan.
Untuk menonaktifkan perlindungan penghapusan saat Anda memperbarui instance, gunakan perintah
seperti berikut:
Untuk menyetel perlindungan penghapusan pada instance, tentukan true di kolom
deletionProtectionEnabled. Untuk menghapusnya, tentukan false di
kolom. Gunakan panggilan operasi yang mirip dengan berikut:
deletionProtectionEnabled adalah flag yang digunakan untuk mengaktifkan perlindungan
penghapusan. Misalnya true atau false.
deletionProtectionReason adalah tanda yang digunakan untuk menambahkan deskripsi pembenaran setelan perlindungan penghapusan instance yang Anda pilih. Hanya ada jika fitur diaktifkan. PROTECTION_REASON
adalah teks deskripsi yang ingin Anda gunakan. Misalnya, "Semua data genomik harus mematuhi kebijakan organisasi saat ini". Untuk mengetahui informasi selengkapnya, lihat
Perlindungan penghapusan.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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)"]]