You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: manage-data/lifecycle/index-lifecycle-management/policy-apply.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,20 +8,21 @@ products:
8
8
9
9
# Manually apply a lifecycle policy to an index [apply-policy-manually]
10
10
11
-
When you create a new {{es}} index, it automatically picks up settings, mappings, and aliases from any matching [index template](/manage-data/data-store/templates.md#index-templates) and its component templates. If the template specifies a lifecycle policy, that policy is applied to the new index as soon as it's created. This process is described in detail in [Configure a lifecycle policy](/manage-data/lifecycle/index-lifecycle-management/configure-lifecycle-policy.md).
11
+
When you create a new {{es}} index, it automatically picks up settings, mappings, and aliases from any matching [index template](/manage-data/data-store/templates.md#index-templates) and its component templates. If the template specifies a lifecycle policy, that policy is applied to the new index as soon as it's created so that the index will be managed by {{ilm-init}}. This process is described in detail in [Configure a lifecycle policy](/manage-data/lifecycle/index-lifecycle-management/configure-lifecycle-policy.md).
12
12
13
-
You can also apply a lifecycle policy manually to existing indices, as described on this page. This is useful if you want to:
13
+
You can also apply a lifecycle policy manually to existing indices that are not yet managed, as described on this page. This is useful if you want to:
14
14
* Configure the indices to move through different [data tiers](/manage-data/lifecycle/data-tiers.md) as they age.
15
15
* Perform [lifecycle actions](elasticsearch://reference/elasticsearch/index-lifecycle-actions/index.md) such as downsampling or shrinking.
16
16
* Delete the indices when they reach a certain age.
17
17
18
-
If an index is currently managed by an ILM policy you must first remove that policy before applying a new one. Refer to [Switch to a different lifecycle policy](/manage-data/lifecycle/index-lifecycle-management/policy-updates.md#switch-lifecycle-policies) for details.
18
+
:::{warning}
19
+
Consider the following before manually applying a policy to an index:
19
20
20
-
You can do this procedure in {{kib}} or using the {{es}} API.
21
+
* If an index is currently managed by an ILM policy you must first remove that policy before applying a new one. To remove or make changes to an {{ilm-init}} policy currently applied to one or more indices, or to switch indices to use a different policy, refer to [Update or switch a lifecycle policy](/manage-data/lifecycle/index-lifecycle-management/policy-updates.md).
22
+
* Do not manually apply a policy that uses the rollover action. Policies that use rollover must be applied by the [index template](/manage-data/lifecycle/index-lifecycle-management/configure-lifecycle-policy.md#apply-policy-template). Otherwise, the policy is not carried forward when the rollover action creates a new index.
23
+
:::
21
24
22
-
::::{warning}
23
-
Do not manually apply a policy that uses the rollover action. Policies that use rollover must be applied by the [index template](/manage-data/lifecycle/index-lifecycle-management/configure-lifecycle-policy.md#apply-policy-template). Otherwise, the policy is not carried forward when the rollover action creates a new index.
24
-
::::
25
+
You can do this procedure in {{kib}} or using the {{es}} API.
You can change how the lifecycle of an index or collection of rolling indices is managed by modifying the current policy or switching to a different policy.
15
13
16
14
To ensure that policy updates don’t put an index into a state where it can’t exit the current phase, the phase definition is cached in the index metadata when it enters the phase. If changes can be safely applied, {{ilm-init}} updates the cached phase definition. If they cannot, phase execution continues using the cached definition.
17
15
18
16
When the index advances to the next phase, it uses the phase definition from the updated policy.
19
17
18
+
To configure an index not currently managed by {{ilm-init}} to be governed by an lifecycle policy, refer to [Manually apply a policy to an index](/manage-data/lifecycle/index-lifecycle-management/policy-apply.md).
0 commit comments