Forcemerge is not allowed in cold phase

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?

1 Like

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