Modifying a Storage Tier Policy

Explains how to modify a storage tier policy using either the Control System, CLI, or the REST API.

If you modify a rule that is currently in use, the changes in the rule are only applied on future offloads; data offloaded using existing rule is not impacted by the change in the rule.

Modifying a Rule Using the Control System

  1. Log in to the Control System and go to Storage Policies tab in the Data > Volumes page.
    Note: The Storage Policies tab is under the Volumes menu in the Kubernetes version of the Control System.
    The list of storage policies displays.
  2. Click the storage policy name to display the Edit Storage Policy window.
  3. Make changes to the rule:
    You can modify the basic rule to:
    • Add () or remove () users and/or groups.
    • Change the name of the users and/or groups.
    • Change the number of days since the file was last modified for users and/or groups.
    If you switch from a basic rule to an advanced rule, all expressions from the basic rule are carried over to the advanced rule. You can modify an advanced rule using a combination of the following expressions:
    u Username or user ID, as configured in the OS registry (such as /etc/passwd file, LDAP, etc.), of a specific user.

    Usage: u:<username or user ID>

    g Group name or group ID, as configured in the OS registry (such as /etc/group file, LDAP, etc.), of a specific group.

    Usage: g:<groupname or group ID>

    a (atime) Time (in seconds or days) since the files were last accessed. The number of seconds can be specified by appending s to value and the number of days can be specified by appending d to the value.

    Usage:

    • "a:<value>s" — specifies atime in seconds
    • "a:<value>d" — specifies atime in days
    All files whose access timestamp (atime) exceeds the specified amount of time are offloaded.
    Note: If the system time on CLDB and file server nodes are different, the atime rule for offloading data may not work as intended.
    Example:
     maprcli tier rule create -name ecrule1 -expr "a:300s"
     maprcli volume create -name ecvol3 -path /ecvol3 -tieringenable true -tiername ectier1 -tieringrule ecrule1 -ecscheme 2+1 -json
     maprcli volume info -name test -json | grep atime
       "atimeUpdateInterval":"300",
       "atimeTrackingStartTime":"2020-09-02 23:27:49 GMT-0700",                 
    In this example, you create a tier rule with atime as 300 seconds and assign it to a volume. Now, when you run the volume info command, you see that the atime interval is set as 300 seconds, along with the date and time when you enabled atime updates (atimeTrackingStartTime).

    Based on this rule, all files that are read later than 300 seconds after you enabled atime (300+atimeTrackingStartTime) seconds, are offloaded.

    aTimeTrackingStartTime is updated to the current time in the following cases:
    • Just started tracking atime, which means that the atimeUpdate frequency was previously zero
    • If the value of atimeUpdate frequency is decreased
    • If the value of atimeUpdate frequency is increased and atime has not been tracked for the duration of the new frequency value
    For more information, see Tuning Last Access Time.
    m (mtime) Time (in seconds or days) since the files were last modified. The number of seconds can be specified by appending s to value and the number of days can be specified by appending d to the value.

    Usage:

    • "m:<value>s" — specifies mtime in seconds
    • "m:<value>d" — specifies mtime in days
    All files whose modification timestamp (mtime) exceeds the specified amount of time are offloaded.
    Note: If the system time on CLDB and file server nodes are different, the mtime rule for offloading data may not work as intended.
    s The size of the file in bytes, kilobytes, megabytes, or gigabytes. The size of the file can be specified by appending one of the following to the value: b for bytes, k for kilobytes, m for megabytes, or g for gigabytes.

    Usage

    • "s:<value>b" — specifies file size in bytes
    • "s:<value>k" — specifies file size in KB
    • "s:<value>m" — specifies file size in MB
    • "s:<value>g" — specifies file size in GB
    All files whose size exceeds the specified size are offloaded.
    Or, use the following:
    p (Default) Specifies all files. Specifies that this operation is applicable to all the files without restriction. This cannot be combined with any other operator.
    "" Indicates none of the files. Specifies that this operation cannot be performed on any of the files.
    Use the following to string multiple criteria for offload:
    & AND operation to combine multiple expressions as the criteria for the rule.
    | OR operation to indicate either of the expressions as the criteria for the rule.
    () Delimiters for subexpressions.

    You cannot switch from an advanced rule that includes the following to a basic rule because the following are not supported in a basic rule:

    • p — All the files
    • s — The size of the file
    • & — The AND operation used for specifying multiple users (u), groups (g), or criteria
    • | — The OR operation used with s or m
    • "" — None of the files.
    • () — Subexpressions
    Note: The basic rule must contain mtime (m). It can also include one or more users or groups separated by the OR operation (|).
  4. Click Save Changes to save the storage policy changes.

Modifying a Rule Using the CLI and the REST API

Run the following command to modify a storage policy:
$ maprcli tier rule modify -name <rule_name> -json
Send a request of type POST. For example:
# curl -k -X POST 'https://abc.sj.us:8443/rest/tier/rule/modify?name=sampleRule&expr=m:3d' --user mapr:mapr
{"timestamp":1523587392465,"timeofday":"2018-04-12 07:43:12.465 GMT-0700 PM","status":"OK","total":0,"data":[],"messages":["Successfully updated rule: 'sampleRule'"]}

For more information, see tier rule modify.