mmchpolicy command

Establishes policy rules for a GPFS file system.

Synopsis

mmchpolicy Device PolicyFilename [-t DescriptiveName] [-I {yes | test}]

Availability

Available on all IBM Spectrum Scale editions.

Description

Use the mmchpolicy command to establish the rules for policy-based lifecycle management of the files in a given GPFS file system. Some of the things that can be controlled with the help of policy rules are:
  • File placement at creation time
  • Snapshot data placement during file writes and deletes
  • Replication factors
  • Movement of data between storage pools
  • File deletion
The mmapplypolicy command must be run to move data between storage pools or delete files.

Policy changes take effect immediately on all nodes that have the affected file system mounted. For nodes that do not have the file system mounted, policy changes take effect upon the next mount of the file system.

For file systems that are created at or upgraded to product version V4.1.1 or later: If there are no SET POOL policy rules installed to a file system by mmchpolicy, the system acts as if the single rule SET POOL 'first-data-pool' is in effect, where first-data-pool is the firstmost non-system pool that is available for file data storage, if such a non-system pool is available. (Firstmost is the first according to an internal index of all pools.) However, if there are no policy rules installed and there is no non-system pool, the system acts as if SET POOL 'system' is in effect.

This change applies only to file systems that were created at or upgraded to V4.1.1 or later. Until a file system is upgraded, if no SET POOL rules are present (set by mmchpolicy) for the file system, all data will be stored in the 'system' pool.

For information on GPFS policies, see the IBM Spectrum Scale: Administration Guide.

Parameters

Device
Specifies the device name of the file system for which policy information is to be established or changed. File system names need not be fully-qualified. fs0 is just as acceptable as /dev/fs0. This must be the first parameter.
PolicyFilename
Specifies the name of the file that contains the policy rules. If you specify DEFAULT, GPFS replaces the current policy file with a single policy rule that assigns all newly-created files to the system storage pool.

Options

-I {yes | test}
Specifies whether to activate the rules in the policy file PolicyFileName.
yes
The policy rules are validated and immediately activated. This is the default.
test
The policy rules are validated, but not installed.
-t DescriptiveName
Specifies an optional descriptive name to be associated with the policy rules. The string must be less than 256 characters in length. If not specified, the descriptive name defaults to the base name portion of the PolicyFileName parameter.

Exit status

0
Successful completion.
nonzero
A failure has occurred.

Security

You must have root authority to run the mmchpolicy command.

The node on which the command is issued must be able to execute remote shell commands on any other node in the cluster without the use of a password and without producing any extraneous messages. For more information, see Requirements for administering a GPFS file system.

Examples

  1. This command validates a policy before it is installed:
    mmchpolicy fs2 fs2.pol -I test
    The system displays output similar to:
    Validated policy `fs2.pol': parsed 3 Placement Rules, 0 Restore Rules,
     3 Migrate/Delete/Exclude Rules, 0 List Rules, 0 External Pool/List Rules 
  2. This command installs a policy:
    mmchpolicy fs2 fs2.pol
    The system displays output similar to:
    Validated policy `fs2.pol': parsed 1 Placement Rules, 0 Restore Rules,
     0 Migrate/Delete/Exclude Rules, 1 List Rules, 1 External Pool/List Rules
    Policy `fs2.pol' installed and broadcast to all nodes.
    To confirm the change, issue this command:
    mmlspolicy fs2
    The system displays output similar to:
    Policy file for file system '/dev/fs2':
      Installed by root@k155n11.kgn.ibm.com on Mon Dec 12
       16:56:31 2005.
      First line from original file 'fs2.pol' was:
    /* This is the policy for the fs2 GPFS file system. */

Location

/usr/lpp/mmfs/bin