# ILM not deleting indices

**URL:** <https://discuss.elastic.co/t/ilm-not-deleting-indices/234437>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [May 27, 2020, 1:25am UTC](https://discuss.elastic.co/t/ilm-not-deleting-indices/234437 "2020-05-27T01:25:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guerreiro\_Sousa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guerreiro_sousa/32/46074_2.png) [@Guerreiro\_Sousa](https://discuss.elastic.co/u/Guerreiro_Sousa)\
**Post date:** [May 27, 2020, 1:25am UTC](https://discuss.elastic.co/t/ilm-not-deleting-indices/234437/1 "2020-05-27T01:25:28Z")

</div>

I created this policy for testing e apliquei a um template:

```auto
{
    "policy": {
      "phases": {
        "hot": {
          "min_age": "0ms",
          "actions": {
            "set_priority": {
              "priority": 100
            }
          }
        },
        "delete": {
          "min_age": "60ms",
          "actions": {
            "delete": {}
          }
        }
      }
    }
}

```

However, the index is not being excluded. The return from /\_ilm/explain shows:

```auto
{
  "indices": {
    "example-index-name": {
      "index": "example-index-name",
      "managed": true,
      "policy": "example-policy-name",
      "lifecycle_date_millis": 1590542282531,
      "age": "2.48m",
      "phase": "delete",
      "phase_time_millis": 1590542283687,
      "action": "delete",
      "action_time_millis": 1590542283687,
      "step": "wait-for-shard-history-leases",
      "step_time_millis": 1590542283687,
      "phase_execution": {
        "policy": "example-policy-name",
        "phase_definition": {
          "min_age": "60ms",
          "actions": {
            "delete": {}
          }
        },
        "version": 3,
        "modified_date_in_millis": 1590542258883
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![dakrone](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dakrone/32/23351_2.png) [@dakrone](https://discuss.elastic.co/u/dakrone)\
**Post date:** [May 27, 2020, 4:09am UTC](https://discuss.elastic.co/t/ilm-not-deleting-indices/234437/2 "2020-05-27T04:09:16Z")

</div>

By default ILM actions are only checked every 10 minutes, so even with your example setting it to 60 milliseconds, it can take some time for the index to actually be deleted. I recommend you either set the setting lower (you can set it to something like 10 seconds for testing). See [https://www.elastic.co/guide/en/elasticsearch/reference/7.6/ilm-settings.html#\_cluster\_level\_settings](https://www.elastic.co/guide/en/elasticsearch/reference/7.6/ilm-settings.html#_cluster_level_settings) for the setting

For production, I don't recommend you set it that low, however.

---

<div class="post-metadata">

**Author:** ![Guerreiro\_Sousa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guerreiro_sousa/32/46074_2.png) [@Guerreiro\_Sousa](https://discuss.elastic.co/u/Guerreiro_Sousa)\
**Post date:** [May 27, 2020, 11:59am UTC](https://discuss.elastic.co/t/ilm-not-deleting-indices/234437/3 "2020-05-27T11:59:34Z")

</div>

Thank you very much. Shortening the interval in a test environment and considering your explanation all worked as expected.

---

<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 24, 2020, 11:59am UTC](https://discuss.elastic.co/t/ilm-not-deleting-indices/234437/4 "2020-06-24T11:59:45Z")

</div>

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