# Shards not relocating to warm nodes

**URL:** https://discuss.elastic.co/t/shards-not-relocating-to-warm-nodes/260198
**Category:** Elasticsearch
**Tags:** ilm-index-lifecycle-management
**Created:** [January 5, 2021, 11:40am UTC](https://discuss.elastic.co/t/shards-not-relocating-to-warm-nodes/260198 "2021-01-05T11:40:52Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Smrithin\_N\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/smrithin_n_s/32/78403_2.png) [@Smrithin\_N\_S](https://discuss.elastic.co/u/Smrithin_N_S)
#### Post date: [January 5, 2021, 11:40am UTC](https://discuss.elastic.co/t/shards-not-relocating-to-warm-nodes/260198/1 "2021-01-05T11:40:52Z")

</div>

I have a deployment with hot-warm architecture enabled. Below is the ILM policy being used.

```auto
    PUT _ilm/policy/apm-rollover-30-days
    {
      "policy": {
        "phases": {
          "hot": {
            "min_age": "0ms",
            "actions": {
              "rollover": {
                "max_size": "10gb",
                "max_age": "1d"
              },
              "set_priority": {
                "priority": 100
              }
            }
          },
          "warm": {
            "min_age": "5d",
            "actions": {
              "allocate": {
                "number_of_replicas": 1,
                "include": {},
                "exclude": {}
              },
              "readonly": {},
              "set_priority": {
                "priority": 50
              },
              "shrink": {
                "number_of_shards": 1
              }
            }
          }
        }
      }
    }

```

new index is created everyday and I need to move index older than 5 days to the warm nodes. I can see that the index get rolled over and lifecycle phase have changed to warm.

 ![Screenshot 2021-01-05 at 5.05.36 PM](https://us1.discourse-cdn.com/elastic/original/3X/b/c/bc45af34f54e4a84db1191782de6af189faebab9.png)

But the below screenshot says the shards are still in the hot nodes.

 ![Screenshot 2021-01-05 at 5.06.53 PM](https://us1.discourse-cdn.com/elastic/original/3X/e/1/e1ead3fb40991ab95d6c13f77aeaf628aa20a663.png)

Below is the disk usage of the Hot and warm nodes. only 19GB disk usage is there in warm instances and hot instances are still above 75%.

 ![Screenshot 2021-01-05 at 5.01.59 PM](https://us1.discourse-cdn.com/elastic/original/3X/1/f/1f771a5be41e53c65ba187d3015ed9e18a22ac78.png)

Can someone help me understand if there is anything that I am doing wrong?

Thanks in advance.

---

<div class="post-metadata">

### Author: ![andreidan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andreidan/32/78167_2.png) [@andreidan](https://discuss.elastic.co/u/andreidan)
#### Post date: [January 5, 2021, 12:45pm UTC](https://discuss.elastic.co/t/shards-not-relocating-to-warm-nodes/260198/2 "2021-01-05T12:45:09Z")

</div>

Thank you for using Elasticsearch.

I see you're using elasticsearch `7.10.1` so I want to mention [data tiers](https://www.elastic.co/guide/en/elasticsearch/reference/7.10/data-tiers.html) which are available and might be a way to go forward should you choose to migrate to the specialised `data_content`, `data_hot`, `data_warm` etc node roles and take advantage of the ILM [migrate action](https://www.elastic.co/guide/en/elasticsearch/reference/7.10/ilm-migrate.html) for automatic data migration between data tiers.

However, with the generic `data` role you have to implement the data migration between phases using the [allocate action](https://www.elastic.co/guide/en/elasticsearch/reference/7.10/ilm-allocate.html) and [shard allocation awareness](https://www.elastic.co/guide/en/elasticsearch/reference/7.10/modules-cluster.html#shard-allocation-awareness).  
[This blog post](https://www.elastic.co/blog/implementing-hot-warm-cold-in-elasticsearch-with-index-lifecycle-management) describes the shard allocation awareness and allocate action setup.

---

<div class="post-metadata">

### Author: ![Smrithin\_N\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/smrithin_n_s/32/78403_2.png) [@Smrithin\_N\_S](https://discuss.elastic.co/u/Smrithin_N_S)
#### Post date: [January 6, 2021, 2:34pm UTC](https://discuss.elastic.co/t/shards-not-relocating-to-warm-nodes/260198/3 "2021-01-06T14:34:27Z")

</div>

I updated the ILM policy as

```auto
PUT _ilm/policy/apm-rollover-30-days
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "rollover": {
            "max_size": "10gb",
            "max_age": "1d"
          },
          "set_priority": {
            "priority": 100
          }
        }
      },
      "warm": {
        "min_age": "5d",
        "actions": {
          "allocate": {
            "number_of_replicas": 1,
            "include": {},
            "exclude": {},
            "require": {
              "data": "warm"
            }
          },
          "readonly": {},
          "set_priority": {
            "priority": 50
          },
          "shrink": {
            "number_of_shards": 1
          }
        }
      }
    }
  }
}

```

Added the `allocate require: data` to the ILM policy and during the next rollover warms shards moved to the warm nodes.

Thanks.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [February 3, 2021, 2:34pm UTC](https://discuss.elastic.co/t/shards-not-relocating-to-warm-nodes/260198/4 "2021-02-03T14:34:48Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
