Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
  • Blog
  • Pricing
  • Documentation
Yandex project
© 2025 Yandex.Cloud LLC
Yandex Compute Cloud
    • All guides
      • Creating a placement group
      • Deleting a placement group
      • Creating a VM in a placement group
      • Creating an instance group in a placement group
      • Adding a VM to a placement group
      • Removing a VM from a placement group
      • Getting information about a placement group
      • Removing an instance group from a placement group
      • Configuring VM placement group access permissions
    • Viewing operations with resources
  • Yandex Container Solution
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Release notes
  1. Step-by-step guides
  2. Placement groups
  3. Removing a VM from a placement group

Removing a VM from a placement group

Written by
Yandex Cloud
Updated at May 5, 2025

Remove the VM from the placement group.

You can permanently delete the removed VM or add it back to the placement group.

You can manage placement groups with partition placement using the CLI and API.

Management console
CLI
Terraform
API
  1. In the management console, select the folder the placement group belongs to.
  2. In the list of services, select Compute Cloud.
  3. In the left-hand panel, select Placement groups.
  4. Go to the Virtual machine placement groups tab.
  5. Select the placement group you want to remove the VM from.
  6. Go to the Virtual machines panel.
  7. In the line with the VM, click and select Delete from group.
  8. In the window that opens, click Delete from group.

If you do not have the Yandex Cloud CLI yet, install and initialize it.

The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

  1. View a list of VMs in the placement group:

    yc compute placement-group list-instances --name my-group
    

    Result:

    +----------------------+---------------------+-------------------+---------+-------------+-------------+
    |          ID          |        NAME         |      ZONE ID      | STATUS  | EXTERNAL IP | INTERNAL IP |
    +----------------------+---------------------+-------------------+---------+-------------+-------------+
    | epdep2kq6dt5******** | instance-in-group-1 |   ru-central1-a   | RUNNING |             | 10.129.0.5  |
    | epdlv1pp5401******** | instance-in-group-2 |   ru-central1-a   | RUNNING |             | 10.129.0.30 |
    +----------------------+---------------------+-------------------+---------+-------------+-------------+
    
  2. Stop the VM you want to remove:

    yc compute instance stop instance-in-group-2
    

    Result:

    id: epdlv1pp5401********
    ...
    status: STOPPED
    
  3. Remove the VM from the placement group. To do this, update the VM leaving placement-group-name blank:

    yc compute instance update --name instance-in-group-2 --placement-group-name=""
    
  4. Check that the VM has been removed from the placement group:

    yc compute placement-group list-instances --name my-group
    

    Result:

    +----------------------+---------------------+-------------------+---------+-------------+-------------+
    |          ID          |        NAME         |      ZONE ID      | STATUS  | EXTERNAL IP | INTERNAL IP |
    +----------------------+---------------------+-------------------+---------+-------------+-------------+
    | epdep2kq6dt5******** | instance-in-group-1 |   ru-central1-a   | RUNNING |             | 10.129.0.5  |
    +----------------------+---------------------+-------------------+---------+-------------+-------------+
    

With Terraform, you can quickly create a cloud infrastructure in Yandex Cloud and manage it using configuration files. These files store the infrastructure description written in HashiCorp Configuration Language (HCL). If you change the configuration files, Terraform automatically detects which part of your configuration is already deployed, and what should be added or removed.

Terraform is distributed under the Business Source License. The Yandex Cloud provider for Terraform is distributed under the MPL-2.0 license.

For more information about the provider resources, see the documentation on the Terraform website or mirror website.

If you do not have Terraform yet, install it and configure its Yandex Cloud provider.

To remove a VM created with Terraform from a placement group:

  1. Open the VM configuration file and delete the placement_group_id parameter.

    Here is an example of the VM configuration file structure:

    ...
    resource "yandex_compute_instance" "vm-1" {
      name        = "my-vm"
      platform_id = "standard-v3"
      placement_policy {
        placement_group_id = "${yandex_compute_placement_group.group1.id}"
      }
    }
    
    resource "yandex_compute_placement_group" "group1" {
      name = "test-pg"
    }
    ...
    
  2. In the command line, go to the directory with the Terraform configuration file.

  3. Check the configuration using this command:

    terraform validate
    

    If the configuration is correct, you will get this message:

    Success! The configuration is valid.
    
  4. Run this command:

    terraform plan
    

    The terminal will display a list of resources with their parameters. No changes will be made at this step. If the configuration contains any errors, Terraform will point them out.

  5. Apply the configuration changes:

    terraform apply
    
  6. Confirm the changes: type yes into the terminal and press Enter.

    You can check the changes in the management console.

Use the update REST API method for the Instance resource or the InstanceService/Update gRPC API call.

Was the article helpful?

Previous
Adding a VM to a placement group
Next
Getting information about a placement group
Yandex project
© 2025 Yandex.Cloud LLC