# ILM Delete Phase not working

**URL:** https://discuss.elastic.co/t/ilm-delete-phase-not-working/258559
**Category:** Elasticsearch
**Tags:** ilm-index-lifecycle-management
**Created:** [December 14, 2020, 10:04am UTC](https://discuss.elastic.co/t/ilm-delete-phase-not-working/258559 "2020-12-14T10:04:34Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Anabella\_Cristaldi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anabella_cristaldi/32/23612_2.png) [@Anabella\_Cristaldi](https://discuss.elastic.co/u/Anabella_Cristaldi)
#### Post date: [December 14, 2020, 10:04am UTC](https://discuss.elastic.co/t/ilm-delete-phase-not-working/258559/1 "2020-12-14T10:04:35Z")

</div>

Hi All,  
I have defined an ILM policy with hot, warm and delete phase.  
Hot are warm phase are working as expected, but in spite of the delete phase says "complete", the index is still there...  
Am I misunderstanding something?  
Any help will be appreciated

Thank you!  
Regards  
Ana

* * *

```
ILM Policy
    PUT _ilm/policy/fortitraffic
    {
      "policy": {
        "phases": {
          "hot": {
            "min_age": "0ms",
            "actions": {
              "rollover": {
                "max_size": "49gb",
                "max_age": "36h"
              },
              "set_priority": {
                "priority": 100
              }
            }
          },
          "warm": {
            "min_age": "12h",
            "actions": {
              "allocate": {
                "include": {},
                "exclude": {},
                "require": {
                  "data": "warm"
                }
              },
              "readonly": {}
            }
          },
          "delete": {
            "min_age": "10d",
            "actions": {}
          }
        }
      }
    }

GET forti-traffic-2020.11.28-000010/_ilm/explain
{
  "indices" : {
    "forti-traffic-2020.11.28-000010" : {
      "index" : "forti-traffic-2020.11.28-000010",
      "managed" : true,
      "policy" : "fortitraffic",
      "lifecycle_date_millis" : 1606727187230,
      "age" : "14.03d",
      "phase" : "delete",
      "phase_time_millis" : 1607591787157,
      "action" : "complete",
      "action_time_millis" : 1606814833511,
      "step" : "complete",
      "step_time_millis" : 1607591787157,
      "phase_execution" : {
        "policy" : "fortitraffic",
        "phase_definition" : {
          "min_age" : "10d",
          "actions" : { }
        },
        "version" : 14,
        "modified_date_in_millis" : 1607940141265
      }
    }
  }
}
```

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [December 14, 2020, 10:05am UTC](https://discuss.elastic.co/t/ilm-delete-phase-not-working/258559/2 "2020-12-14T10:05:39Z")

</div>

I believe you need to add a delete action to the delete phase.

---

<div class="post-metadata">

### Author: ![Anabella\_Cristaldi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anabella_cristaldi/32/23612_2.png) [@Anabella\_Cristaldi](https://discuss.elastic.co/u/Anabella_Cristaldi)
#### Post date: [December 14, 2020, 10:06am UTC](https://discuss.elastic.co/t/ilm-delete-phase-not-working/258559/3 "2020-12-14T10:06:48Z")

</div>

Thank you Christian, I though that the action in the delete phase was implicit.  
I'll add and action and see what is happening  
Regards

---

<div class="post-metadata">

### Author: ![Anabella\_Cristaldi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anabella_cristaldi/32/23612_2.png) [@Anabella\_Cristaldi](https://discuss.elastic.co/u/Anabella_Cristaldi)
#### Post date: [December 14, 2020, 10:18am UTC](https://discuss.elastic.co/t/ilm-delete-phase-not-working/258559/4 "2020-12-14T10:18:10Z")

</div>

I did modify ILM policy by API (there is not possible from the UI, this is why I thought that the action of deletion was implicit) and now is like this.  
I think now It will work  
Thank you!

```
PUT _ilm/policy/fortitraffic
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "rollover": {
            "max_size": "49gb",
            "max_age": "36h"
          },
          "set_priority": {
            "priority": 100
          }
        }
      },
      "warm": {
        "min_age": "12h",
        "actions": {
          "allocate": {
            "include": {},
            "exclude": {},
            "require": {
              "data": "warm"
            }
          },
          "readonly": {}
        }
      },
      "delete": {
        "min_age": "10d",
        "actions": {
          "delete": {
            "delete_searchable_snapshot": true
          }
        }
      }
    }
  }
}
```

---

<div class="post-metadata">

### Author: ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)
#### Post date: [December 14, 2020, 10:21am UTC](https://discuss.elastic.co/t/ilm-delete-phase-not-working/258559/5 "2020-12-14T10:21:47Z")

</div>

This is related to this [issue](https://github.com/elastic/elasticsearch/issues/65847), UI allow adding delete phase without action

---

<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 11, 2021, 10:21am UTC](https://discuss.elastic.co/t/ilm-delete-phase-not-working/258559/6 "2021-01-11T10:21:49Z")

</div>

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