We allow characters in the ID of an ILM policy that will result in an invalid snapshot name.

For example, an ILM policy with the name `mypolicy-*` can be created, however, the generation of the snapshot name in this line:

https://github.com/elastic/elasticsearch/blob/befb6faafc9fca327fd3cea2d0ab328a521c4e65/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/GenerateSnapshotNameStep.java#L81

Results in the `mypolicy-*` being part of the snapshot name, which the snapshot service then disallows. We should strip these invalid characters from the snapshot name.
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/GenerateSnapshotNameStep.java
);
        }
        LifecycleExecutionState.Builder newLifecycleState = LifecycleExecutionState.builder(lifecycleState);
        newLifecycleState.setSnapshotIndexName(index.getName());
        newLifecycleState.setSnapshotRepository(snapshotRepository);
        if (lifecycleState.snapshotName() == null) {
            
            String snapshotNamePrefix = ("<{now/d}-" + index.getName() + "-" + policyName + ">").toLowerCase(Locale.ROOT);
            String snapshotName = generateSnapshotName(snapshotNamePrefix);
            ActionRequestValidationException validationException = validateGeneratedSnapshotName(snapshotNamePrefix, snapshotName);
            if (validationException != null) {
                logger.warn(
                    "unable to generate a snapshot name as part of policy [{}] for index [{}] due to [{}]",
                    policyName,
                    index.getName(),
                    validationException.getMessage()
                );
                throw validationException;
            }
            newLifecycleState.setSnapshotName(snapshotName);
        }
        return LifecycleExecutionStateUtils.newClusterStateWithLifecycleState(
            clusterState,
            indexMetadata.getIndex(),
            newLifecycleState.build()
        );
    }
    @Override
    public boolean isRetryable() {
        return true;