Deleting a GPU cluster
Before deleting a GPU cluster, make sure to delete all its VMs.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
-
See the description of the CLI command for deleting a GPU cluster :
yc compute gpu-cluster delete --help -
Get a list of GPU clusters in the default folder:
yc compute gpu-cluster list -
Select
IDorNAMEof the GPU cluster in question, e.g.,first-gpu-cluster. -
Delete the GPU cluster:
yc compute gpu-cluster delete first-gpu-cluster
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
-
Open the Terraform configuration file and delete the section specifying the GPU cluster:
Example of specifying a GPU cluster in Terraform configuration
... resource "yandex_compute_gpu_cluster" "default" { name = "gpu-cluster-name" interconnect_type = "infiniband" zone = "ru-central1-a" labels = { environment = "test" } } ... -
Apply the changes:
-
In the terminal, go to the directory where you edited the configuration file.
-
Make sure the configuration file is correct using this command:
terraform validateIf the configuration is correct, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.
-
Apply the changes:
terraform apply -
Type
yesand press Enter to confirm the changes.
-
You can check the GPU cluster deletion using the management console
yc compute gpu-cluster list