[role="xpack"]
[[ilm-readonly]]
=== Read only

Phases allowed: hot, warm, cold.

Makes the index <<index-blocks-read-only,read-only>>.

To use the `readonly` action in the `hot` phase, the `rollover` action *must* be present.
If no rollover action is configured, {ilm-init} will reject the policy.

[[ilm-read-only-options]]
==== Options

None.

[[ilm-read-only-ex]]
==== Example

[source,console]
--------------------------------------------------
PUT _ilm/policy/my_policy
{
  "policy": {
    "phases": {
      "warm": {
        "actions": {
          "readonly" : { }
        }
      }
    }
  }
}
--------------------------------------------------
