Deleting a file storage
-
Detach the file storage from all the VMs it is attached to.
-
Delete the file storage in Compute Cloud:
Management consoleTerraformAPI- In the management console
, select the folder where your file storage is located. - Select Compute Cloud.
- In the left-hand panel, select
File storages. - In the appropriate file storage row, click
and select Delete. - In the window that opens, click Delete.
If you don't have Terraform, install it and configure the Yandex Cloud provider.
-
Open the Terraform configuration file and delete the fragment with the storage description:
Sample storage description in the Terraform configuration... resource "yandex_compute_filesystem" "default" { name = "fs-name" type = "network-ssd" zone = "ru-central1-a" size = 150 } ...
-
Apply the changes:
-
In the terminal, change to the folder where you edited the configuration file.
-
Make sure the configuration file is correct using the command:
terraform validate
If the configuration is correct, the following message is returned:
Success! The configuration is valid.
-
Run the command:
terraform plan
The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.
-
Apply the configuration changes:
terraform apply
-
Confirm the changes: type
yes
in the terminal and press Enter.
-
You can check the storage deletion using the management console
or this CLI command:yc compute filesystem list
Use the delete REST API method for the Filesystem resource or the FilesystemService/Delete gRPC API call.
- In the management console