---
metadata:
  - name: generator
    content: Diplodoc Platform v5.61.1
alternate:
  - https://ydb.tech/docs/en/devops/configuration-management/configuration-v2/static-group-self-heal.md
  - https://ydb.tech/docs/ru/devops/configuration-management/configuration-v2/static-group-self-heal.md
  - href: https://ydb.tech/docs/en/devops/configuration-management/configuration-v2/static-group-self-heal.md
    type: text/markdown
    title: Markdown version
  - href: https://ydb.tech/docs/en/llms.txt
    rel: describedby
sourcePath: en/core/devops/configuration-management/configuration-v2/static-group-self-heal.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# Static group SelfHeal

<!-- source: en/devops/configuration-management/_includes/experimental_v2.md -->
{% note warning %}

This article is dedicated to YDB clusters that use [configuration V2](https://ydb.tech/docs/en/devops/configuration-management/configuration-v2/index.md). This configuration method is currently experimental and is only available for YDB versions starting from v25.1. For production use, we recommend choosing [configuration V1](https://ydb.tech/docs/en/devops/configuration-management/index.md) — it is the main method and is officially supported for all YDB clusters.

{% endnote %}
<!-- endsource: en/devops/configuration-management/_includes/experimental_v2.md -->

When using [configuration V2](https://ydb.tech/docs/en/devops/configuration-management/configuration-v2/index.md), [SelfHeal](https://ydb.tech/docs/en/devops/concepts/selfheal-storage.md) can automatically move a static group VDisk from faulty PDisks and restore the group's fault tolerance.

The general SelfHeal mechanism detects a faulty PDisk and initiates VDisk relocation. For dynamic groups, the Blob Storage Controller changes the configuration, while distributed configuration changes the static group configuration.

To allow distributed configuration to change the static group automatically, enable the [`automatic_static_group_management`](https://ydb.tech/docs/en/reference/configuration/self_management_config.md#parameters) parameter. This parameter is disabled by default.

## Enabling and disabling static group SelfHeal {#on-off}

Static group SelfHeal requires the following components to be enabled:

* [distributed configuration](https://ydb.tech/docs/en/concepts/glossary.md#distributed-configuration) V2 — [`self_management_config.enabled: true`](https://ydb.tech/docs/en/reference/configuration/self_management_config.md#parameters);
* the general SelfHeal mechanism, which is [enabled by default](https://ydb.tech/docs/en/devops/concepts/selfheal-storage.md#on-off).

To enable or disable automatic static group management:

1. Fetch the current cluster configuration using the [ydb admin cluster config fetch](https://ydb.tech/docs/en/reference/ydb-cli/commands/configuration/cluster/fetch.md) command:


   ```bash
   ydb [global options...] admin cluster config fetch > config.yaml
   ```

2. Set the `automatic_static_group_management` parameter in the `config.yaml` configuration file:


   ```yaml
   config:
     self_management_config:
       enabled: true
       automatic_static_group_management: true
   ```


   `true` enables automatic static group management, while `false` disables it.
3. Apply the updated configuration using the [ydb admin cluster config replace](https://ydb.tech/docs/en/reference/ydb-cli/commands/configuration/cluster/replace.md) command:


   ```bash
   ydb [global options...] admin cluster config replace -f config.yaml
   ```

## Restricting the set of target nodes {#allowed-nodes}

By default, SelfHeal can move a static group VDisk to any suitable node. To restrict the set of target nodes, specify their IDs in the [`static_group_self_heal_allowed_nodes`](https://ydb.tech/docs/en/reference/configuration/self_management_config.md#parameters) parameter:


```yaml
config:
  self_management_config:
    enabled: true
    automatic_static_group_management: true
    static_group_self_heal_allowed_nodes:
    - 1
    - 2
    - 3
```


An empty list means that no restrictions apply. The allowed nodes must have suitable PDisks and enough free space to move the VDisk without violating the failure model.
