Chapter 17 · Index Lifecycle: Elastic ILM/Data Tiers and OpenSearch ISM

OpenSearch Index State Management Policies, States, Transitions, Actions, Templates, and Simulation

Implement and diagnose an AtlasMart OpenSearch lifecycle with ISM policies, states, ordered actions, transitions, templates, simulation, explain output, and rollover alias semantics.

Intermediate → Advanced115–150 minutesLifecycle automation & retention labElasticsearch 9.5.3 · OpenSearch 3.8.0Last reviewed: September 2026

Learning outcomes

AtlasMart now implements the same lifecycle intent in OpenSearch. The objective is not to “translate ILM JSON.” It is to model explicit ISM states, ordered actions, transition conditions, policy attachment/templates, simulation and managed-index diagnostics.

01

Define ISM policies as states with ordered actions and evaluated transitions.

02

Configure rollover prerequisites, ISM templates and managed-index attachment without broad-wildcard hazards.

03

Use the ISM simulation API to preview transitions/action evaluation before mutation.

04

Read explain output, validation status, policy version and failed-action state, then retry safely.

05

Distinguish OpenSearch allocation/search-only/remote-storage options from Elastic data-tier semantics.

Chapter baseline reviewed 11 September 2026

Examples target self-managed Elasticsearch 9.5.3 / Kibana 9.5.3 and OpenSearch 3.8.0 / OpenSearch Dashboards 3.8.0. AtlasMart keeps https://localhost:9200 for Elasticsearch with CA verification and https://localhost:9201 for the disposable OpenSearch demo certificate using OPENSEARCH_INITIAL_ADMIN_PASSWORD. Existing containers remain atlasmart-es and atlasmart-os. The lifecycle lab uses isolated aliases atlasmart-life-es and atlasmart-life-os, one primary shard and zero replicas so a single-node local lab can run; that topology is not production guidance. OpenSearch demo -k is local-only. No moving latest tags are used.

Lifecycle systems are not interchangeable

Elastic ILM is a phase/action engine integrated with Elastic data tiers. OpenSearch ISM is a plugin state machine with states, ordered actions and transitions. Similar goals such as rollover and deletion do not make policy JSON, policy-update timing, tier semantics, troubleshooting APIs, permissions, managed-service behavior, or feature availability portable.

Execution note

The generation environment does not run the AtlasMart Docker containers. Commands below are reproducible lab instructions, while response snippets are explicitly labeled expected shapes/invariants rather than fabricated measurements. Measure your own transition timing, I/O, CPU, merge time, p95/p99 search latency and storage consumption.

1. ISM is a user-defined state machine

An ISM policy has a default_state, one or more named states, ordered actions inside each state, and transitions evaluated after the state’s actions complete. A managed index is in one state at a time. ISM runs as a background job rather than continuously; upstream documentation states a default job interval of five minutes, and ISM does not run jobs while cluster state is red.

Because transitions are polled, a threshold is not an exact timer. An index can exceed a size/age condition between checks. Capacity planning must include this overshoot rather than assuming the action fires at the exact byte or second.

2. Create the AtlasMart ISM policy

Create states, ordered actions, and transitions
PUT _plugins/_ism/policies/atlasmart-life-os-v1
{
  "policy": {
    "description": "AtlasMart disposable lifecycle lab",
    "default_state": "hot",
    "states": [
      {
        "name": "hot",
        "actions": [
          {"rollover": {"min_doc_count": 3}}
        ],
        "transitions": [
          {"state_name": "warm", "conditions": {"min_rollover_age": "0ms"}}
        ]
      },
      {
        "name": "warm",
        "actions": [
          {"read_only": {}},
          {"force_merge": {"max_num_segments": 1}}
        ],
        "transitions": [
          {"state_name": "delete", "conditions": {"min_index_age": "30d"}}
        ]
      },
      {
        "name": "delete",
        "actions": [{"delete": {}}],
        "transitions": []
      }
    ],
    "ism_template": {
      "index_patterns": ["atlasmart-life-os-*"],
      "priority": 100
    }
  }
}
Lab-only thresholds.

The three-document rollover and zero-millisecond post-rollover transition expose the state machine quickly. Production transitions must encode measured rollover/recovery/retention requirements. Force merge is deliberately restricted to a read-only tiny generation.

3. Rollover still needs an index template and write alias

Configure ISM rollover alias and bootstrap generation
PUT _index_template/atlasmart-life-os-template-v1
{
  "index_patterns": ["atlasmart-life-os-*"],
  "template": {
    "settings": {
      "number_of_shards": 1,
      "number_of_replicas": 0,
      "plugins.index_state_management.rollover_alias": "atlasmart-life-os"
    },
    "mappings": {
      "properties": {
        "@timestamp": {"type":"date"},
        "service.name": {"type":"keyword"},
        "log.level": {"type":"keyword"},
        "message": {"type":"text"}
      }
    }
  }
}

PUT atlasmart-life-os-000001
{
  "aliases": {
    "atlasmart-life-os": {"is_write_index": true}
  }
}

ISM rollover expects a numeric generation suffix such as -000001, a rollover alias setting, and an alias for which the managed index is the write index. The ISM template decides which future indices receive the policy; the index template defines settings/mappings/rollover alias. These are separate artifacts.

Wrong pattern: attach a delete policy with *.

The ISM API warns that a broad wildcard can match system indices, including security metadata. Use a scoped prefix such as atlasmart-life-os-* and review the match set before applying destructive automation.

4. Simulate before mutation

OpenSearch 3.7 introduced the ISM simulation API. In 3.8 it can evaluate a stored or inline policy against specified indices without changing them. The response can report current state, next action and transition-condition evaluation. This is particularly useful for policy reviews and troubleshooting timing.

Preview the stored policy against the bootstrap index
POST _plugins/_ism/simulate
{
  "policy_id": "atlasmart-life-os-v1",
  "indices": ["atlasmart-life-os-000001"]
}

Simulation proves how the policy would evaluate the current metadata. It does not prove the future action will have enough disk, eligible allocation targets, privileges, or acceptable merge/recovery latency.

5. Observe managed state, policy version and action validation

Explain and validate the managed index
GET _plugins/_ism/explain/atlasmart-life-os-000001?show_policy=true
GET _plugins/_ism/explain/atlasmart-life-os-000001?validate_action=true
GET _plugins/_ism/policies/atlasmart-life-os-v1

show_policy=true helps reveal which policy definition is attached to the managed index. The policy document itself exposes version/OCC metadata. Error prevention can validate an upcoming action and surface why rollover, force merge or another operation would fail before execution.

Ingest through the alias, then inspect eventual rollover
POST atlasmart-life-os/_doc
{"@timestamp":"2026-09-11T12:00:00Z","service.name":"checkout","log.level":"INFO","message":"order accepted"}
POST atlasmart-life-os/_doc
{"@timestamp":"2026-09-11T12:00:01Z","service.name":"checkout","log.level":"WARN","message":"inventory retry"}
POST atlasmart-life-os/_doc
{"@timestamp":"2026-09-11T12:00:02Z","service.name":"checkout","log.level":"INFO","message":"order confirmed"}

GET _plugins/_ism/explain/atlasmart-life-os-*?show_policy=true
GET _cat/aliases/atlasmart-life-os?v
GET _cat/indices/atlasmart-life-os-*?v

The expected invariant is eventual creation of a new write generation after a background ISM check, not immediate rollover in the indexing response.

6. Allocation is not Elastic data tiers

ISM supports an allocation action and other OpenSearch-specific capabilities, but these do not turn upstream OpenSearch into Elastic’s data-tier model. If AtlasMart labels nodes with attributes such as temp=warm, an ISM allocation action can require/include/exclude those attributes. That is an explicit topology contract owned by AtlasMart.

The next lesson focuses on policy versioning, safe testing and stuck-state intervention on both products.

Check your understanding

  1. What does an ISM state contain?
  2. Why can rollover overshoot its configured threshold?
  3. What does ISM simulation guarantee?
  4. Why is an ISM warm state not an Elastic warm tier?
  5. Why avoid * when attaching destructive ISM policies?
Review the answers

1. Ordered actions plus transitions checked after the state actions finish.

2. ISM evaluates conditions on background job executions rather than continuously.

3. It previews policy evaluation without mutation; it does not guarantee resources, privileges or performance.

4. State names are user-defined control states; placement semantics must be configured separately.

5. It can match system/security indices and cause catastrophic deletion or mutation.

Summary

OpenSearch ISM is an explicit state machine with ordered actions, transition polling, templates, simulation and managed-index diagnostics. The business intent can resemble ILM, but the policy artifact and operational behavior are different.

Authoritative references

Keep knowledge open

Help the academy stay free and grow.

If these tutorials save you time, a small donation supports new lessons, technical review, diagrams, examples, and long-term maintenance.

ETHEthereum / ERC-20 only
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0

Send only Ethereum or ERC-20 compatible assets to this address.