Is it possible to change Index-level data tier allocation after creation?

Hello, the documentation isn't clear on this - is it possible to set the data tier allocation AFTER an index has been created? e.g. index.routing.allocation.include._tier_preference

We are in a situation where a piece of software creates its own index but its defaulting to content, we'd like it to be warm instead but we are not sure whether that means we need to create the index ourselves or if we can do it after the fact...

I had a thought, may be a bad thought, but can you template the index to assign an ILM policy? Treat where it's allocated as hot, assign it to warm at rollover to move it to the desired nodes. How often does it create new indices?

If it has a template, can you add a component template to override the routing?

Hello it just creates one index once ever, its a black box to me how it creates the template, I think its using a Cpp library to make REST calls directly against Elasticsearch to create the index...

You should be able to create a test index like it in dev tools, then try to change the routing. See what happens :slight_smile:

If I'm not wrong when you do not specify the value for index.routing.allocation.include._tier_preference in an index template, it will go to data_content for normal index and data_hot for data streams.

If the application you are using does not create a template, you may create one just to change the tier preference.

It would be something like this:

{
    "index_patterns" : [ "indexName" ],
    "template": {
        "settings": {
            "index" : {
                "routing" : {
                    "allocation" : {
                        "include" : {
                            "_tier_preference" : "data_warm"
                        }
                    }
                }
            }
        }
    },    
    "priority": 100,
    "version": 1
}

You can also move an index to a different tier using the following request:

PUT /indexName/_settings
{
    "index": {
      "routing": {
        "allocation": {
          "include": {
            "_tier_preference": "data_warm"
          }
        }
      }
    }
}