# Moving Index/shards from Hot Tier to Warm Tier using custom Attributes within zones using ILM

**URL:** <https://discuss.elastic.co/t/moving-index-shards-from-hot-tier-to-warm-tier-using-custom-attributes-within-zones-using-ilm/329277>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [April 4, 2023, 6:51am UTC](https://discuss.elastic.co/t/moving-index-shards-from-hot-tier-to-warm-tier-using-custom-attributes-within-zones-using-ilm/329277 "2023-04-04T06:51:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikasp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikasp/32/90872_2.png) [@vikasp](https://discuss.elastic.co/u/vikasp)\
**Post date:** [April 4, 2023, 6:51am UTC](https://discuss.elastic.co/t/moving-index-shards-from-hot-tier-to-warm-tier-using-custom-attributes-within-zones-using-ilm/329277/1 "2023-04-04T06:51:00Z")

</div>

I usually move an index to warm tier using ILM and the default \_tier\_preference if I have the nodes defined as data\_warm.

Lets say I have multiple indices with varied number of shards. index1 with 5 shards and index 2 with 6 shards with 1 replicas. spread over 3 zones. (nodes.attr.az: us-east-1a, us-east-1b, us-east-1c). There is zone awareness enabled.  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/1/41b34ada26bcf7aba89df546b5427b1b7fd74cbc.png)

I have created a custom attribute "node-type": "warm" for all of my warm nodes. I would like to move my indices from hot nodes to "node-type" : "warm". But also, I want to move shards in hot tier us-east-1a move to warm node-type in us-east-1a, same way to us-east-1b and us-east-1c. Is there any way to achieve this with ILMs.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 4, 2023, 8:19am UTC](https://discuss.elastic.co/t/moving-index-shards-from-hot-tier-to-warm-tier-using-custom-attributes-within-zones-using-ilm/329277/2 "2023-04-04T08:19:42Z")

</div>

No, that is not possible to control. I believe new replicas are always copied from the current primary.

---

<div class="post-metadata">

**Author:** ![vikasp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikasp/32/90872_2.png) [@vikasp](https://discuss.elastic.co/u/vikasp)\
**Post date:** [April 5, 2023, 3:42am UTC](https://discuss.elastic.co/t/moving-index-shards-from-hot-tier-to-warm-tier-using-custom-attributes-within-zones-using-ilm/329277/3 "2023-04-05T03:42:50Z")

</div>

Copying shards within zone between tiers would save lot of cost caused by Data Transfer.  
So, no way of doing that. Hmm.

---

<div class="post-metadata">

**Author:** ![vikasp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikasp/32/90872_2.png) [@vikasp](https://discuss.elastic.co/u/vikasp)\
**Post date:** [April 5, 2023, 3:44am UTC](https://discuss.elastic.co/t/moving-index-shards-from-hot-tier-to-warm-tier-using-custom-attributes-within-zones-using-ilm/329277/4 "2023-04-05T03:44:31Z")

</div>

Not new replicas, once the shards are already allocated and in hot after rollover and after a certain period of time specified in ILM, the index gets moved to warm tier, In this scenario, I am looking to move shards within the zone while they move to warm nodes.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [April 5, 2023, 5:09am UTC](https://discuss.elastic.co/t/moving-index-shards-from-hot-tier-to-warm-tier-using-custom-attributes-within-zones-using-ilm/329277/5 "2023-04-05T05:09:32Z")

</div>

When you "move" shards, I believe the mechanism behind the scenes is that new replicas are allocated based on the primary shard and the existing one then removed once the new replica is online. The end result is equivalent to a move though so it makes sense describing it as a move to a new tier.

---

<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:** [May 3, 2023, 5:10am UTC](https://discuss.elastic.co/t/moving-index-shards-from-hot-tier-to-warm-tier-using-custom-attributes-within-zones-using-ilm/329277/6 "2023-05-03T05:10:19Z")

</div>

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