[Yandex Cloud documentation](../../../index.md) > [Yandex Compute Cloud](../../index.md) > [Step-by-step guides](../index.md) > Reserved instance pools > Managing instances in a pool

# Managing VMs in a reserved instance pool

{% note warning %}

Reserved instance pools are billable: you pay for the whole unused volume of reserved computing resources of VMs, GPU clusters, and software accelerated networks according to the [Yandex Compute Cloud pricing policy](../../pricing.md). For more information, see [Using reserved instance pools](../../pricing.md#pool).

{% endnote %}

_The reserved instance pool feature is at the [Preview stage](../../../overview/concepts/launch-stages.md)._

You can attach both newly created and existing VMs to your reserved instance pools. For more information, see [Reserved instance pools in Compute Cloud](../../concepts/reserved-pools.md).

{% note info %}

You cannot attach a VM to a reserved instance pool if its configuration ([platform](../../concepts/vm-platforms.md), vCPU, RAM) is different from that specified in the reserved instance pool settings.

{% endnote %}

## Viewing the list of VMs attached to a pool {#list-pool-instances}

To view the list of VMs attached to a reserved instance pool:

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) the reserved instance pool is in.
  1. Navigate to **Compute Cloud**.
  1. In the left-hand panel, select ![image](../../../_assets/console-icons/folder-lock.svg) **VM reserve pools**.
  1. Select the pool.
  1. In the left-hand panel, navigate to ![image](../../../_assets/console-icons/server.svg) **Virtual machines**.

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  1. See the description of the [Yandex Cloud CLI](../../../cli/index.md) command for creating a VM:

      ```bash
      yc compute reserved-instance-pool list --help
      ```
  1. Get a list of reserved instance pools in the default folder:
     
     ```bash
     yc compute reserved-instance-pool list
     ```
     
     Result:
     
     ```text
     +----------------------+------------+---------------+------+
     |          ID          |    NAME    |    ZONE ID    | SIZE |
     +----------------------+------------+---------------+------+
     | fv48qa9iiq19******** | test-pool1 | ru-central1-a |    1 |
     | fv42fbsrso94******** | test-pool2 | ru-central1-a |    1 |
     +----------------------+------------+---------------+------+
     ```
  1. View the list of VMs attached to a pool by specifying its name or ID:

      ```bash
      yc compute reserved-instance-pool list-instances <pool_name_or_ID>
      ```
      
      Result:
      
      ```text
      +----------------------+-------------------+---------------+---------+----------------+-------------+
      |          ID          |       NAME        |    ZONE ID    | STATUS  |  EXTERNAL IP   | INTERNAL IP |
      +----------------------+-------------------+---------------+---------+----------------+-------------+
      | fv4mkphl5q09******** | my-sample-pool-vm | ru-central1-a | RUNNING | 158.160.***.** | 192.168.3.8 |
      | fv4mfp4fj6f0******** | my-second-pool-vm | ru-central1-a | RUNNING | 158.165.***.** | 192.168.3.12 |
      +----------------------+-------------------+---------------+---------+----------------+-------------+
      ```

- API {#api}

  Use the [ListInstances](../../api-ref/ReservedInstancePool/listInstances.md) REST API method for the [ReservedInstancePool](../../api-ref/ReservedInstancePool/index.md) resource or the [ReservedInstancePoolService/ListInstances](../../api-ref/grpc/ReservedInstancePool/listInstances.md) gRPC API call and provide the pool ID in the `reservedInstancePoolId` field (or `reserved_instance_pool_id` for gRPC API).

{% endlist %}

## Creating a new VM attached to a pool {#attach-new-vm}

To create a new VM in a reserved instance pool:

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) the reserved instance pool is in.
  1. Navigate to **Compute Cloud**.
  1. In the left-hand panel, select ![image](../../../_assets/console-icons/folder-lock.svg) **VM reserve pools**.
  1. In the pool row, click ![image](../../../_assets/console-icons/ellipsis.svg) and select ![image](../../../_assets/console-icons/plug-connection.svg) **Create VM**.
  1. Configure the new VM. For more information, see [Creating a VM](../index.md#vm-create).
  1. Click **Create VM**.
  
  The VM will appear in the list. The new VM will get an [IP address](../../../vpc/concepts/address.md) and a [host name](../../../vpc/concepts/address.md#fqdn) (FQDN).

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  1. See the description of the [Yandex Cloud CLI](../../../cli/index.md) command for creating a VM:

      ```bash
      yc compute instance create --help
      ```
  1. Get a list of reserved instance pools in the default folder:
     
     ```bash
     yc compute reserved-instance-pool list
     ```
     
     Result:
     
     ```text
     +----------------------+------------+---------------+------+
     |          ID          |    NAME    |    ZONE ID    | SIZE |
     +----------------------+------------+---------------+------+
     | fv48qa9iiq19******** | test-pool1 | ru-central1-a |    1 |
     | fv42fbsrso94******** | test-pool2 | ru-central1-a |    1 |
     +----------------------+------------+---------------+------+
     ```
  1. Create a virtual machine in the reserved instance pool:

      ```bash
      yc compute instance create \
        --name <VM_name> \
        --zone <availability_zone_ID> \
        --reserved-instance-pool-id <pool_ID> \
        --network-interface subnet-name=<subnet_name>,nat-ip-version=ipv4 \
        --create-boot-disk image-folder-id=standard-images,image-id=<image_ID> \
        --ssh-key <path_to_SSH_key>
      ```

      Where:
      * `--name`: Name of the new VM, The naming requirements are as follows:

          * Length: between 3 and 63 characters.
          * It can only contain lowercase Latin letters, numbers, and hyphens.
          * It must start with a letter and cannot end with a hyphen.

      * `--zone`: ID of the [availability zone](../../../overview/concepts/geo-scope.md) for the new VM. The VM availability zone must be the same as the pool availability zone.
      * `--reserved-instance-pool-id`: ID of the [pool](../../concepts/reserved-pools.md) you are creating the VM in.

          Instead of ID, you can provide the pool's name in the `--reserved-instance-pool-name` parameter.
      * `--network-interface`: VM [network interface](../../concepts/network.md) settings:

          * `subnet-name`: Name of the [subnet](../../../vpc/concepts/network.md#subnet) in the same availability zone of the VM and the pool.
          * `nat-ip-version=ipv4`: [Public IP address](../../../vpc/concepts/address.md#public-addresses). To create a VM without a public IP address, do not include this setting.
      * `--create-boot-disk`: VM boot disk settings:

          * `image-id`: VM boot disk image ID, e.g., [Ubuntu 24.04 LTS](https://yandex.cloud/en/marketplace/products/yc/ubuntu-24-04-lts) image ID. 
      * `--ssh-key`: Path to the [public SSH key](../vm-connect/ssh.md#creating-ssh-keys) file, e.g., `~/.ssh/id_ed25519.pub`. The VM will automatically create a user named `yc-user` for this key.

          When creating a VM from a [Yandex Cloud Marketplace](https://yandex.cloud/en/marketplace) public image, make sure to provide an SSH key, as SSH access with a username and password is disabled by default for such images.

      {% cut "Result:" %}

      ```text
      done (34s)
      id: fv4fjf9qbt57********
      folder_id: b1gt6g8ht345********
      created_at: "2025-05-07T07:46:34Z"
      name: the-first-pool-vm
      zone_id: ru-central1-a
      platform_id: standard-v2
      resources:
        memory: "2147483648"
        cores: "2"
        core_fraction: "100"
      status: RUNNING
      metadata_options:
        gce_http_endpoint: ENABLED
        aws_v1_http_endpoint: ENABLED
        gce_http_token: ENABLED
        aws_v1_http_token: DISABLED
      boot_disk:
        mode: READ_WRITE
        device_name: fv4v5k7u3g3n********
        auto_delete: true
        disk_id: fv4v5k7u3g3n********
      network_interfaces:
        - index: "0"
          mac_address: d0:0d:f9:bd:3a:5f
          subnet_id: fl8dmq91iruu********
          primary_v4_address:
            address: 192.168.7.7
            one_to_one_nat:
              address: 158.160.***.**
              ip_version: IPV4
      serial_port_settings:
        ssh_authorization: OS_LOGIN
      gpu_settings: {}
      fqdn: fv4fjf9qbt57********.auto.internal
      scheduling_policy: {}
      network_settings:
        type: STANDARD
      placement_policy: {}
      hardware_generation:
        legacy_features:
          pci_topology: PCI_TOPOLOGY_V1
      reserved_instance_pool_id: fv4k96kv52t7********
      ```

      {% endcut %}

  1. [Make sure](#list-pool-instances) the VM was attached to the pool.

  For more information about the `yc compute instance create` command, see the [Yandex Cloud CLI reference](../../../cli/cli-ref/compute/cli-ref/instance/create.md).

- API {#api}

  Use the [create](../../api-ref/Instance/create.md) REST API method for the [Instance](../../api-ref/Instance/index.md) resource or the [InstanceService/Create](../../api-ref/grpc/Instance/create.md) gRPC API call, with the pool ID in the `reservedInstancePoolId` field (for gRPC API, `reserved_instance_pool_id`).

{% endlist %}

## Attaching an existing VM to a pool {#attach-existing-vm}

To attach an existing VM to a reserved instance pool:

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) the reserved instance pool is in.
  1. Navigate to **Compute Cloud**.
  1. In the left-hand panel, select ![image](../../../_assets/console-icons/server.svg) **Virtual machines**.
  1. In the VM row, click ![image](../../../_assets/console-icons/ellipsis.svg) and select ![image](../../../_assets/console-icons/plug-connection.svg) **Attach to VM reserve pool**.
  1. In the window that opens, select the reserved instance pool from the list or create a new one.
  1. Click **Attach**.

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  1. See the description of the [Yandex Cloud CLI](../../../cli/index.md) command for updating a VM:

      ```bash
      yc compute instance update --help
      ```
  1. Get a list of reserved instance pools in the default folder:
     
     ```bash
     yc compute reserved-instance-pool list
     ```
     
     Result:
     
     ```text
     +----------------------+------------+---------------+------+
     |          ID          |    NAME    |    ZONE ID    | SIZE |
     +----------------------+------------+---------------+------+
     | fv48qa9iiq19******** | test-pool1 | ru-central1-a |    1 |
     | fv42fbsrso94******** | test-pool2 | ru-central1-a |    1 |
     +----------------------+------------+---------------+------+
     ```
  1. Get a list of VMs in the default folder:

      ```bash
      yc compute instance list
      ```
      
      Result:
      ```text
      +----------------------+-----------------+---------------+---------+----------------------+
      |          ID          |       NAME      |    ZONE ID    | STATUS  |     DESCRIPTION      |
      +----------------------+-----------------+---------------+---------+----------------------+
      | fhm0b28lgfp4******** | first-instance  | ru-central1-a | RUNNING | my first vm via CLI  |
      | fhm9gk85nj7g******** | second-instance | ru-central1-a | RUNNING | my second vm via CLI |
      +----------------------+-----------------+---------------+---------+----------------------+
      ```
  1. Attach the VM to the reserved instance pool of your choice:

      ```bash
      yc compute instance update \
        --id <VM_ID> \
        --reserved-instance-pool-id <pool_ID>
      ```

      Where:
      * `--id`: VM ID.

          Instead of the ID, you can specify the VM name in the `--name` parameter.
      * `--reserved-instance-pool-id`: ID of the [pool](../../concepts/reserved-pools.md) you are attaching the VM to.

          Instead of ID, you can provide the pool's name in the `--reserved-instance-pool-name` parameter.

      {% cut "Result:" %}

      ```text
      done (2s)
      id: fhm0b28lgfp4********
      folder_id: b1gt6g8ht345********
      created_at: "2025-05-07T09:46:04Z"
      name: first-instance
      zone_id: ru-central1-a
      platform_id: standard-v2
      resources:
        memory: "2147483648"
        cores: "2"
        core_fraction: "100"
      status: RUNNING
      metadata_options:
        gce_http_endpoint: ENABLED
        aws_v1_http_endpoint: ENABLED
        gce_http_token: ENABLED
        aws_v1_http_token: DISABLED
      boot_disk:
        mode: READ_WRITE
        device_name: fv45psom2l6o********
        auto_delete: true
        disk_id: fv45psom2l6o********
      network_interfaces:
        - index: "0"
          mac_address: d0:0d:cb:b5:9e:bf
          subnet_id: fl8dmq91iruu********
          primary_v4_address:
            address: 192.168.7.5
            one_to_one_nat:
              address: 158.160.***.**
              ip_version: IPV4
      serial_port_settings:
        ssh_authorization: OS_LOGIN
      gpu_settings: {}
      fqdn: fv4cndcunukt********.auto.internal
      scheduling_policy: {}
      network_settings:
        type: STANDARD
      placement_policy: {}
      hardware_generation:
        legacy_features:
          pci_topology: PCI_TOPOLOGY_V1
      reserved_instance_pool_id: fv48qa9iiq19********
      ```

      {% endcut %}

  1. [Make sure](#list-pool-instances) the VM was attached to the pool.

  For more information about the `yc compute instance update` command, see the [Yandex Cloud CLI reference](../../../cli/cli-ref/compute/cli-ref/instance/update.md).

- API {#api}

  Use the [update](../../api-ref/Instance/update.md) REST API method for the [Instance](../../api-ref/Instance/index.md) resource or the [InstanceService/Update](../../api-ref/grpc/Instance/update.md) gRPC API call, with the pool ID in the `reservedInstancePoolId` field (for gRPC API, `reserved_instance_pool_id`).

{% endlist %}


## Detaching a VM from a pool {#detach-vm}

To detach a VM from a reserved instance pool:

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) the reserved instance pool is in.
  1. Navigate to **Compute Cloud**.
  1. In the left-hand panel, select ![image](../../../_assets/console-icons/server.svg) **Virtual machines**.
  1. In the VM row, click ![image](../../../_assets/console-icons/ellipsis.svg) and select ![image](../../../_assets/console-icons/plug-connection.svg) **Detach from VM reserve pool**.
  1. In the window that opens, click **Detach**.

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  1. See the description of the [Yandex Cloud CLI](../../../cli/index.md) command for updating a VM:

      ```bash
      yc compute instance update --help
      ```
  1. Get a list of reserved instance pools in the default folder:
     
     ```bash
     yc compute reserved-instance-pool list
     ```
     
     Result:
     
     ```text
     +----------------------+------------+---------------+------+
     |          ID          |    NAME    |    ZONE ID    | SIZE |
     +----------------------+------------+---------------+------+
     | fv48qa9iiq19******** | test-pool1 | ru-central1-a |    1 |
     | fv42fbsrso94******** | test-pool2 | ru-central1-a |    1 |
     +----------------------+------------+---------------+------+
     ```
  1. Get a list of VMs in the pool by specifying its name or ID:

      ```bash
      yc compute reserved-instance-pool list-instances <pool_name_or_ID>
      ```
      
      Result:
      
      ```text
      +----------------------+-------------------+---------------+---------+----------------+-------------+
      |          ID          |       NAME        |    ZONE ID    | STATUS  |  EXTERNAL IP   | INTERNAL IP |
      +----------------------+-------------------+---------------+---------+----------------+-------------+
      | fv4mkphl5q09******** | my-sample-pool-vm | ru-central1-a | RUNNING | 158.160.***.** | 192.168.3.8 |
      | fv4mfp4fj6f0******** | my-second-pool-vm | ru-central1-a | RUNNING | 158.165.***.** | 192.168.3.12 |
      +----------------------+-------------------+---------------+---------+----------------+-------------+
      ```
  1. Detach the VM from the specified reserved instance pool:

      ```bash
      yc compute instance update \
        --id <VM_ID> \
        --reserved-instance-pool-id ""
      ```

      Where:
      * `--id`: VM ID.

          Instead of the ID, you can specify the VM name in the `--name` parameter.

      {% cut "Result:" %}

      ```text
      done (5s)
      id: fv4fjf9qbt57********
      folder_id: b1gt6g8ht345********
      created_at: "2025-05-07T07:46:34Z"
      name: first-instance
      zone_id: ru-central1-a
      platform_id: standard-v2
      resources:
        memory: "2147483648"
        cores: "2"
        core_fraction: "100"
      status: RUNNING
      metadata_options:
        gce_http_endpoint: ENABLED
        aws_v1_http_endpoint: ENABLED
        gce_http_token: ENABLED
        aws_v1_http_token: DISABLED
      boot_disk:
        mode: READ_WRITE
        device_name: fv4v5k7u3g3n********
        auto_delete: true
        disk_id: fv4v5k7u3g3n********
      network_interfaces:
        - index: "0"
          mac_address: d0:0d:f9:bd:3a:5f
          subnet_id: fl8dmq91iruu********
          primary_v4_address:
            address: 192.168.7.7
            one_to_one_nat:
              address: 158.160.***.**
              ip_version: IPV4
      serial_port_settings:
        ssh_authorization: OS_LOGIN
      gpu_settings: {}
      fqdn: fv4fjf9qbt57********.auto.internal
      scheduling_policy: {}
      network_settings:
        type: STANDARD
      placement_policy: {}
      hardware_generation:
        legacy_features:
          pci_topology: PCI_TOPOLOGY_V1
      ```

      {% endcut %}

  1. [Make sure](#list-pool-instances) the VM was detached from the pool.

  For more information about the `yc compute instance update` command, see the [Yandex Cloud CLI reference](../../../cli/cli-ref/compute/cli-ref/instance/update.md).

- API {#api}

  Use the [update](../../api-ref/Instance/update.md) REST API method for the [Instance](../../api-ref/Instance/index.md) resource or the [InstanceService/Update](../../api-ref/grpc/Instance/update.md) gRPC API call, with an empty string in the `reservedInstancePoolId` field (for gRPC API, `reserved_instance_pool_id`).

{% endlist %}

#### Useful links {#see-also}

* [Creating a reserved instance pool](create-reserved-pool.md)
* [Updating a reserved instance pool](update-reserved-pool.md)
* [Reserved instance pools in Compute Cloud](../../concepts/reserved-pools.md)