Overview of policies

A policy is a set of rules that describes the life cycle of user data based on the attributes of files. Each rule defines an operation or definition, such as "migrate to a pool and replicate the file."

You can do the following tasks with rules:
  • Initial file placement
  • File management
  • Restoring file data
  • Encryption-specific uses. For more information, see the topic Encryption in the IBM Spectrum Scale: Administration and Programming Reference.
  • Start of changeFile compression and decompression. For more information, see the topic File compression in the IBM Spectrum Scale: Administration and Programming Reference.End of change
When a file is created or restored, the placement policy determines the location of the file's data and assigns the file to a storage pool. All data written to that file is placed in the assigned storage pool.

The placement policy defining the initial placement of newly created files and the rules for placement of restored data must be installed into GPFS™ with the mmchpolicy command. If a GPFS file system does not have a placement policy installed, all the data is stored in the first data storage pool. Only one placement policy can be installed at a time. If you switch from one placement policy to another, or make changes to a placement policy, that action has no effect on existing files. However, newly created files are always placed according to the currently installed placement policy.

The management policy determines file management operations such as migration, deletion, and file compression or decompression.

In order to migrate or delete data, you must use the mmapplypolicy command. To compress or decompress data, you can use either the mmapplypolicy command with a MIGRATE rule or the mmchattr command. You can define the file management rules and install them in the file system together with the placement rules. As an alternative, you may define these rules in a separate file and explicitly provide them to mmapplypolicy using the -P option. In either case, policy rules for placement or migration may be intermixed. Over the life of the file, data can be migrated to a different storage pool any number of times, and files can be deleted or restored.
Note: In a multicluster environment, the scope of the mmapplypolicy command is limited to the nodes in the cluster that owns the file system.
Note: File compression or decompression using the mmapplypolicy command is not supported on the Windows operating system.

File management rules can also be used to control the space utilization of GPFS online storage pools. When the utilization for an online pool exceeds the specified high threshold value, GPFS can be configured, through user exits, to trigger an event that can automatically start mmapplypolicy and reduce the utilization of the pool. Using the mmaddcallback command, you can specify a script that will run when such an event occurs. For more information, see the topic mmaddcallback command in the IBM Spectrum Scale: Administration and Programming Reference.

GPFS performs error checking for file-placement policies in the following phases:
  • When you install a new policy, GPFS checks the basic syntax of all the rules in the policy.
  • GPFS also checks all references to storage pools. If a rule in the policy refers to a storage pool that does not exist, the policy is not installed and an error is returned.
  • When a new file is created, the rules in the active policy are evaluated in order. If an error is detected, GPFS logs an error, skips all subsequent rules, and returns an EINVAL error code to the application.
  • Otherwise, the first applicable rule is used to store the file data.
Default file placement policy:
When a GPFS file system is first created, the default file placement policy is to assign all files to the system storage pool. You can go back to the default policy by running the command:
mmchpolicy Device DEFAULT

For more information on using GPFS commands to manage policies, see Managing policies.