﻿---
title: Shard allocation restricted
description: Describes what AutoOps detects and surfaces with the Shard allocation restricted insight: Shard allocation is turned off or restricted, so the master cannot place new primaries, recover failed shards, or allocate shards across data nodes as usual.
url: https://docs-v3-preview.elastic.dev/elastic/autoops-insights/tree/main/elasticsearch/shard_allocation_restricted
products:
  - Elastic Cloud Enterprise
  - Elastic Cloud Hosted
  - Elastic Cloud on Kubernetes
  - Elasticsearch
applies_to:
  - Elastic Cloud Hosted: Generally available
  - Elastic Cloud on Kubernetes: Generally available
  - Elastic Cloud Enterprise: Generally available
  - Self-managed Elastic deployments: Generally available
---

# Shard allocation restricted
Shard allocation is turned off or restricted, so the master cannot place new primaries, recover failed shards, or allocate shards across data nodes as usual. Indices might stay unassigned and new index creation can fail.
<note>
  For a complete list of insights, refer to [AutoOps insights](https://docs-v3-preview.elastic.dev/elastic/autoops-insights/tree/main/elasticsearch).
</note>


## Insight details


| Field     | Value                                      |
|-----------|--------------------------------------------|
| Component | Elasticsearch                              |
| Severity  | Medium                                     |
| Scope     | Cluster                                    |
| Domains   | configuration, shard-allocation, stability |


## Example: What you might see in AutoOps

The following is an example of what you might see when this insight is triggered. Real insights use live data and links from your deployment or cluster.

### Shard allocation is not fully enabled


#### What was detected

`cluster.routing.allocation.enable` is not set to `all`. Shard allocation is turned off or limited to a subset of shard types.

#### Recommendations

<note>
  AutoOps shows different recommendations depending on how their conditions match your deployment or cluster.
</note>

<dropdown title="Enable shard allocation">
  **Condition**: Always shown for this insight.Reset `cluster.routing.allocation.enable` so primary and replica shards can allocate to nodes.
  ```json

  {
    "transient": {
      "cluster.routing.allocation.enable": null
    },
    "persistent": {
      "cluster.routing.allocation.enable": null
    }
  }
  ```

  <note>
    Requires the `manage cluster` privilege. Requires Elasticsearch 8.0.0 or later. This action changes cluster or index configuration.
  </note>
</dropdown>


#### Background and impact

Shard allocation is how Elasticsearch places primary and replica shards on data nodes. Operators sometimes restrict allocation during rolling restarts or other maintenance.
While allocation stays restricted, the master might be cannot create new indices, recover unassigned shards, or restore redundancy after a node failure. Prolonged misconfiguration increases the risk of yellow or red health and data loss after further failures.
Turn allocation back to `all` as soon as the maintenance window ends so the cluster can recover and place shards normally.