Unable to create ILM policy using version 6.8.8

I am trying to hit the POST _ilm/policy/test-policy API with the corresponding body. The version is 6.8.8 but the on prem elastic does not have the xpack plugin.

The API throws the error: Invalid index name exception. Invalid index name _ilm must not start with _,-,+.

What is the root cause?

You are running a very old version that has been EOL for a long time so I would recommend you upgrade. Version 6.8 has the required plugins bundled by default unless you are running the OSS distribution (sounds like that may be the case) so verify the version and distribution the cluster is running. Also check settings so you are not disabling anything.

As this is a very old version it is important that you look at the correct version of the documentation as the API has changed over time. I am not sure the ability to test a policy exists in the version you are running even if you have the default distribution.

If you are using the OSS distribution you will need to upgrade to the default distribution before ILM is available. I have not used the OSS version, especially on this very old version, so will not be able to help much with that.

You are right regarding the use of OSS version. I verified that even the 6.8.8 oss version supports ilm given that xpack is present. I understand that upgrading is necessary. But installing the xpack plugin separately is a valid solution right?

Can you please show the output here?

How did you do this? This version is so old that I do not recall exactly what was and was not available in the OSS version, so I could very well be wrong here.

I verified here: Install Elasticsearch with Docker | Elasticsearch Guide [6.8] | Elastic

Which is the official documentation linked to the 6.8.8 oss version.

Sorry cannot paste the api response for security reasons. The version is displayed as 6.8 for sure.

That seems to download the default distribution so please curl <IP>:9200 against the docker instance to see exactly which distribution you tested on.

There is nothing security related there, but if you do not want to post it all just copy the exact version and distribution.

If ILM is available with the OSS distribution you will need to check if your cluster is secured and if so how it is secured. A lot of users that have the OSS distribution installed use some third-party security plugin, and it is quite possible this is not aware of all interfaces and block access.

Tried the 9200 port. Version number is 6.8.8 and build_flavor is oss.

OK. If that is the case I would recommend looking at security as mentioned earlier.