# ECE template migration error: TemplateMigrationError It was impossible to find a suitable value for \[autoscalingMax\] in the discrete\_sizes.sizes

**URL:** <https://discuss.elastic.co/t/ece-template-migration-error-templatemigrationerror-it-was-impossible-to-find-a-suitable-value-for-autoscalingmax-in-the-discrete-sizes-sizes/358939>\
**Category:** Elastic Cloud Enterprise (ECE)\
**Created:** [May 7, 2024, 2:37pm UTC](https://discuss.elastic.co/t/ece-template-migration-error-templatemigrationerror-it-was-impossible-to-find-a-suitable-value-for-autoscalingmax-in-the-discrete-sizes-sizes/358939 "2024-05-07T14:37:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kuradakis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kuradakis/32/111918_2.png) [@kuradakis](https://discuss.elastic.co/u/kuradakis)\
**Post date:** [May 7, 2024, 2:37pm UTC](https://discuss.elastic.co/t/ece-template-migration-error-templatemigrationerror-it-was-impossible-to-find-a-suitable-value-for-autoscalingmax-in-the-discrete-sizes-sizes/358939/1 "2024-05-07T14:37:11Z")

</div>

In ECE 3.6.2 when you deployed with `default` template and want to have some limitiation in instance sizes, you will get this error while migrating to different template what has no 32G size.

Is not possible to migrate deployment to desired template due to:

` [TemplateMigrationError(It was impossible to find a suitable value for [autoscalingMax] in the discrete_sizes.sizes of the [d646d3d56f714e77a510371e7dd24659] instance configuration.)]`

You will get this error becasue the austoscaling\_max value is 2T in the default template.

You can go down to 32G because the math is the following:

> `autoscaling_max.value` cannot exceed the value of 64 \* discrete\_sizes.sizes as it's limited to 64 nodes in ECE

I have done tests in my 3.6.2 ECE test installation:

**Instance configurations:**  
Instance16G -2,4,8,16 ramsizes  
Instance32G -2,4,8,16,32 ramsizes

**Deployment templates:**  
template16G -hot, instance16G, autoscaling min-max 2G  
template32G -hot, instance32G, autoscaling min-max 2G  
template16G\_with\_16Gmax -hot, instance16G, autoscaling min2G-max16G  
default

**Deployments:**  
FromTemplate16 -origin template: `template16G`  
FromTemplate32 -origin template: `template32G`  
template16G\_with16G\_max\_as -origin template: template16G\_with16G\_max\_as

**Test template migrations:**

- `default` -\> `template32G` -\> `template16G` **fails after the first migration**

- `template16G` -\> `template32G` -\> `default` -\> `template16G` **works(autoscaling\_max is 2048 everywhere)**

- `template32G` -\> `template16G` -\> `default` -\> `template32G` **works(autoscaling\_max is 2048 everywhere)**

- `template16G_with16G_max_as` -\> `template32G` -\> template32G -\> default -\> `template16G_with16G_max_as` **works(autoscaling\_max is 16384 everywhere)**

Looks like the `autoscaling_max` value is inherited between templates from the first deployment.

So if we have a 2T `autoscaling_max` it does not matter what we have in the further migration templates. It will be 2T forever.

_So the only one template where we can migrate is the 32G._

**And the interesting outcome what fixed for me:**

If you had migrated away from default template to a 32G, **empty one of the allocator** (maintenance and move instances) what hold some parts of the deployment.  
Then magically you able to migrate from `template32G` to `template16G`.

Please somebody else confirm or test this.

---

<div class="post-metadata">

**Author:** ![kuradakis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kuradakis/32/111918_2.png) [@kuradakis](https://discuss.elastic.co/u/kuradakis)\
**Post date:** [June 26, 2024, 2:18pm UTC](https://discuss.elastic.co/t/ece-template-migration-error-templatemigrationerror-it-was-impossible-to-find-a-suitable-value-for-autoscalingmax-in-the-discrete-sizes-sizes/358939/2 "2024-06-26T14:18:27Z")

</div>

It works if you just do random instance movement here and there.
