# ILM not triggering delete phase

**URL:** <https://discuss.elastic.co/t/ilm-not-triggering-delete-phase/180767>\
**Category:** Elasticsearch\
**Created:** [May 13, 2019, 9:13am UTC](https://discuss.elastic.co/t/ilm-not-triggering-delete-phase/180767 "2019-05-13T09:13:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![willemdh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/willemdh/32/16922_2.png) [@willemdh](https://discuss.elastic.co/u/willemdh)\
**Post date:** [May 13, 2019, 9:13am UTC](https://discuss.elastic.co/t/ilm-not-triggering-delete-phase/180767/1 "2019-05-13T09:13:20Z")

</div>

Hello,

I've been playing around with Index Lifecycle Management lately. Things are working more or less as expected. Indices are rolled over as defined in the ilm policy.

What does not seem to be working is the `delete phase`. Somehow indices older then the configured amount of time in the delet phase of the ilm policy are not deleted.

My ilm policy:

```
{
  "ilm_policy_sflow" : {
    "version" : 13,
    "modified_date" : "2019-05-09T13:52:21.731Z",
    "policy" : {
      "phases" : {
        "hot" : {
          "min_age" : "0ms",
          "actions" : {
            "rollover" : {
              "max_size" : "250mb",
              "max_age" : "2d"
            },
            "set_priority" : {
              "priority" : 100
            }
          }
        },
        "delete" : {
          "min_age" : "4d",
          "actions" : {
            "delete" : { }
          }
        }
      }
    }
  }
}

```

My indices which have the above policy:

```
health status index pri rep docs.count docs.deleted store.size memory.total
green open sflow-2019.05.09-000001 2 1 4147111 0 2gb 3.8mb
green open sflow-2019.05.10-000002 2 1 1008748 0 511.8mb 1.2mb
green open sflow-2019.05.10-000003 2 1 1008827 0 513.1mb 1.2mb
green open sflow-2019.05.11-000004 2 1 1008801 0 513.1mb 1.1mb
green open sflow-2019.05.11-000005 2 1 1008727 0 511.8mb 1mb
green open sflow-2019.05.11-000006 2 1 1008760 0 511.8mb 1.1mb
green open sflow-2019.05.11-000007 2 1 1008817 0 512.3mb 1.1mb
green open sflow-2019.05.12-000008 2 1 1008802 0 512.2mb 1.2mb
green open sflow-2019.05.12-000009 2 1 1008771 0 512.1mb 1.1mb
green open sflow-2019.05.12-000010 2 1 1008813 0 512.9mb 1mb
green open sflow-2019.05.12-000011 2 1 1008736 0 509.1mb 1mb
green open sflow-2019.05.13-000012 2 1 1008862 0 512.4mb 1.1mb
green open sflow-2019.05.13-000013 2 1 539250 0 276.2mb 14.4mb

```

An explain on the current write index:

```
GET sflow-2019.05.13-000013/_ilm/explain
{
  "indices" : {
    "sflow-2019.05.13-000013" : {
      "index" : "sflow-2019.05.13-000013",
      "managed" : true,
      "policy" : "ilm_policy_sflow",
      "lifecycle_date_millis" : 1557727128647,
      "phase" : "hot",
      "phase_time_millis" : 1557727128760,
      "action" : "rollover",
      "action_time_millis" : 1557727728703,
      "step" : "check-rollover-ready",
      "step_time_millis" : 1557727728703,
      "phase_execution" : {
        "policy" : "ilm_policy_sflow",
        "phase_definition" : {
          "min_age" : "0ms",
          "actions" : {
            "rollover" : {
              "max_size" : "250mb",
              "max_age" : "2d"
            },
            "set_priority" : {
              "priority" : 100
            }
          }
        },
        "version" : 13,
        "modified_date_in_millis" : 1557409941731
      }
    }
  }
}

```

Please advise how to get the delete phase working.

Willem

---

<div class="post-metadata">

**Author:** ![syed\_faheem\_Hussain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/syed_faheem_hussain/32/46047_2.png) [@syed\_faheem\_Hussain](https://discuss.elastic.co/u/syed_faheem_Hussain)\
**Post date:** [May 15, 2019, 5:55pm UTC](https://discuss.elastic.co/t/ilm-not-triggering-delete-phase/180767/2 "2019-05-15T17:55:46Z")

</div>

> [@willemdh](#):
>
> nt of

Can you please let me know as to where can we add this policy for index?

---

<div class="post-metadata">

**Author:** ![gbrown](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gbrown/32/34482_2.png) [@gbrown](https://discuss.elastic.co/u/gbrown)\
**Post date:** [May 17, 2019, 5:21am UTC](https://discuss.elastic.co/t/ilm-not-triggering-delete-phase/180767/3 "2019-05-17T05:21:35Z")

</div>

Hi Willem,

Could you post the output of the `_ilm/explain` API for at least one of the indices that you expect to have been deleted?

Edit to be clear: Not the current one, but for one which is more than 4 days past rollover, that you would expect to have already been deleted per your ILM policy. For example,`sflow-2019.05.09-000001` (although any index that meets this criteria will be fine, it doesn't have to be that one in particular).

---

<div class="post-metadata">

**Author:** ![willemdh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/willemdh/32/16922_2.png) [@willemdh](https://discuss.elastic.co/u/willemdh)\
**Post date:** [May 17, 2019, 8:36am UTC](https://discuss.elastic.co/t/ilm-not-triggering-delete-phase/180767/4 "2019-05-17T08:36:39Z")

</div>

@gbrown In the meantime it seems the sflow indices started deleting after all. So Consider this case closed.

---

<div class="post-metadata">

**Author:** ![syed\_faheem\_Hussain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/syed_faheem_hussain/32/46047_2.png) [@syed\_faheem\_Hussain](https://discuss.elastic.co/u/syed_faheem_Hussain)\
**Post date:** [May 17, 2019, 6:24pm UTC](https://discuss.elastic.co/t/ilm-not-triggering-delete-phase/180767/5 "2019-05-17T18:24:10Z")

</div>

Hi Willem ,

May I know where have you set this to policy in which file ?

---

<div class="post-metadata">

**Author:** ![gbrown](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gbrown/32/34482_2.png) [@gbrown](https://discuss.elastic.co/u/gbrown)\
**Post date:** [May 18, 2019, 3:37am UTC](https://discuss.elastic.co/t/ilm-not-triggering-delete-phase/180767/6 "2019-05-18T03:37:13Z")

</div>

@syed_faheem_Hussain Does the [ILM Getting Started Guide](https://www.elastic.co/guide/en/elasticsearch/reference/7.0/getting-started-index-lifecycle-management.html) help?

If not, could you please create a new topic with your question, rather than reusing this one? That will allow more people to see your question and repsond, and make it easier for other people with the same question to find it in the future.

---

<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:** [June 15, 2019, 3:37am UTC](https://discuss.elastic.co/t/ilm-not-triggering-delete-phase/180767/7 "2019-06-15T03:37:30Z")

</div>

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