Deleting a placement group
Delete the placement group.
If you don't have the Nebius Israel command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
View a list of VM instances in the placement group:
yc compute placement-group list-instances --name my-group
Result:
+----------------------+---------------------+---------------+---------+-------------+-------------+ | ID | NAME | ZONE ID | STATUS | EXTERNAL IP | INTERNAL IP | +----------------------+---------------------+---------------+---------+-------------+-------------+ | epdep2kq6dt5uekuhcrd | instance-in-group-1 | il1-b | RUNNING | | 10.129.0.5 | | epdlv1pp54019j09fhue | instance-in-group-2 | il1-b | RUNNING | | 10.129.0.30 | +----------------------+---------------------+---------------+---------+-------------+-------------+
-
Delete the instances in the group:
yc compute instance delete --name instance-in-group-1 yc compute instance delete --name instance-in-group-2
-
Delete the placement group:
yc compute placement-group delete --name my-group
-
Check that the placement group was deleted:
yc compute placement-group list
Result:
+----+------+----------+ | ID | NAME | STRATEGY | +----+------+----------+ +----+------+----------+
Use the delete REST API method for the PlacementGroup resource or the PlacementGroupService/Delete gRPC API call.
With Terraform
For more information about the provider resources, see the documentation on the Terraform
If you change the configuration files, Terraform automatically determines which part of your configuration is already deployed and what should be added or removed.
For more information about the Terraform, see the documentation.
To delete a placement group created with Terraform:
-
Open the Terraform configuration file and delete the fragment with the placement group description.
Example placement group description in a Terraform configuration:
... resource "yandex_compute_placement_group" "group1" { name = "test-pg" folder_id = "abc*********123" description = "my description" } ...
-
In the command line, go to the directory with the Terraform configuration file.
-
Check the configuration using this command:
terraform validate
If the configuration is correct, you will get this message:
Success! The configuration is valid.
-
Run this command:
terraform plan
The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains any errors, Terraform will point them out.
-
Apply the configuration changes:
terraform apply
-
Confirm the changes: type
yes
into the terminal and press Enter.You can verify the changes using the management console
or the CLI command below:yc compute placement-group list