Migrateedit

Phases allowed: warm, cold.

Moves the index to the data tier that corresponds to the current phase by updating the index.routing.allocation.include._tier_preference index setting. ILM automatically injects the migrate action in the warm and cold phases if no allocation options are specified with the allocate action. If you specify an allocate action that only modifies the number of index replicas, ILM reduces the number of replicas before migrating the index. To prevent automatic migration without specifying allocation options, you can explicitly include the migrate action and set the enabled option to false.

In the warm phase, the migrate action sets index.routing.allocation.include._tier_preference to data_warm,data_hot. This moves the index to nodes in the warm tier. If there are no nodes in the warm tier, it falls back to the hot tier.

In the cold phase, the migrate action sets index.routing.allocation.include._tier_preference to data_cold,data_warm,data_hot. This moves the index to nodes in the cold tier. If there are no nodes in the cold tier, it falls back to the warm tier, or the hot tier if there are no warm nodes available.

The migrate action is not allowed in the hot phase. The initial index allocation is performed automatically, and can be configured manually or via index templates.

Optionsedit

enabled
(Optional, Boolean) Controls whether ILM automatically migrates the index during this phase. Defaults to true.

Exampleedit

In the following policy, the allocate action is specified to reduce the number of replicas before ILM migrates the index to warm nodes.

Explicitly specifying the migrate action is not required—​ILM automatically performs the migrate action unless you specify allocation options or disable migration.

PUT _ilm/policy/my_policy
{
  "policy": {
    "phases": {
      "warm": {
        "actions": {
          "migrate" : {
          },
          "allocate": {
            "number_of_replicas": 1
          }
        }
      }
    }
  }
}

Disable automatic migrationedit

The migrate action in the following policy is disabled and the allocate action assigns the index to nodes that have a rack_id of one or two.

Explicitly disabling the migrate action is not required—​ILM does not inject the migrate action if you specify allocation options.

PUT _ilm/policy/my_policy
{
  "policy": {
    "phases": {
      "warm": {
        "actions": {
          "migrate" : {
           "enabled": false
          },
          "allocate": {
            "include" : {
              "rack_id": "one,two"
            }
          }
        }
      }
    }
  }
}