# Forcemerge is not allowed in cold phase

**URL:** <https://discuss.elastic.co/t/forcemerge-is-not-allowed-in-cold-phase/208124>\
**Category:** Elasticsearch\
**Created:** [November 15, 2019, 6:58pm UTC](https://discuss.elastic.co/t/forcemerge-is-not-allowed-in-cold-phase/208124 "2019-11-15T18:58:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amitavmohanty01](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/amitavmohanty01/32/58017_2.png) [@amitavmohanty01](https://discuss.elastic.co/u/amitavmohanty01)\
**Post date:** [November 15, 2019, 6:58pm UTC](https://discuss.elastic.co/t/forcemerge-is-not-allowed-in-cold-phase/208124/1 "2019-11-15T18:58:35Z")

</div>

I am trying the following request for ILM:

```
PUT _ilm/policy/test1
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "set_priority": {
            "priority": 100
          }
        }
      },
      "warm": {
        "min_age": "7d",
        "actions": {
          "allocate": {
            "require": {
              "box_type": "warm"
            }
          },
          "set_priority": {
            "priority": 50
          }
        }
      },
      "cold": {
        "min_age": "45d",
        "actions": {
         "allocate": {
            "require": {
              "box_type": "warm"
            }
          },
          "forcemerge": {
            "max_num_segments": "1"
          },
          "freeze": {},
          "set_priority": {
            "priority": 0
          }
        }
      },
      "delete": {
        "min_age": "90d",
        "actions": {
          "delete": {}
        }
      }
    }
  }
}

```

I am getting an error about forcemerge not being allowed in cold phase.

```
{
  "error": {
    "root_cause": [
      {
        "type": "x_content_parse_exception",
        "reason": "Failed to build [lifecycle_policy] after last required field arrived"
      }
    ],
    "type": "x_content_parse_exception",
    "reason": "[48:5] [put_lifecycle_request] failed to parse field [policy]",
    "caused_by": {
      "type": "x_content_parse_exception",
      "reason": "[48:5] [lifecycle_policy] failed to parse field [phases]",
      "caused_by": {
        "type": "x_content_parse_exception",
        "reason": "Failed to build [lifecycle_policy] after last required field arrived",
        "caused_by": {
          "type": "illegal_argument_exception",
          "reason": "invalid action [forcemerge] defined in phase [cold]"
        }
      }
    }
  },
  "status": 400
}

```

Why is the definition of actions in a phase restricted? How can I define custom phases?

---

<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:** [December 13, 2019, 6:58pm UTC](https://discuss.elastic.co/t/forcemerge-is-not-allowed-in-cold-phase/208124/2 "2019-12-13T18:58:45Z")

</div>

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