Chapter 3. Automated Space Management

The dmfsmon(8) daemon monitors the free-space levels in filesystems configured with automated space management enabled (auto). When the free space in one of the filesystems falls below the free-space minimum, dmfsmon invokes dmfsfree(8). The dmfsfree command attempts to bring the free space and migrated space of a filesystem into compliance with configured values. dmfsfree may also be invoked directly by system administrators.

When the free space in one of the filesystems falls below its minimum, the dmfsfree command performs the following steps:

The dmfsmon daemon should be running whenever DMF is active. You control automated space management by setting the filesystem and policy configuration parameters in the DMF configuration file. The configuration parameters specify targets for migration and free space as well as one or more policies for weighting. Only filesystems configured as MIGRATION_LEVEL auto in the configuration file are included in the space-management process. “Configuring DMF Policies” in Chapter 2, describes how to configure automated space management.

You can change the migration level of a filesystem by editing the configuration file.

The following sections describe space management and associated processes:

Generating the Candidate List

The first step in the migration process occurs when dmfsmon determines it is time to invoke dmfsfree, which scans the filesystem and generates the candidate list. During candidate list generation, the inode of each online file in the specified filesystem is audited and a weight is computed for it.

A filesystem is associated with a weighting policy in the DMF configuration file. The applicable weighting policy determines a file's total weight, or, if a ranges clause is specified in the configuration file, the range's total weight. Total file or range weight is the sum of the AGE_WEIGHT and SPACE_WEIGHT parameters. Defaults are provided for these parameters, and you can configure either to make a change. You do not need to configure a weighting policy if the defaults are acceptable, but you should be aware that the default selects files based on age and not on size. If you want to configure a policy based on size that ignores file age, you should overwrite the default for AGE_WEIGHT.

The default weighting policy bases the weight of the file on the time that has passed since the file was last accessed or modified. Usually, the more recent a file's access, the more likely it is to be accessed again.

The candidate list is ordered by total file or range weight (largest to smallest). You can prevent a file from being automatically migrated by making sure that no ranges within the file have a positive weight value. You can configure the weighting parameters to have a negative value to ensure that certain files or ranges are never automatically freed.


Note: If you use negative weights to exclude files or ranges from migration, you must ensure that a filesystem does not fill with files or ranges that are never selected for automatic migration.

You can use the dmscanfs(8) command to print file information to standard output (stdout).

Selection of Migration Candidates

The dmfsfree(8) utility processes each ordered candidate list sequentially, seeking candidates to migrate and possibly free. The extent of the selection process is governed by values defined for the filesystem in the DMF configuration file as described in “Configuring DMF Policies” in Chapter 2.

The most essential parameters are as follows:

  • FREE_SPACE_MINIMUM specifies the minimum percentage of filesystem space that must be free. When this value is reached, dmfsmon will take action to migrate and free enough files or ranges to bring the filesystem into compliance. For example, setting this parameter to 10 indicates that when less than 10% of the filesystem space is free, dmfsmon will migrate and free files to achieve the percentage of free space specified by FREE_SPACE_TARGET. For the information on how this parameter is used when automated space management is not configured, see the dmf.conf(5) man page.

  • FREE_SPACE_TARGET specifies the percentage of free filesystem space dmfsmon will try to achieve if free space falls below FREE_SPACE_MINIMUM. For example, if this parameter is set to 15 and FREE_SPACE_MINIMUM is set to 10, dmfsmon takes action when the filesystem is less than 10% free and migrates and frees files until 15% of the filesystem is available.

  • MIGRATION_TARGET specifies the percentage of filesystem capacity that is maintained as a reserve of space that is free or occupied by dual-state files. DMF attempts to maintain this reserve in the event that the filesystem free space reaches or falls below FREE_SPACE_MINIMUM.

When dmfsmon detects that the free space on a filesystem has fallen below the level you have set as FREE_SPACE_MINIMUM , it invokes dmfsfree to select a sufficient number of candidates to meet the FREE_SPACE_TARGET. The dmfsfree utility ensures that these files are fully migrated and releases their disk blocks. It then selects additional candidates to meet the MIGRATION_TARGET and migrates them.

Figure 3-1 shows the relationship of automated space management migration targets to each other. Migration events occur when file activity causes free filesystem space to drop below FREE_SPACE_MINIMUM. dmfsmon generates a candidate list and begins to migrate files and free the disk blocks until the FREE_SPACE_TARGET is met, and then it migrates regular files (creating dual-state files) until the MIGRATION_TARGET is met.

Figure 3-1. Relationship of Automated Space Management Targets

Relationship of Automated Space Management
Targets

If dmfsmon does not find enough files to migrate (because all remaining files are exempt from migration), it uses another configuration parameter to decrement FREE_SPACE_MINIMUM .

FREE_SPACE_DECREMENT specifies the percentage of filesystem space by which dmfsmon will decrement FREE_SPACE_MINIMUM if it cannot find enough files to migrate to reach FREE_SPACE_MINIMUM. For example, suppose FREE_SPACE_MINIMUM is set to 10 and FREE_SPACE_DECREMENT is set to 2. If dmfsmon cannot find enough files to migrate to reach 10% free space, it will decrement FREE_SPACE_MINIMUM to 8 and try to find enough files to migrate so that 8% of the filesystem is free. If dmfsmon cannot achieve this percentage, it will decrement FREE_SPACE_MINIMUM to 6. dmfsmon will continue until it reaches a value for FREE_SPACE_MINIMUM that it can achieve, and it will try to maintain that new value. dmfsmon restores FREE_SPACE_MINIMUM to its configured value when it can be achieved. The default value for FREE_SPACE_DECREMENT is 2.


Note: DMF manages real-time partitions differently than files in a normal partition. The dmfsfree command can only migrate files in the non-real-time partition; it ignores files in the real-time partition. Any configuration parameters you set will apply only to the non-real-time partition. Files in the real-time partition can be manually migrated with the commands dmget(1), dmput(1), and dmmigrate(8). Files are retrieved automatically when they are read.


Space Management and the Disk Cache Manager

DMF prevents the DCM cache from filling by following the same general approach it takes with DMF-managed filesystems, with the following differences:

  • The disk MSP (dmdskmsp) monitors the cache, instead of a separate monitoring program such as dmfsmon

  • The dmdskfree utility controls the movement of cache files to tape. This is analogous to dmfsfree .


Note: DCM uses parameters that are similar to those used for the disk MSP, although some names are different. See “DCM Policies” in Chapter 2.


Automated Space Management Log File

All of the space-management commands record their activities in a common log file, autolog. yyyymmdd (where yyyymmdd is the year, month, and day of log file creation). The first space-management command to execute on a given day creates the log file for that day. This log file resides in the directory SPOOL_DIR/ daemon_name (The SPOOL_DIR value is specified by the SPOOL_DIR configuration parameter; see “Configuring the Base Object” in Chapter 2). The space-management commands create the daemon_name subdirectory in SPOOL_DIR if it does not already exist. The full pathname of the common log file follows:

SPOOL_DIR/daemon_name/autolog.yyyymmdd

Each line in the autolog file begins with the time of message issue, followed by the process number and program name of the message issuer. The remainder of the line contains informative or diagnostic information such as the following:

  • Name of the filesystem being processed

  • Number of files selected for migration and freeing

  • Number of disk blocks that were migrated and freed

  • Names of any other DMF commands executed

  • Command's success or failure in meeting the migration and free-space targets

The following excerpt show the format of an autolog file:

11:37:40-V   147432-dmfsmon /dmf3 - free_space=15.44, minimum=15
11:39:40-V   147432-dmfsmon /dmf3 - free_space=15.18, minimum=15
11:40:30-I   147432-dmfsmon Started 151212 for execution on /dmf3
11:40:34-I   151212-dmfsfree /dmf3 - Number of blocks in the filesystem = 33544832
11:40:34-I   151212-dmfsfree /dmf3 - Number of blocks in the free space target = 8386208 (25%)
11:40:34-I   151212-dmfsfree /dmf3 - Number of blocks currently free = 5029896 (15.0%)
11:40:34-I   151212-dmfsfree /dmf3 - Number of blocks to free = 3356312 (10.0%)
11:40:34-I   151212-dmfsfree /dmf3 - Number of blocks in the migration target =
23481382 (70%)
11:40:34-I   151212-dmfsfree /dmf3 - Number of blocks currently migrated = 15817032 (47.2%)
11:40:34-I   151212-dmfsfree /dmf3 - Number of blocks to migrate = 2634454 (7.9%)
11:40:34-I   151212-dmfsfree /dmf3 - Summary of files: online = 6277, offline =
1909, unmigrating = 0, partial = 594.
11:40:34-I   151212-dmfsfree /dmf3 - Number of candidates = 6681, rejected files = 0, rejected ranges = 290
11:40:42-I   151212-dmfsfree /dmf3 - Migrated 2635416 blocks in 559 files.
11:40:42-I   151212-dmfsfree /dmf3 - Freed 3367326 blocks in 853 requests.
11:40:42-O   151212-dmfsfree /dmf3 - Exiting: minimum reached - targets met by outstanding requests.