# Index Lifecycle Policy understanding

**URL:** <https://discuss.elastic.co/t/index-lifecycle-policy-understanding/258355>\
**Category:** Elasticsearch\
**Created:** [December 11, 2020, 3:01am UTC](https://discuss.elastic.co/t/index-lifecycle-policy-understanding/258355 "2020-12-11T03:01:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![FBergeron](https://avatars.discourse-cdn.com/v4/letter/f/c2a13f/32.png) [@FBergeron](https://discuss.elastic.co/u/FBergeron)\
**Post date:** [December 11, 2020, 3:01am UTC](https://discuss.elastic.co/t/index-lifecycle-policy-understanding/258355/1 "2020-12-11T03:01:13Z")

</div>

Hi,

I have a question about Index Lifecycle Policy.

What I want is as follow:

A hot phase that is no longer than 14 days.  
A warm phase for older records.  
No cold phase.  
The data older than 28 days should be deleted.

My ILM is defined like this:

```auto
    {
      "my-docs-ilm-policy" : {
        "version" : 2,
        "modified_date" : "2020-12-01T05:45:54.825Z",
        "policy" : {
          "phases" : {
            "warm" : {
              "min_age" : "0ms",
              "actions" : {
                "set_priority" : {
                  "priority" : null
                }
              }
            },
            "hot" : {
              "min_age" : "0ms",
              "actions" : {
                "rollover" : {
                  "max_size" : "50gb",
                  "max_age" : "14d"
                },
                "set_priority" : {
                  "priority" : 100
                }
              }
            },
            "delete" : {
              "min_age" : "28d",
              "actions" : {
                "wait_for_snapshot" : {
                  "policy" : "daily-snapshots"
                },
                "delete" : {
                  "delete_searchable_snapshot" : true
                }
              }
            }
          }
        }
      }
    }

```

My questions are:

1. Is it mandatory to have a cold phase?
2. Does my definition match my requirements?

What is not clear for me is when will the records be deleted. When I do:

`GET .ds-my-docs-*/_ilm_explain`

I get something that looks like this:

```auto
    {
      "indices" : {
        ".ds-my-docs-000002" : {
          "index" : ".ds-my-docs-000002",
          "managed" : true,
          "policy" : "my-docs-ilm-policy",
          "lifecycle_date_millis" : 1607394904201,
          "age" : "3d",
          "phase" : "warm",
          "phase_time_millis" : 1607394905252,
          "action" : "complete",
          "action_time_millis" : 1607394905368,
          "step" : "complete",
          "step_time_millis" : 1607394905368,
          "phase_execution" : {
            "policy" : "my-docs-ilm-policy",
            "phase_definition" : {
              "min_age" : "0ms",
              "actions" : {
                "set_priority" : {
                  "priority" : null
                }
              }
            },
            "version" : 2,
            "modified_date_in_millis" : 1606801554825
          }
        },
        ".ds-my-docs-000003" : {
          "index" : ".ds-my-docs-000003",
          "managed" : true,
          "policy" : "my-docs-ilm-policy",
          "lifecycle_date_millis" : 1607394904283,
          "age" : "3d",
          "phase" : "hot",
          "phase_time_millis" : 1607394904780,
          "action" : "rollover",
          "action_time_millis" : 1607395504469,
          "step" : "check-rollover-ready",
          "step_time_millis" : 1607395504469,
          "phase_execution" : {
            "policy" : "my-docs-ilm-policy",
            "phase_definition" : {
              "min_age" : "0ms",
              "actions" : {
                "rollover" : {
                  "max_size" : "50gb",
                  "max_age" : "14d"
                },
                "set_priority" : {
                  "priority" : 100
                }
              }
            },
            "version" : 2,
            "modified_date_in_millis" : 1606801554825
          }
        }
      }
    }

```

I can see that hot index will be rolled over to warm after 14 days but I don't see that my warm index will go into delete phase after 28 days. Is there something wrong?

---

<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:** [January 8, 2021, 3:01am UTC](https://discuss.elastic.co/t/index-lifecycle-policy-understanding/258355/2 "2021-01-08T03:01:29Z")

</div>

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