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.
server/src/main/java/org/elasticsearch/common/Strings.java
length--;
        }
        return s.substring(0, length);
    }
    /**
     * Checks that the supplied string is neither null nor empty, per {@link #isNullOrEmpty(String)}.
     * If this check fails, then an {@link IllegalArgumentException} is thrown with the supplied message.
     *
     * @param str the <code>String</code> to check
     * @param message the exception message to use if {@code str} is null or empty
     * @return the supplied {@code str}
     */
    public static String requireNonEmpty(String str, String message) {
        if (isNullOrEmpty(str)) {
            throw new IllegalArgumentException(message);
        }
        return str;
    }
    /**
     * Checks that the supplied string is neither null nor blank, per {@link #isNullOrBlank(String)}.
     * If this check fails, then an {@link IllegalArgumentException} is thrown with the supplied message.
     *
     * @param str the <code>String</code> to check
     * @param message the exception message to use if {@code str} is null or blank
     * @return the supplied {@code str}
     */
    public static String requireNonBlank(String str, String message) {
        if (isNullOrBlank(str)) {
            throw new IllegalArgumentException(message);
        }