# Control phase transition timings in ILM

**URL:** https://discuss.elastic.co/t/control-phase-transition-timings-in-ilm/294904
**Category:** Elasticsearch
**Tags:** ilm-index-lifecycle-management
**Created:** [January 20, 2022, 7:55am UTC](https://discuss.elastic.co/t/control-phase-transition-timings-in-ilm/294904 "2022-01-20T07:55:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![inhinyera16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inhinyera16/32/61625_2.png) [@inhinyera16](https://discuss.elastic.co/u/inhinyera16)
#### Post date: [January 20, 2022, 7:55am UTC](https://discuss.elastic.co/t/control-phase-transition-timings-in-ilm/294904/1 "2022-01-20T07:55:49Z")

</div>

I'm trying to implement an ilm policy where the index will rollover every month or if the size reached 50GB.  
And since by default, ilm based the age in index creation date, and creating the index mid december means, we need to adjust and enable the [parse\_origination\_date](https://www.elastic.co/blog/control-ilm-phase-transition-timings-using-origination-date).

Here's our ILM Policy

```auto
{
  "rollover-monthly-keep-90d" : {
    "version" : 2,
    "modified_date" : "2021-12-16T12:41:28.721Z",
    "policy" : {
      "phases" : {
        "hot" : {
          "min_age" : "0ms",
          "actions" : {
            "rollover" : {
              "max_size" : "50gb",
              "max_age" : "30d"
            },
            "set_priority" : {
              "priority" : 100
            }
          }
        },
        "delete" : {
          "min_age" : "90d",
          "actions" : { }
        }
      }
    }
  }
}

```

Our Index Template

```auto
{
  "vsphere-stats-v3" : {
    "order" : 0,
    "index_patterns" : [
      "vsphere-stats-v3-*"
    ],
    "settings" : {
      "index" : {
        "lifecycle" : {
          "name" : "rollover-monthly-keep-90d",
          "parse_origination_date" : "true",
          "rollover_alias" : "vsphere-stats-v3"
        },
        "number_of_shards" : "4",
        "number_of_replicas" : "1"
      }
    },
    "mappings" : { },
    "aliases" : { }
  }
}

```

We used the ff output in logstash

```auto
	elasticsearch {
        ilm_rollover_alias => "vsphere-stats-v3"
        ilm_pattern => "vsphere-stats-v3-{now/d}-000001"
        ilm_policy => "rollover-monthly-keep-90d"
        hosts => ["Host1", "Host2", "Host3"]
      }

```

But upon checking the indices created after a month, it did rollover but the index age is same for both indices. This is critical because it will delete all the indices at once after 90days.

```auto
"indices" : {
    "vsphere-stats-v3-2021.12.01-000001" : {
      "index" : "vsphere-stats-v3-2021.12.01-000001",
      "managed" : true,
      "policy" : "rollover-monthly-keep-90d",
      "lifecycle_date_millis" : 1638316800000,
      "age" : "50.3d",
      "phase" : "hot",
      "phase_time_millis" : 1639720820792,
      "action" : "complete",
      "action_time_millis" : 1642313154868,
      "step" : "complete",
      "step_time_millis" : 1642313154868,
      "phase_execution" : {
        "policy" : "rollover-monthly-keep-90d",
        "phase_definition" : {
          "min_age" : "0ms",
          "actions" : {
            "rollover" : {
              "max_size" : "50gb",
              "max_age" : "30d"
            },
            "set_priority" : {
              "priority" : 100
            }
          }
        },
        "version" : 2,
        "modified_date_in_millis" : 1639658488721
      }
    },
    "vsphere-stats-v3-2021.12.01-000002" : {
      "index" : "vsphere-stats-v3-2021.12.01-000002",
      "managed" : true,
      "policy" : "rollover-monthly-keep-90d",
      "lifecycle_date_millis" : 1638316800000,
      "age" : "50.3d",
      "phase" : "hot",
      "phase_time_millis" : 1642313153996,
      "action" : "rollover",
      "action_time_millis" : 1642313154955,
      "step" : "check-rollover-ready",
      "step_time_millis" : 1642313154955,
      "phase_execution" : {
        "policy" : "rollover-monthly-keep-90d",
        "phase_definition" : {
          "min_age" : "0ms",
          "actions" : {
            "rollover" : {
              "max_size" : "50gb",
              "max_age" : "30d"
            },
            "set_priority" : {
              "priority" : 100
            }
          }
        },
        "version" : 2,
        "modified_date_in_millis" : 1639658488721
      }
    }
  }
}

```

Checking the minimum and max date of the latest index

![image](https://us1.discourse-cdn.com/elastic/original/3X/3/2/32e87d2548b12ed2fc3871250d47ec81e36f08a5.png)

What do you think?

---

<div class="post-metadata">

### Author: ![inhinyera16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inhinyera16/32/61625_2.png) [@inhinyera16](https://discuss.elastic.co/u/inhinyera16)
#### Post date: [January 24, 2022, 1:48pm UTC](https://discuss.elastic.co/t/control-phase-transition-timings-in-ilm/294904/2 "2022-01-24T13:48:45Z")

</div>

anyone from the support?

---

<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: [February 21, 2022, 1:49pm UTC](https://discuss.elastic.co/t/control-phase-transition-timings-in-ilm/294904/3 "2022-02-21T13:49:02Z")

</div>

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