[Yandex Cloud documentation](../../index.md) > [Yandex Managed Service for OpenSearch](../index.md) > [Step-by-step guides](index.md) > Clusters > Managing cluster hosts > Managing host groups

# Managing OpenSearch host groups


In a Managed Service for OpenSearch cluster, you can manage [host groups](../concepts/host-roles.md):

* [Get a list of host groups in a cluster](#list-groups).
* [Create a host group](#add-host-group).
* [Update the configuration of a host group](#update-host-group), including adding new hosts to it or removing them.
* [Delete a host group](#delete-host-group).

You can also [get a list of cluster hosts](#list-hosts).

For information about migrating host groups in a Managed Service for OpenSearch cluster to a different [availability zone](../../overview/concepts/geo-scope.md), see [this guide](host-migration.md).

## Getting a list of host groups in a cluster {#list-groups}

{% list tabs group=instructions %}

- Management console {#console}

    1. In the [management console](https://console.yandex.cloud), navigate to the folder page.
    1. Navigate to **Managed Service for&nbsp;OpenSearch**.
    1. Locate the cluster you need in the list, click its name, and select the ![host-groups.svg](../../_assets/console-icons/copy-transparent.svg) **Node groups** tab.

- 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.

    To get a list of host groups in a cluster, get the OpenSearch cluster details:

    ```bash
    yc managed-opensearch cluster get <cluster_name_or_ID>
    ```

    You can find the list of host groups in the `config.opensearch.node_groups` and `config.dashboards.node_groups` parameters.

    You can get the cluster name and ID with the [list of clusters in the folder](cluster-list.md#list-clusters).

- REST API {#api}

    1. [Get an IAM token for API authentication](../api-ref/authentication.md) and put it into an environment variable:

        ```bash
        export IAM_TOKEN="<IAM_token>"
        ```

    1. Call the [Cluster.Get](../api-ref/Cluster/get.md) method, e.g., via the following [cURL](https://curl.se/) request:

        ```bash
        curl \
            --request GET \
            --header "Authorization: Bearer $IAM_TOKEN" \
            --url 'https://mdb.api.cloud.yandex.net/managed-opensearch/v1/clusters/<cluster_ID>'
        ```

        You can get the cluster ID with the [list of clusters in the folder](#list-clusters).

    1. Check the [server response](../api-ref/Cluster/get.md#yandex.cloud.mdb.opensearch.v1.Cluster) to make sure your request was successful.

        You can find available host groups in the `nodeGroups` parameters.

- gRPC API {#grpc-api}

    1. [Get an IAM token for API authentication](../api-ref/authentication.md) and put it into an environment variable:

        ```bash
        export IAM_TOKEN="<IAM_token>"
        ```

    1. Clone the [cloudapi](https://github.com/yandex-cloud/cloudapi) repository:
       
       ```bash
       cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
       ```
       
       Below, we assume that the repository contents reside in the `~/cloudapi/` directory.
    1. Call the [ClusterService.Get](../api-ref/grpc/Cluster/get.md) method, e.g., via the following [gRPCurl](https://github.com/fullstorydev/grpcurl) request:

        ```bash
        grpcurl \
            -format json \
            -import-path ~/cloudapi/ \
            -import-path ~/cloudapi/third_party/googleapis/ \
            -proto ~/cloudapi/yandex/cloud/mdb/opensearch/v1/cluster_service.proto \
            -rpc-header "Authorization: Bearer $IAM_TOKEN" \
            -d '{
                  "cluster_id": "<cluster_ID>"
                }' \
            mdb.api.cloud.yandex.net:443 \
            yandex.cloud.mdb.opensearch.v1.ClusterService.Get
        ```

        You can get the cluster ID with the [list of clusters in the folder](#list-clusters).

    1. Check the [server response](../api-ref/grpc/Cluster/get.md#yandex.cloud.mdb.opensearch.v1.Cluster) to make sure your request was successful.

        You can find available host groups in the `nodeGroups` parameters.

{% endlist %}

## Creating a host group {#add-host-group}

The following limitations apply when creating host groups:

* A Managed Service for OpenSearch cluster may contain only one `Dashboards` host group.
* If you are adding a group of `OpenSearch` hosts with the `MANAGER` role, make sure there are at least three hosts with this role.

{% note warning %}

If you add a host group with the `MANAGER` role to a cluster where this role is assigned to hosts with the `DATA` role, you will be unable to delete that group. The only way to restore the previous host configuration is to [restore the cluster from a backup](cluster-backups.md#restore).

{% endnote %}

To create a host group:

{% list tabs group=instructions %}

- Management console {#console}

    1. In the [management console](https://console.yandex.cloud), navigate to the folder page.
    1. Navigate to **Managed Service for&nbsp;OpenSearch**.
    1. Locate the cluster you need in the list, click its name, and select the ![host-groups.svg](../../_assets/console-icons/copy-transparent.svg) **Node groups** tab.
    1. Click **Create node group**.
    1. Specify the group parameters:

        * [Group type](../concepts/host-roles.md): `OpenSearch` or `Dashboards`.
        * Name. It must be unique within the cluster.
        * For an `OpenSearch` host group, select the [host role](../concepts/host-roles.md).
        * Platform, host type, and host class.

            The host class defines the specifications of virtual machines OpenSearch nodes will be deployed on. All available options are listed under [Host classes](../concepts/instance-types.md).

        * [Disk type](../concepts/storage.md) and data storage size.

            The type you select determines the increments for changing the disk size:
            
            * Network HDDs and SSDs: In increments of 1 GB.
            * Local SSDs:
                * For **Intel Cascade Lake**: In increments of 100 GB.
                * For **Intel Ice Lake** and **AMD Zen 4**: In 368 GB increments.
            * Non-replicated SSDs: In increments of 93 GB.

        * Optionally, set up automatic storage expansion:

            * In the **Increase size** field, specify the conditions for the actions below:
            
                * Storage expansion during the [next maintenance window](../concepts/maintenance.md#maintenance-window) once the fill level exceeds the specified percentage. If you set this condition, configure the maintenance window schedule.
                * Storage expansion immediately once the fill level exceeds the specified percentage.
                
                    {% note warning %}
            
                    If you set both conditions, make sure the immediate expansion threshold is higher than the scheduled one.
            
                    {% endnote %}
            
            * Specify the maximum storage size after the expansion in the **Maximum storage size** field.
            
            
            {% note warning %}
            
            * You cannot decrease the storage size after automatic expansion.
            * When scaling your storage, the cluster hosts will be unavailable.
            
            {% endnote %}

        * Host distribution across availability zones and subnets.

        * Number of hosts to create.

        
        * Enable **Public access** if you want to allow [connections](connect/index.md) to hosts over the internet.


    1. Click **Create node group**.

- 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.

    To create a host group, run this command:

    
    ```bash
    yc managed-opensearch node-group add --cluster-name <cluster_name> \
       --opensearch-node-group name=<OpenSearch_host_group_name>,`
                              `resource-preset-id=<host_class>,`
                              `disk-size=<disk_size_in_bytes>,`
                              `disk-type-id=<disk_type>,`
                              `hosts-count=<number_of_hosts_in_group>,`
                              `zone-ids=<availability_zones>,`
                              `subnet-names=<subnet_names>,`
                              `assign-public-ip=<allow_public_access_to_hosts>,`
                              `roles=<host_roles> \
       --dashboards-node-group name=<Dashboards_host_group_name>,`
                              `resource-preset-id=<host_class>,`
                              `disk-size=<disk_size_in_bytes>,`
                              `disk-type-id=<disk_type>,`
                              `hosts-count=<number_of_hosts_in_group>,`
                              `zone-ids=<availability_zones>,`
                              `subnet-names=<subnet_names>,`
                              `assign-public-ip=<allow_public_access_to_hosts>
    ```


    Specify the required parameters in the command depending on what type of host group you want to create:

    * `--opensearch-node-group`: `OpenSearch` host group configuration, where:
    
       * `resource-preset-id`: Host class that defines the specifications of virtual machines the OpenSearch nodes will be deployed on. All available options are listed under [Host classes](../concepts/instance-types.md).
       * `disk-size`: Disk size, in bytes. The minimum and maximum values depend on the selected host class.
       * `disk-type-id`: [Disk type](../concepts/storage.md).
       * `zone-ids`: [Availability zones](../../overview/concepts/geo-scope.md). Separate zones with commas and enclose them in square brackets, e.g.:
    
          ```bash
          zone-ids=[ru-central1-a,ru-central1-b,ru-central1-d]
          ```
    
       
       * `subnet-names`: Names of the subnets in the specified availability zones. Separate subnets with commas and enclose them in square brackets, e.g.:
    
          ```bash
          subnet-names=[default-ru-central1-a,default-ru-central1-b,default-ru-central1-d]
          ```
    
          You can specify the `subnet-ids` parameter with network IDs instead of `subnet-names`. Separate IDs with commas and enclosed them in square brackets, e.g.:
    
          ```bash
          subnet-ids=[e9bp8qmchqh2********,e2l963gkhobo********,fl8klaabecc3********]
          ```
    
    
       * `roles`: [Host roles](../concepts/host-roles.md). The possible values are:
    
          * `data`: Assigns the `DATA` role only.
          * `manager`: Assigns the `MANAGER` role only.
          * `data+manager` or `manager+data`: Assigns both roles.
    
    * `--dashboards-node-group`: `Dashboards` host group configuration. It is configured just as the `OpenSearch` host group, except for the host roles. You do not need to set up any roles for the `Dashboards` group.

- Terraform {#tf}

    1. Open the current Terraform configuration file with the infrastructure plan.

        For more on how to create such a file, see the [Creating a cluster](cluster-create.md) section.

        For a complete list of configurable Managed Service for OpenSearch cluster fields, see [this Terraform provider guide](../../terraform/resources/mdb_opensearch_cluster.md).

    1. To create a group of `OpenSearch` hosts, add the `node_groups` section to `opensearch`:

        ```hcl
        resource "yandex_mdb_opensearch_cluster" "<cluster_name>" {
          ...
          config {
            opensearch {
              ...
              node_groups {
                name             = "<virtual_host_group_name>"
                assign_public_ip = <allow_public_access_to_hosts>
                hosts_count      = <number_of_hosts>
                zone_ids         = ["<list_of_availability_zones>"]
                subnet_ids       = ["<list_of_subnet_IDs>"]
                roles            = ["<role_list>"]
                resources {
                  resource_preset_id = "<host_class>"
                  disk_size          = <storage_size_in_bytes>
                  disk_type_id       = "<disk_type>"
                }
              }
            }
            ...
          }
        }
        ```

        Where:

        * `assign_public_ip`: Public access to the host, `true` or `false`.
        * `roles`: Host roles, `DATA` and `MANAGER`.

    1. To create a group of `Dashboards` hosts, add the `dashboards` section to `config`:

        ```hcl
        resource "yandex_mdb_opensearch_cluster" "<cluster_name>" {
          ...
          config {
            ...
            dashboards {
              node_groups {
               name             = "<virtual_host_group_name>"
                assign_public_ip = <allow_public_access_to_hosts>
                hosts_count      = <number_of_hosts>
                zone_ids         = ["<list_of_availability_zones>"]
                subnet_ids       = ["<list_of_subnet_IDs>"]
                resources {
                  resource_preset_id = "<host_class>"
                  disk_size          = <storage_size_in_bytes>
                  disk_type_id       = "<disk_type>"
                }
              }
            }
          }
        }
        ```

        Where `assign_public_ip` is public access to the host, `true` or `false`.

        A cluster may contain only one `Dashboards` host group.

    1. Make sure the settings are correct.

        1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
        1. Run this command:
        
           ```bash
           terraform validate
           ```
        
           Terraform will show any errors found in your configuration files.

    1. Confirm updating the resources.

        1. Run this command to view the planned changes:
        
           ```bash
           terraform plan
           ```
        
           If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
        
        1. If everything looks correct, apply the changes:
           1. Run this command:
        
              ```bash
              terraform apply
              ```
        
           1. Confirm updating the resources.
           1. Wait for the operation to complete.

        {% note warning "Timeouts" %}
        
        The Terraform provider sets the following timeouts for Managed Service for OpenSearch cluster operations:
        
        * Creating a cluster, including by restoring it from a backup: 30 minutes.
        * Updating a cluster: 60 minutes.
        * Deleting a cluster: 15 minutes.
        
        Operations exceeding the timeout are aborted.
        
        {% cut "How do I change these limits?" %}
        
        Add a `timeouts` section to the cluster description, e.g.:
        
        ```hcl
        resource "yandex_mdb_opensearch_cluster" "<cluster_name>" {
          ...
          timeouts {
            create = "1h30m" # 1 hour 30 minutes
            update = "2h"    # 2 hours
            delete = "30m"   # 30 minutes
          }
        }
        ```
        
        {% endcut %}
        
        {% endnote %}

- REST API {#api}

    1. [Get an IAM token for API authentication](../api-ref/authentication.md) and put it into an environment variable:

        ```bash
        export IAM_TOKEN="<IAM_token>"
        ```

    1. Create a file named `body.json` and paste the following code into it:

        
        ```json
        {
            "nodeGroupSpec": {
                "name": "<host_group_name>",
                "resources": {
                    "resourcePresetId": "<host_class>",
                    "diskSize": "<storage_size_in_bytes>",
                    "diskTypeId": "<disk_type>"
                },
                "roles": ["<role_1>","<role_2>"],
                "hostsCount": "<number_of_hosts>",
                "zoneIds": [
                    "<availability_zone_1>",
                    "<availability_zone_2>",
                    "<availability_zone_3>"
                ],
                "subnetIds": [
                    "<subnet_1_ID>",
                    "<subnet_2_ID>",
                    "<subnet_3_ID>"
                ],
                "assignPublicIp": <allow_public_access_to_hosts>,
                "diskSizeAutoscaling": {
                    "plannedUsageThreshold": "<scheduled_expansion_percentage>",
                    "emergencyUsageThreshold": "<immediate_expansion_percentage>",
                    "diskSizeLimit": "<maximum_storage_size_in_bytes>"
                }
            }
        }
        ```


        Where `nodeGroups` contain the host settings:

        * `name`: Host group name.
        * `resources`: Cluster resources:

            * `resourcePresetId`: [Host class](../concepts/instance-types.md).
            * `diskSize`: Disk size, in bytes.
            * `diskTypeId`: [Disk type](../concepts/storage.md).

        * `roles` (`OpenSearch` hosts only): List of [host roles](../concepts/host-roles.md), `DATA` or `MANAGER`. You can assign one or both roles for a group.
        * `hostsCount`: Number of hosts in the group. Minimum number of `DATA` and `Dashboards` hosts: one; minimum number of `MANAGER` hosts: three.
        * `zoneIds`: List of availability zones the cluster hosts are located in.

        
        * `subnetIds`: List of subnet IDs.
        * `assignPublicIp`: Permission to [connect](connect/index.md) to the host from the internet, `true` or `false`.


        * `diskSizeAutoscaling`: Automatic storage expansion settings:

            * `plannedUsageThreshold`: Storage usage percentage to trigger a storage expansion during the next maintenance window.

                Use a value between `0` and `100`%. The default value is `0`, i.e., automatic expansion is disabled.

                If you set this condition, [configure the maintenance window schedule](update.md#change-additional-settings) before creating your host group.

            * `emergencyUsageThreshold`: Storage usage percentage to trigger an immediate storage expansion.

                Use a value between `0` and `100`%. The default value is `0`, i.e., automatic expansion is disabled.

                {% note warning %}

                If you specify both thresholds, `emergencyUsageThreshold` must not be less than `plannedUsageThreshold`.

                {% endnote %}

            * `diskSizeLimit`: Maximum storage size, in bytes, that can be set if the usage percentage reaches one of the specified thresholds.

            
            {% note warning %}
            
            * You cannot decrease the storage size after automatic expansion.
            * When scaling your storage, the cluster hosts will be unavailable.
            
            {% endnote %}


    1. To create an `OpenSearch` host group:

        1. Call the [Cluster.AddOpenSearchNodeGroup](../api-ref/Cluster/addOpenSearchNodeGroup.md) method, e.g., via the following [cURL](https://curl.se/) request:

            ```bash
            curl \
                --request POST \
                --header "Authorization: Bearer $IAM_TOKEN" \
                --header "Content-Type: application/json" \
                --url 'https://mdb.api.cloud.yandex.net/managed-opensearch/v1/clusters/<cluster_ID>/opensearch/node_groups' \
                --data "@body.json"
            ```

            You can get the cluster ID with the [list of clusters in the folder](cluster-list.md#list-clusters).

        1. View the [server response](../api-ref/Cluster/addOpenSearchNodeGroup.md#yandex.cloud.operation.Operation) to make sure your request was successful.

    1. To create a `Dashboards` host group:

        1. Call the [Cluster.AddDashboardsNodeGroup](../api-ref/Cluster/addDashboardsNodeGroup.md) method, e.g., via the following [cURL](https://curl.se/) request:

            ```bash
            curl \
                --request POST \
                --header "Authorization: Bearer $IAM_TOKEN" \
                --header "Content-Type: application/json" \
                --url 'https://mdb.api.cloud.yandex.net/managed-opensearch/v1/clusters/<cluster_ID>/dashboards/node_groups' \
                --data "@body.json"
            ```

            You can get the cluster ID with the [list of clusters in the folder](cluster-list.md#list-clusters).

        1. Check the [server response](../api-ref/Cluster/addDashboardsNodeGroup.md#yandex.cloud.operation.Operation) to make sure your request was successful.

- gRPC API {#grpc-api}

    1. [Get an IAM token for API authentication](../api-ref/authentication.md) and put it into an environment variable:

        ```bash
        export IAM_TOKEN="<IAM_token>"
        ```

    1. Clone the [cloudapi](https://github.com/yandex-cloud/cloudapi) repository:
       
       ```bash
       cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
       ```
       
       Below, we assume that the repository contents reside in the `~/cloudapi/` directory.
    1. Create a file named `body.json` and paste the following code into it:

        
        ```json
        {
            "node_group_spec": {
                "name": "<host_group_name>",
                "resources": {
                    "resource_preset_id": "<host_class>",
                    "disk_size": "<storage_size_in_bytes>",
                    "disk_type_id": "<disk_type>"
                },
                "roles": ["<role_1>","<role_2>"],
                "hosts_count": "<number_of_hosts>",
                "zone_ids": [
                    "<availability_zone_1>",
                    "<availability_zone_2>",
                    "<availability_zone_3>"
                ],
                "subnet_ids": [
                    "<subnet_1_ID>",
                    "<subnet_2_ID>",
                    "<subnet_3_ID>"
                ],
                "assign_public_ip": <allow_public_access_to_hosts>,
                "disk_size_autoscaling": {
                    "planned_usage_threshold": "<scheduled_expansion_percentage>",
                    "emergency_usage_threshold": "<immediate_expansion_percentage>",
                    "disk_size_limit": "<maximum_storage_size_in_bytes>"
                }
            }
        }
        ```


        Where `node_groups` contain the host settings:

        * `name`: Host group name.
        * `resources`: Cluster resources:

            * `resource_preset_id`: [Host class](../concepts/instance-types.md).
            * `disk_size`: Disk size, in bytes.
            * `disk_type_id`: [Disk type](../concepts/storage.md).

        * `roles` (`OpenSearch` hosts only): List of [host roles](../concepts/host-roles.md), `DATA` or `MANAGER`. You can assign one or both roles for a group.
        * `hosts_count`: Number of hosts in the group. Minimum number of `DATA` and `Dashboards` hosts: one; minimum number of `MANAGER` hosts: three.
        * `zone_ids`: List of availability zones the cluster hosts are located in.

        
        * `subnet_ids`: List of subnet IDs.
        * `assign_public_ip`: Permission to [connect](connect/index.md) to the host from the internet, `true` or `false`.


        * `disk_size_autoscaling`: Automatic storage expansion settings:

            * `planned_usage_threshold`: Storage usage percentage to trigger a storage expansion during the next maintenance window.

                Use a value between `0` and `100`%. The default value is `0`, i.e., automatic expansion is disabled.

                If you set this condition, [configure the maintenance window schedule](update.md#change-additional-settings) before creating your host group.

            * `emergency_usage_threshold`: Storage usage percentage to trigger an immediate storage expansion.

                Use a value between `0` and `100`%. The default value is `0`, i.e., automatic expansion is disabled.

                {% note warning %}

                If you specify both thresholds, `emergency_usage_threshold` must not be less than `planned_usage_threshold`.

                {% endnote %}

            * `disk_size_limit`: Maximum storage size, in bytes, that can be set if the usage percentage reaches one of the specified thresholds.

            
            {% note warning %}
            
            * You cannot decrease the storage size after automatic expansion.
            * When scaling your storage, the cluster hosts will be unavailable.
            
            {% endnote %}


    1. To create an `OpenSearch` host group:

        1. Call the [ClusterService.AddOpenSearchNodeGroup](../api-ref/grpc/Cluster/addOpenSearchNodeGroup.md) method, e.g., via the following [gRPCurl](https://github.com/fullstorydev/grpcurl) request:

            ```bash
            grpcurl \
                -format json \
                -import-path ~/cloudapi/ \
                -import-path ~/cloudapi/third_party/googleapis/ \
                -proto ~/cloudapi/yandex/cloud/mdb/opensearch/v1/cluster_service.proto \
                -rpc-header "Authorization: Bearer $IAM_TOKEN" \
                -d @ \
                mdb.api.cloud.yandex.net:443 \
                yandex.cloud.mdb.opensearch.v1.ClusterService.AddOpenSearchNodeGroup \
                < body.json
            ```

        1. View the [server response](../api-ref/grpc/Cluster/addDashboardsNodeGroup.md#yandex.cloud.operation.Operation) to make sure your request was successful.

    1. To create a `Dashboards` host group:

        1. Call the [ClusterService.AddDashboardsNodeGroup](../api-ref/grpc/Cluster/addDashboardsNodeGroup.md) method, e.g., via the following [gRPCurl](https://github.com/fullstorydev/grpcurl) request:

            ```bash
            grpcurl \
                -format json \
                -import-path ~/cloudapi/ \
                -import-path ~/cloudapi/third_party/googleapis/ \
                -proto ~/cloudapi/yandex/cloud/mdb/opensearch/v1/cluster_service.proto \
                -rpc-header "Authorization: Bearer $IAM_TOKEN" \
                -d @ \
                mdb.api.cloud.yandex.net:443 \
                yandex.cloud.mdb.opensearch.v1.ClusterService.AddDashboardsNodeGroup \
                < body.json
            ```

        1. Check the [server response](../api-ref/grpc/Cluster/addDashboardsNodeGroup.md#yandex.cloud.operation.Operation) to make sure your request was successful.

{% endlist %}

## Updating a host group configuration {#update-host-group}

{% list tabs group=instructions %}

- Management console {#console}

    1. In the [management console](https://console.yandex.cloud), navigate to the folder page.
    1. Navigate to **Managed Service for&nbsp;OpenSearch**.
    1. Locate the cluster you need in the list, click its name, and select the ![host-groups.svg](../../_assets/console-icons/copy-transparent.svg) **Node groups** tab.
    1. Click ![image](../../_assets/console-icons/ellipsis.svg) in the row with the group you need and select **Edit**.
    1. Change the host group settings:

        * [Host roles](../concepts/host-roles.md) (for `OpenSearch` host groups only).
        * Platform, host type, and host class.

            The host class defines the specifications of virtual machines OpenSearch nodes will be deployed on. All available options are listed under [Host classes](../concepts/instance-types.md).

        * Disk size.

            
            Disk resizing increments depend on the disk type:

            * Network HDDs and SSDs: In increments of 1 GB.

            * Local SSDs:
                * For **Intel Cascade Lake**: In increments of 100 GB.
                * For **Intel Ice Lake** and **AMD Zen 4**: In 368 GB increments.
            * Non-replicated SSDs: In increments of 93 GB.


        * Optionally, set up automatic storage expansion:

            * In the **Increase size** field, specify the conditions for the actions below:
            
                * Storage expansion during the [next maintenance window](../concepts/maintenance.md#maintenance-window) once the fill level exceeds the specified percentage. If you set this condition, configure the maintenance window schedule.
                * Storage expansion immediately once the fill level exceeds the specified percentage.
                
                    {% note warning %}
            
                    If you set both conditions, make sure the immediate expansion threshold is higher than the scheduled one.
            
                    {% endnote %}
            
            * Specify the maximum storage size after the expansion in the **Maximum storage size** field.
            
            
            {% note warning %}
            
            * You cannot decrease the storage size after automatic expansion.
            * When scaling your storage, the cluster hosts will be unavailable.
            
            {% endnote %}

        * Host distribution across availability zones and subnets.

        * Number of hosts.

        
        * Public access to hosts.


    1. Click **Save**.

- 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.

    To update the configuration of a host group, run this command:

    ```bash
    yc managed-opensearch node-group update --cluster-name <cluster_name> \
       --node-group-name <host_group_name> \
       --resource-preset-id <host_class> \
       --disk-size <disk_size_in_bytes> \
       --hosts-count <number_of_hosts_in_group> \
       --roles <host_roles>
    ```

    Specify the required parameters in the command depending on the type of host group configuration you need:

    * `--node-group-name`: Name of the host group you need to update.
    * `--resource-preset-id`: New host class. that defines the specifications of virtual machines the OpenSearch nodes will be deployed on. All available options are listed under [Host classes](../concepts/instance-types.md).
    * `--disk-size`: New disk size, in bytes. The minimum and maximum values depend on the selected host class.
    * `--hosts-count`: New number of hosts in the group.
    * `--roles`: New [host roles](../concepts/host-roles.md). The possible values are:

      * `data`: Assigns the `DATA` role only.
      * `manager`: Assigns the `MANAGER` role only.
      * `data+manager` or `manager+data`: Assigns both roles.

- Terraform {#tf}

    1. Open the current Terraform configuration file with the infrastructure plan.

        For more on how to create such a file, see the [Creating a cluster](cluster-create.md) section.

        For a complete list of configurable Managed Service for OpenSearch cluster fields, see [this Terraform provider guide](../../terraform/resources/mdb_opensearch_cluster.md).

    1. To update the configuration of an `OpenSearch` host group, edit the parameters of the `node_groups` section under `opensearch`:

        ```hcl
        resource "yandex_mdb_opensearch_cluster" "<cluster_name>" {
          ...
          opensearch {
            ...
            node_groups {
              name             = "<virtual_host_group_name>"
              assign_public_ip = <allow_public_access_to_hosts>
              hosts_count      = <number_of_hosts>
              roles            = ["<role_list>"]
              resources {
                resource_preset_id = "<host_class>"
                disk_size          = <storage_size_in_bytes>
                disk_type_id       = "<disk_type>"
              }
            }
            ...
          }
        }
        ```

        Where:

        * `assign_public_ip`: Public access to the host, `true` or `false`.
        * `roles`: Host roles, `DATA` and `MANAGER`.

    1. To update the configuration of a `Dashboards` host group, edit the `dashboards` section parameters:

        ```hcl
        resource "yandex_mdb_opensearch_cluster" "<cluster_name>" {
          ...
          dashboards {
            node_groups {
              name             = "<virtual_host_group_name>"
              assign_public_ip = <allow_public_access_to_hosts>
              hosts_count      = <number_of_hosts>
              resources {
                resource_preset_id = "<host_class>"
                disk_size          = <storage_size_in_bytes>
                disk_type_id       = "<disk_type>"
              }
            }
          }
        }
        ```

        Where `assign_public_ip` is public access to the host, `true` or `false`.

    1. Make sure the settings are correct.

        1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
        1. Run this command:
        
           ```bash
           terraform validate
           ```
        
           Terraform will show any errors found in your configuration files.

    1. Confirm updating the resources.

        1. Run this command to view the planned changes:
        
           ```bash
           terraform plan
           ```
        
           If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
        
        1. If everything looks correct, apply the changes:
           1. Run this command:
        
              ```bash
              terraform apply
              ```
        
           1. Confirm updating the resources.
           1. Wait for the operation to complete.

        {% note warning "Timeouts" %}
        
        The Terraform provider sets the following timeouts for Managed Service for OpenSearch cluster operations:
        
        * Creating a cluster, including by restoring it from a backup: 30 minutes.
        * Updating a cluster: 60 minutes.
        * Deleting a cluster: 15 minutes.
        
        Operations exceeding the timeout are aborted.
        
        {% cut "How do I change these limits?" %}
        
        Add a `timeouts` section to the cluster description, e.g.:
        
        ```hcl
        resource "yandex_mdb_opensearch_cluster" "<cluster_name>" {
          ...
          timeouts {
            create = "1h30m" # 1 hour 30 minutes
            update = "2h"    # 2 hours
            delete = "30m"   # 30 minutes
          }
        }
        ```
        
        {% endcut %}
        
        {% endnote %}

- REST API {#api}

    1. [Get an IAM token for API authentication](../api-ref/authentication.md) and put it into an environment variable:

        ```bash
        export IAM_TOKEN="<IAM_token>"
        ```

    1. Create a file named `body.json` and paste the following code into it:

        {% note warning %}
        
        The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the `updateMask` parameter as a single comma-separated string.
        
        {% endnote %}

        
        ```json
        {
            "updateMask": "resources,hostsCount,zoneIds,subnetIds,assignPublicIp,diskSizeAutoscaling",
            "nodeGroupSpec": {
                "resources": {
                    "resourcePresetId": "<host_class>",
                    "diskSize": "<storage_size_in_bytes>",
                    "diskTypeId": "<disk_type>"
                },
                "hostsCount": "<number_of_hosts>",
                "zoneIds": [
                    "<availability_zone_1>",
                    "<availability_zone_2>",
                    "<availability_zone_3>"
                ],
                "subnetIds": [
                    "<subnet_1_ID>",
                    "<subnet_2_ID>",
                    "<subnet_3_ID>"
                ],
                "assignPublicIp": <allow_public_access_to_hosts>,
                "diskSizeAutoscaling": {
                    "plannedUsageThreshold": "<scheduled_expansion_percentage>",
                    "emergencyUsageThreshold": "<immediate_expansion_percentage>",
                    "diskSizeLimit": "<maximum_storage_size_in_bytes>"
                }
            }
        }
        ```


        Where:

        * `updateMask`: Comma-separated string of settings to update.
        * `nodeGroups`: Host settings:

            * `resources`: Cluster resources:

                * `resourcePresetId`: [Host class](../concepts/instance-types.md).
                * `diskSize`: Disk size, in bytes.
                * `diskTypeId`: [Disk type](../concepts/storage.md).

            * `hostsCount`: Number of hosts in the group. Minimum number of `DATA` and `Dashboards` hosts: one; minimum number of `MANAGER` hosts: three.
            * `zoneIds`: List of availability zones the cluster hosts are located in.

            
            * `subnetIds`: List of subnet IDs.
            * `assignPublicIp`: Permission to [connect](connect/index.md) to the host from the internet, `true` or `false`.


            * `diskSizeAutoscaling`: Automatic storage expansion settings:

                * `plannedUsageThreshold`: Storage usage percentage to trigger a storage expansion during the next maintenance window.

                    Use a value between `0` and `100`%. The default value is `0`, i.e., automatic expansion is disabled.

                    If you set this condition, [configure the maintenance window schedule](update.md#change-additional-settings) before creating your host group.

                * `emergencyUsageThreshold`: Storage usage percentage to trigger an immediate storage expansion.

                    Use a value between `0` and `100`%. The default value is `0`, i.e., automatic expansion is disabled.

                    {% note warning %}

                    If you specify both thresholds, `emergencyUsageThreshold` must not be less than `plannedUsageThreshold`.

                    {% endnote %}

                * `diskSizeLimit`: Maximum storage size, in bytes, that can be set if the usage percentage reaches one of the specified thresholds.

                
                {% note warning %}
                
                * You cannot decrease the storage size after automatic expansion.
                * When scaling your storage, the cluster hosts will be unavailable.
                
                {% endnote %}


    1. To update an `OpenSearch` host group configuration:

        1. Call the [Cluster.UpdateOpenSearchNodeGroup](../api-ref/Cluster/updateOpenSearchNodeGroup.md) method, e.g., via the following [cURL](https://curl.se/) request:

            ```bash
            curl \
                --request PATCH \
                --header "Authorization: Bearer $IAM_TOKEN" \
                --header "Content-Type: application/json" \
                --url 'https://mdb.api.cloud.yandex.net/managed-opensearch/v1/clusters/<cluster_ID>/opensearch/node_groups/<host_group_name>' \
                --data "@body.json"
            ```

            You can get the cluster ID with the [list of clusters in the folder](cluster-list.md#list-clusters). You can get the host group name with [cluster details](cluster-list.md#get-cluster).

        1. View the [server response](../api-ref/Cluster/updateOpenSearchNodeGroup.md#yandex.cloud.operation.Operation) to make sure your request was successful.

    1. To update a `Dashboards` host group configuration:

        1. Call the [Cluster.UpdateDashboardsNodeGroup](../api-ref/Cluster/updateDashboardsNodeGroup.md) method, e.g., via the following [cURL](https://curl.se/) request:

            ```bash
            curl \
                --request PATCH \
                --header "Authorization: Bearer $IAM_TOKEN" \
                --header "Content-Type: application/json" \
                --url 'https://mdb.api.cloud.yandex.net/managed-opensearch/v1/clusters/<cluster_ID>/dashboards/node_groups/<host_group_name>' \
                --data "@body.json"
            ```

            You can get the cluster ID with the [list of clusters in the folder](cluster-list.md#list-clusters). You can get the host group name with [cluster details](cluster-list.md#get-cluster).

        1. View the [server response](../api-ref/Cluster/updateDashboardsNodeGroup.md#yandex.cloud.operation.Operation) to make sure your request was successful.

- gRPC API {#grpc-api}

    1. [Get an IAM token for API authentication](../api-ref/authentication.md) and put it into an environment variable:

        ```bash
        export IAM_TOKEN="<IAM_token>"
        ```

    1. Clone the [cloudapi](https://github.com/yandex-cloud/cloudapi) repository:
       
       ```bash
       cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
       ```
       
       Below, we assume that the repository contents reside in the `~/cloudapi/` directory.
    1. Create a file named `body.json` and paste the following code into it:

        {% note warning %}
        
        The API method will assign default values to all the parameters of the object you are modifying unless you explicitly provide them in your request. To avoid this, list the settings you want to change in the `update_mask` parameter as an array of `paths[]` strings.
        
        {% cut "Format for listing settings" %}
        
        ```yaml
        "update_mask": {
            "paths": [
                "<setting_1>",
                "<setting_2>",
                ...
                "<setting_N>"
            ]
        }
        ```
        
        {% endcut %}
        
        {% endnote %}

        
        ```json
        {
            "cluster_id": "<cluster_ID>",
            "name": "<host_group_name>",
            "update_mask": {
                "paths": [
                    "resources",
                    "hosts_count",
                    "zone_ids",
                    "subnet_ids",
                    "assign_public_ip"
                ]
            },
            "node_group_spec": {
                "resources": {
                    "resource_preset_id": "<host_class>",
                    "disk_size": "<storage_size_in_bytes>",
                    "disk_type_id": "<disk_type>"
                },
                "hosts_count": "<number_of_hosts>",
                "zone_ids": [
                    "<availability_zone_1>",
                    "<availability_zone_2>",
                    "<availability_zone_3>"
                ],
                "subnet_ids": [
                    "<subnet_1_ID>",
                    "<subnet_2_ID>",
                    "<subnet_3_ID>"
                ],
                "assign_public_ip": <allow_public_access_to_hosts>,
                "disk_size_autoscaling": {
                    "planned_usage_threshold": "<scheduled_expansion_percentage>",
                    "emergency_usage_threshold": "<immediate_expansion_percentage>",
                    "disk_size_limit": "<maximum_storage_size_in_bytes>"
                }
            }
        }
        ```


        Where:

        * `update_mask`: List of settings to update as an array of strings (`paths[]`).
        * `node_groups`: Host settings:

            * `resources`: Cluster resources:

                * `resource_preset_id`: [Host class](../concepts/instance-types.md).
                * `disk_size`: Disk size, in bytes.
                * `disk_type_id`: [Disk type](../concepts/storage.md).

            * `hosts_count`: Number of hosts in the group. Minimum number of `DATA` and `Dashboards` hosts: one; minimum number of `MANAGER` hosts: three.
            * `zone_ids`: List of availability zones the cluster hosts are located in.

            
            * `subnet_ids`: List of subnet IDs.
            * `assign_public_ip`: Permission to [connect](connect/index.md) to the host from the internet, `true` or `false`.


            * `disk_size_autoscaling`: Automatic storage expansion settings:

                * `planned_usage_threshold`: Storage usage percentage to trigger a storage expansion during the next maintenance window.

                    Use a value between `0` and `100`%. The default value is `0`, i.e., automatic expansion is disabled.

                    If you set this condition, [configure the maintenance window schedule](update.md#change-additional-settings) before creating your host group.

                * `emergency_usage_threshold`: Storage usage percentage to trigger an immediate storage expansion.

                    Use a value between `0` and `100`%. The default value is `0`, i.e., automatic expansion is disabled.

                    {% note warning %}

                    If you specify both thresholds, `emergency_usage_threshold` must not be less than `planned_usage_threshold`.

                    {% endnote %}

                * `disk_size_limit`: Maximum storage size, in bytes, that can be set if the usage percentage reaches one of the specified thresholds.

                
                {% note warning %}
                
                * You cannot decrease the storage size after automatic expansion.
                * When scaling your storage, the cluster hosts will be unavailable.
                
                {% endnote %}


    1. To update an `OpenSearch` host group configuration:

        1. Call the [ClusterService.UpdateOpenSearchNodeGroup](../api-ref/grpc/Cluster/updateOpenSearchNodeGroup.md) method, e.g., via the following [gRPCurl](https://github.com/fullstorydev/grpcurl) request:

            ```bash
            grpcurl \
                -format json \
                -import-path ~/cloudapi/ \
                -import-path ~/cloudapi/third_party/googleapis/ \
                -proto ~/cloudapi/yandex/cloud/mdb/opensearch/v1/cluster_service.proto \
                -rpc-header "Authorization: Bearer $IAM_TOKEN" \
                -d @ \
                mdb.api.cloud.yandex.net:443 \
                yandex.cloud.mdb.opensearch.v1.ClusterService.UpdateOpenSearchNodeGroup \
                < body.json
            ```

            You can get the cluster ID with the [list of clusters in the folder](cluster-list.md#list-clusters). You can get the host group name with [cluster details](cluster-list.md#get-cluster).

        1. View the [server response](../api-ref/grpc/Cluster/updateOpenSearchNodeGroup.md#yandex.cloud.operation.Operation) to make sure your request was successful.

    1. To update a `Dashboards` host group configuration:

        1. Call the [ClusterService.UpdateDashboardsNodeGroup](../api-ref/grpc/Cluster/updateDashboardsNodeGroup.md) method, e.g., via the following [gRPCurl](https://github.com/fullstorydev/grpcurl) request:

            ```bash
            grpcurl \
                -format json \
                -import-path ~/cloudapi/ \
                -import-path ~/cloudapi/third_party/googleapis/ \
                -proto ~/cloudapi/yandex/cloud/mdb/opensearch/v1/cluster_service.proto \
                -rpc-header "Authorization: Bearer $IAM_TOKEN" \
                -d @ \
                mdb.api.cloud.yandex.net:443 \
                yandex.cloud.mdb.opensearch.v1.ClusterService.UpdateDashboardsNodeGroup \
                < body.json
            ```

            You can get the cluster ID with the [list of clusters in the folder](cluster-list.md#list-clusters). You can get the host group name with [cluster details](cluster-list.md#get-cluster).

        1. View the [server response](../api-ref/grpc/Cluster/updateDashboardsNodeGroup.md#yandex.cloud.operation.Operation) to make sure your request was successful.

{% endlist %}

## Deleting a host group {#delete-host-group}

The following restrictions apply when deleting a host group:

* You cannot delete a single host group with the `DATA` role.
* You cannot delete a host group with the `MANAGER` role if, at the time it was added, the cluster included a group of `OpenSearch` hosts with the `DATA` and `MANAGER` roles.

{% list tabs group=instructions %}

- Management console {#console}

    1. In the [management console](https://console.yandex.cloud), navigate to the folder page.
    1. Navigate to **Managed Service for&nbsp;OpenSearch**.
    1. Locate the cluster you need in the list, click its name, and select the ![host-groups.svg](../../_assets/console-icons/copy-transparent.svg) **Node groups** tab.
    1. Click ![image](../../_assets/console-icons/ellipsis.svg) in the row with the group you need and select **Delete**.

- 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.

    To delete a host group, run this command:

    ```bash
    yc managed-opensearch node-group delete --cluster-name <cluster_name> \
       --node-group-name <host_group_name>
    ```

    In the command, specify the host group you want to delete.

- Terraform {#tf}

    To delete a host group from a cluster:

    1. Open the current Terraform configuration file with the infrastructure plan.

        For more on how to create such a file, see the [Creating a cluster](cluster-create.md) section.

        For a complete list of configurable Managed Service for OpenSearch cluster fields, see [this Terraform provider guide](../../terraform/resources/mdb_opensearch_cluster.md).

    1. To delete an `OpenSearch` host group, remove its `node_groups` section from `opensearch`.

    1. To delete a `Dashboards` host group, remove the `dashboards` section.

    1. Make sure the settings are correct.

        1. In the command line, navigate to the directory that contains the current Terraform configuration files defining the infrastructure.
        1. Run this command:
        
           ```bash
           terraform validate
           ```
        
           Terraform will show any errors found in your configuration files.

    1. Confirm deleting the resources.

        1. Run this command to view the planned changes:
        
           ```bash
           terraform plan
           ```
        
           If you described the configuration correctly, the terminal will display a list of the resources to update and their parameters. This is a verification step that does not apply changes to your resources.
        
        1. If everything looks correct, apply the changes:
           1. Run this command:
        
              ```bash
              terraform apply
              ```
        
           1. Confirm updating the resources.
           1. Wait for the operation to complete.

        {% note warning "Timeouts" %}
        
        The Terraform provider sets the following timeouts for Managed Service for OpenSearch cluster operations:
        
        * Creating a cluster, including by restoring it from a backup: 30 minutes.
        * Updating a cluster: 60 minutes.
        * Deleting a cluster: 15 minutes.
        
        Operations exceeding the timeout are aborted.
        
        {% cut "How do I change these limits?" %}
        
        Add a `timeouts` section to the cluster description, e.g.:
        
        ```hcl
        resource "yandex_mdb_opensearch_cluster" "<cluster_name>" {
          ...
          timeouts {
            create = "1h30m" # 1 hour 30 minutes
            update = "2h"    # 2 hours
            delete = "30m"   # 30 minutes
          }
        }
        ```
        
        {% endcut %}
        
        {% endnote %}

- REST API {#api}

    1. [Get an IAM token for API authentication](../api-ref/authentication.md) and put it into an environment variable:

        ```bash
        export IAM_TOKEN="<IAM_token>"
        ```

    1. To delete an `OpenSearch` host group:

        1. Call the [Cluster.DeleteOpenSearchNodeGroup](../api-ref/Cluster/deleteOpenSearchNodeGroup.md) method, e.g., via the following [cURL](https://curl.se/) request:

            ```bash
            curl \
                --request DELETE \
                --header "Authorization: Bearer $IAM_TOKEN" \
                --url 'https://mdb.api.cloud.yandex.net/managed-opensearch/v1/clusters/<cluster_ID>/opensearch/node_groups/<host_group_name>'
            ```

            You can get the cluster ID with the [list of clusters in the folder](cluster-list.md#list-clusters). You can get the host group name with [cluster details](cluster-list.md#get-cluster).

        1. View the [server response](../api-ref/Cluster/deleteOpenSearchNodeGroup.md#yandex.cloud.operation.Operation) to make sure your request was successful.

    1. To delete a `Dashboards` host group:

        1. Call the [Cluster.DeleteDashboardsNodeGroup](../api-ref/Cluster/deleteDashboardsNodeGroup.md) method, e.g., via the following [cURL](https://curl.se/) request:

            ```bash
            curl \
                --request DELETE \
                --header "Authorization: Bearer $IAM_TOKEN" \
                --url 'https://mdb.api.cloud.yandex.net/managed-opensearch/v1/clusters/<cluster_ID>/dashboards/node_groups/<host_group_name>'
            ```

            You can get the cluster ID with the [list of clusters in the folder](cluster-list.md#list-clusters). You can get the host group name with [cluster details](cluster-list.md#get-cluster).

        1. View the [server response](../api-ref/Cluster/deleteDashboardsNodeGroup.md#yandex.cloud.operation.Operation) to make sure your request was successful.

- gRPC API {#grpc-api}

    1. [Get an IAM token for API authentication](../api-ref/authentication.md) and put it into an environment variable:

        ```bash
        export IAM_TOKEN="<IAM_token>"
        ```

    1. Clone the [cloudapi](https://github.com/yandex-cloud/cloudapi) repository:
       
       ```bash
       cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
       ```
       
       Below, we assume that the repository contents reside in the `~/cloudapi/` directory.
    1. To delete an `OpenSearch` host group:

        1. Call the [ClusterService.DeleteOpenSearchNodeGroup](../api-ref/grpc/Cluster/deleteOpenSearchNodeGroup.md) method, e.g., via the following [gRPCurl](https://github.com/fullstorydev/grpcurl) request:

            ```bash
            grpcurl \
                -format json \
                -import-path ~/cloudapi/ \
                -import-path ~/cloudapi/third_party/googleapis/ \
                -proto ~/cloudapi/yandex/cloud/mdb/opensearch/v1/cluster_service.proto \
                -rpc-header "Authorization: Bearer $IAM_TOKEN" \
                -d '{
                        "cluster_id": "<cluster_ID>",
                        "name": "<host_group_name>"
                    }' \
                mdb.api.cloud.yandex.net:443 \
                yandex.cloud.mdb.opensearch.v1.ClusterService.DeleteOpenSearchNodeGroup
            ```

            You can get the cluster ID with the [list of clusters in the folder](cluster-list.md#list-clusters). You can get the host group name with [cluster details](cluster-list.md#get-cluster).

        1. View the [server response](../api-ref/grpc/Cluster/deleteOpenSearchNodeGroup.md#yandex.cloud.operation.Operation) to make sure your request was successful.

    1. To delete a `Dashboards` host group:

        1. Call the [ClusterService.DeleteDashboardsNodeGroup](../api-ref/grpc/Cluster/deleteDashboardsNodeGroup.md) method, e.g., via the following [gRPCurl](https://github.com/fullstorydev/grpcurl) request:

            ```bash
            grpcurl \
                -format json \
                -import-path ~/cloudapi/ \
                -import-path ~/cloudapi/third_party/googleapis/ \
                -proto ~/cloudapi/yandex/cloud/mdb/opensearch/v1/cluster_service.proto \
                -rpc-header "Authorization: Bearer $IAM_TOKEN" \
                -d '{
                        "cluster_id": "<cluster_ID>",
                        "name": "<host_group_name>"
                    }' \
                mdb.api.cloud.yandex.net:443 \
                yandex.cloud.mdb.opensearch.v1.ClusterService.DeleteDashboardsNodeGroup
            ```

            You can get the cluster ID with the [list of clusters in the folder](cluster-list.md#list-clusters). You can get the host group name with [cluster details](cluster-list.md#get-cluster).

        1. View the [server response](../api-ref/grpc/Cluster/deleteDashboardsNodeGroup.md#yandex.cloud.operation.Operation) to make sure your request was successful.

{% endlist %}

## Getting a list of cluster hosts {#list-hosts}

{% list tabs group=instructions %}

- Management console {#console}

    1. In the [management console](https://console.yandex.cloud), navigate to the folder page.
    1. Navigate to **Managed Service for&nbsp;OpenSearch**.
    1. Click the cluster name and select the ![hosts](../../_assets/console-icons/cube.svg) **Hosts** tab.

- REST API {#api}

  1. [Get an IAM token for API authentication](../api-ref/authentication.md) and put it into an environment variable:

      ```bash
      export IAM_TOKEN="<IAM_token>"
      ```

  1. Call the [Cluster.ListHosts](../api-ref/Cluster/listHosts.md) method, e.g., via the following [cURL](https://curl.se/) request:

      ```bash
      curl \
          --request GET \
          --header "Authorization: Bearer $IAM_TOKEN" \
          --url 'https://mdb.api.cloud.yandex.net/managed-opensearch/v1/clusters/<cluster_ID>/hosts'
      ```

      You can get the cluster ID with the [list of clusters in the folder](cluster-list.md#list-clusters).

  1. Check the [server response](../api-ref/Cluster/listHosts.md#yandex.cloud.mdb.opensearch.v1.ListClusterHostsResponse) to make sure your request was successful.

- gRPC API {#grpc-api}

  1. [Get an IAM token for API authentication](../api-ref/authentication.md) and put it into an environment variable:

      ```bash
      export IAM_TOKEN="<IAM_token>"
      ```

  1. Clone the [cloudapi](https://github.com/yandex-cloud/cloudapi) repository:
     
     ```bash
     cd ~/ && git clone --depth=1 https://github.com/yandex-cloud/cloudapi
     ```
     
     Below, we assume that the repository contents reside in the `~/cloudapi/` directory.
  1. Call the [ClusterService.ListHosts](../api-ref/grpc/Cluster/listHosts.md) method, e.g., via the following [gRPCurl](https://github.com/fullstorydev/grpcurl) request:

      ```bash
      grpcurl \
          -format json \
          -import-path ~/cloudapi/ \
          -import-path ~/cloudapi/third_party/googleapis/ \
          -proto ~/cloudapi/yandex/cloud/mdb/opensearch/v1/cluster_service.proto \
          -rpc-header "Authorization: Bearer $IAM_TOKEN" \
          -d '{
                "cluster_id": "<cluster_ID>"
              }' \
          mdb.api.cloud.yandex.net:443 \
          yandex.cloud.mdb.opensearch.v1.ClusterService.ListHosts
      ```

      You can get the cluster ID with the [list of clusters in the folder](cluster-list.md#list-clusters).

  1. Check the [server response](../api-ref/grpc/Cluster/listHosts.md#yandex.cloud.mdb.opensearch.v1.ListClusterHostsResponse) to make sure your request was successful.

{% endlist %}