Maximum age in hot phase vs. Move data into phase in warm phase

Hey there,

I don't understand the difference between the two options. First, in the hot phase I can enter a maximum age after a rollover happens, but then in the warm phase I can also enter a maximum duration when the rollover happens.

Or am I just mixing two things with rollover and switch between phases?

Hi @rosaLux161

Yeah a bit confusing...

max_age in the hot phase refers to maximum age before rollover... so you are forcing a rollover to happen at that ages (comes in useful sometimes)

min_age in the warm phase is how many days after rollover to move into warm...

I always suggest as you are getting used to ILM... is create the Policy in the UI then look at it in the API :slight_smile:

Example

GET _ilm/policy/discuss-test

{
  "discuss-test": {
    "version": 2,
    "modified_date": "2022-09-22T16:15:04.665Z",
    "policy": {
      "phases": {
        "hot": {
          "min_age": "0ms",
          "actions": {
            "rollover": {
              "max_primary_shard_size": "50gb",
              "max_age": "3d"
            },
            "set_priority": {
              "priority": 100
            }
          }
        },
        "warm": {
          "min_age": "7d",
          "actions": {
            "set_priority": {
              "priority": 50
            }
          }
        },
        "delete": {
          "min_age": "30d",
          "actions": {
            "delete": {
              "delete_searchable_snapshot": true
            }
          }
        }
      }
    },
    "in_use_by": {
      "indices": [],
      "data_streams": [],
      "composable_templates": []
    }
  }
}