WHERE FILE_SIZE > 5242880 AND (CURRENT_TIMESTAMP - MODIFICATION_TIME > INTERVAL '5' MINUTES) AND is_resident AND NOT user_exclude_list 

The second policy is a fail-safe policy that needs to be set so when a low disk space event is triggered, the fail-safe policy can be called. Adding the WEIGHT  attribute to the policy enables the user to choose whether they want to start stubbing large files first or least recently used files. When the fail-safe policy starts running, it frees up the disk space to a set percentage. 

The following are the commands for setting a fail-safe policy and calling mmadcallback : 

GLYPH<SM590000> mmchpolicy gpfs failsafe_policy.txt 

GLYPH<SM590000> mmaddcallback MIGRATION --command /usr/lpp/mmfs/bin/mmapplypolicy --event lowDiskSpace --parms “%fsName -B 20000 -m <2x the number of drives> --single-instance” 

After setting the policy with the mmchpolicy  command, run mmaddcallback  with the fail-safe policy. This policy runs periodically to check whether the disk space has reached the threshold where stubbing is required to free up space. 

Example 8-9 shows a simple failsafe_policy.txt , which gets triggered when the IBM Spectrum Scale disk space reaches 80% full, and stubs least recently used files until the disk space has 50% occupancy. 

define(user_exclude_list,(PATH_NAME LIKE '/ibm/gpfs/.ltfsee/%' OR PATH_NAME LIKE '/ibm/gpfs/.SpaceMan/%')) define(is_premigrated,(MISC_ATTRIBUTES LIKE '%M%' AND MISC_ATTRIBUTES NOT LIKE '%V%')) define(is_migrated,(MISC_ATTRIBUTES LIKE '%V%')) define(is_resident,(NOT MISC_ATTRIBUTES LIKE '%M%')) RULE 'SYSTEM_POOL_PLACEMENT_RULE' SET POOL 'system' RULE EXTERNAL POOL 'LTFSEE_FILES' EXEC '/opt/ibm/ltfsee/bin/ltfsee' OPTS '-p primary@lib_ltfsee copy@lib_ltfsee copy2@lib_ltfsee' SIZE(20971520) RULE 'LTFSEE_FILES_RULE' MIGRATE FROM POOL 'system' THRESHOLD(80,50) WEIGHT(CURRENT_TIMESTAMP - ACCESS_TIME) TO POOL 'LTFSEE_FILES' WHERE FILE_SIZE > 5242880 AND is_premigrated AND NOT user_exclude_list 

