# ILM increasing number of replicas - suboptimal behavior?

**URL:** <https://discuss.elastic.co/t/ilm-increasing-number-of-replicas-suboptimal-behavior/297516>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [February 17, 2022, 4:10pm UTC](https://discuss.elastic.co/t/ilm-increasing-number-of-replicas-suboptimal-behavior/297516 "2022-02-17T16:10:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nisow95612](https://avatars.discourse-cdn.com/v4/letter/n/3d9bf3/32.png) [@nisow95612](https://discuss.elastic.co/u/nisow95612)\
**Post date:** [February 17, 2022, 4:10pm UTC](https://discuss.elastic.co/t/ilm-increasing-number-of-replicas-suboptimal-behavior/297516/1 "2022-02-17T16:10:52Z")

</div>

Hello nice elastic people.  
I am currently toying with ILM (7.x, not yet upgraded to 8.0) and ran into a surprising behavior.

I have configured ILM to increase the number of replicas when transitioning from hot to cold.  
However, at least when triggering the ILM transition manually by [Move to lifecycle step API | Elasticsearch Guide [8.0] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html), it seems to behave unexpectedly.

I start with an index on the data\_hot nodes (replicas: 0).  
Then I manually trigger ILM transition.  
ILM configures the desired number of replicas (1).  
ES starts replicating the index onto another **data\_hot** node.  
ILM waits for the replication to finish.  
ILM configures \_tier\_preference and indices start to migrate to data\_cold(s).

Why does it work like that?  
Why is the replica created on the hot nodes just to be migrated away immediately?

What did I miss?  
What is preventing this new replica from being put directly onto data\_cold(s)?

---

<div class="post-metadata">

**Author:** ![nisow95612](https://avatars.discourse-cdn.com/v4/letter/n/3d9bf3/32.png) [@nisow95612](https://discuss.elastic.co/u/nisow95612)\
**Post date:** [February 23, 2022, 12:35pm UTC](https://discuss.elastic.co/t/ilm-increasing-number-of-replicas-suboptimal-behavior/297516/2 "2022-02-23T12:35:45Z")

</div>

(post deleted by author)

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [February 28, 2022, 1:41pm UTC](https://discuss.elastic.co/t/ilm-increasing-number-of-replicas-suboptimal-behavior/297516/3 "2022-02-28T13:41:15Z")

</div>

I think that's how I'd expect it to work today, but I could see why you would want these two things to happen together. Please open a bug report.

---

<div class="post-metadata">

**Author:** ![nisow95612](https://avatars.discourse-cdn.com/v4/letter/n/3d9bf3/32.png) [@nisow95612](https://discuss.elastic.co/u/nisow95612)\
**Post date:** [March 1, 2022, 12:55pm UTC](https://discuss.elastic.co/t/ilm-increasing-number-of-replicas-suboptimal-behavior/297516/4 "2022-03-01T12:55:55Z")

</div>

Thank you for the reply. Actually, I was sure there must be a good reason why it works the way it does. I'd still like to find out why and when it is beneficial for it to work like this. Can you please at least point me in the right direction?

> ****
>
> I assume bug reports are opened via github. Ok, I'll remember it in case I ever own a Microsoft account. Sorry about that.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 1, 2022, 1:12pm UTC](https://discuss.elastic.co/t/ilm-increasing-number-of-replicas-suboptimal-behavior/297516/5 "2022-03-01T13:12:43Z")

</div>

It's not a very good reason I think. The number of replicas is set in the `allocate` action whereas the move to the next tier is part of the `migrate` action and ILM runs its actions in sequence whereas it seems preferable to consolidate these two actions in your case. It sounds totally fixable tho, it's just that nobody has reported it yet.

---

<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:** [March 29, 2022, 1:13pm UTC](https://discuss.elastic.co/t/ilm-increasing-number-of-replicas-suboptimal-behavior/297516/6 "2022-03-29T13:13:08Z")

</div>

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