cache_mgt Command

Purpose

Manages the infrastructure that provides caching on the solid-state drive (SSD) devices.

Syntax

cache_mgt object action [-I [level]] [-T [timeout]]

Cache device management command

cache_mgt device list [-l]

Cache pool management commands

cache_mgt pool list [-l]
cache_mgt pool create -d devName[,devName,...][-p poolName] [-f]
cache_mgt pool remove [-p poolName] [-f]
cache_mgt pool extend [-p poolName] -d devName[,devName,...] [-f]

Cache partition management commands

cache_mgt partition list [-l]
cache_mgt partition create [-p poolName] -s partitionSize [-P partitionName]
cache_mgt partition remove [-P partitionName] [-f]
cache_mgt partition extend [-P partitionName] -s partitionSize
cache_mgt partition assign [-P partitionName] -t targetDevName
cache_mgt partition unassign {-t targetDevName | [-P partitionName]} [-f]

Commands to manage caching on target devices

cache_mgt cache list
cache_mgt cache start {-t targetDevName -P partitionName | -t {targetDevName | all} | -f}
cache_mgt cache stop {-t {targetDevName | all} | -p {poolName | all}}

Statistics monitoring commands

cache_mgt monitor start
cache_mgt monitor stop
cache_mgt monitor get {-h -s | -h | -s}

Commands to manage cache engine

cache_mgt engine list [-l]
cache_mgt engine register -n cePath
cache_mgt engine unregister [-n cePath]

Description

The cache_mgt command is used to manage caching on SSD devices. This command provides the following functions:

  • List available SSD devices that can be used to create or extend cache pools on the system.
  • Create, remove, extend, and list the cache pools on the system. A cache pool is a group of SSD devices. Cache partitions are created from the cache pool.
  • Create, remove, extend, assign, unassign, and list the cache partitions on the system. A cache partition is a part of the cache pool. A cache partition must be assigned to a target device that needs to be cached.
  • Start and stop caching of a target device. It also lists the cache partitions along with the assigned target devices and its caching status. A cache engine must be registered before the caching is initiated.
  • Monitor cache statistics.
  • Register and unregister the cache engine. It also lists the registered cache engine information.

Caching modes

Caching can be performed in one of the following modes:

Physical mode
Cache devices (or SSD devices) are directly assigned to a logical partition (LPAR). The cache_mgt commands can be used to manage cache pool, cache partitions, and caching of a target device.
Virtual mode
Cache devices (or SSD devices) are assigned to the Virtual I/O Server. The cache pool and cache partitions are managed on the Virtual I/O Server. Cache partitions on Virtual I/O Server can be virtualized (virtual cache devices) to client LPAR through virtual SCSI. Cache partition assignment and caching must be managed on the LPAR.

Cache engine information

The cache engine module caches the target devices on to the cache partitions. A cache engine is included by default and it is automatically registered on the client LPARs.

Only a single cache pool is supported in the physical mode and caching can be started only on a single cache partition.

Flags

Cache device management commands

Object Action Flags and parameters Description
device list [-l] Lists the SSD devices. If you use the -l flag, the command prints the associated cache pool name.

Cache pool management commands

Object Action Flags and parameters Description
pool list [-l] Lists the cache pools. If you use the -l flag, the command also prints the associated SSD devices.
pool create -d devName[,devName,...] [-p poolName] [-f] Creates a cache pool with the list of SSD devices that are specified with the -d flag. The pool name can also be specified with the -p flag. If the force (-f) flag is specified, a cache pool is created irrespective of the previous use of the devices.
pool remove [-p poolName] [-f] Removes the cache pool. This action fails if a partition still exists in the pool. If the force (-f) flag is specified, all existing partitions within the pool are removed.
pool extend [-p poolName] -d devName[,devName,...] [-f] Extends an existing pool with the list of SSD devices that are specified with the -d flag. If the force (-f) flag is specified, a cache pool is extended irrespective of the previous use of the devices.

Cache partition management commands

Object Action Flags and parameters Description
partition list [-l] Lists the cache partitions (virtual cache devices). If you use the -l flag, the command prints the associated pool name if a partition is a logical volume and the associated target device names, if configured, in a comma-separated format.
partition create [-p poolName] -s partitionSize [-P partitionName] Creates a cache partition in a pool. The pool name can be specified with the -p flag. The partition name can be specified with the -P flag. The partition size must be specified with the -s flag. Size of the partition must be in one of the following units:
  • B/b 512 byte blocks
  • K/k KB
  • M/m MB
  • G/g GB
partition remove [-P partitionName] [-f] Removes a partition from a cache pool. The partition name can be specified with the -P flag.
Note: You must unassign the partition before removing it. Or, use the force (-f) flag to remove it.
partition extend [-P partitionName] -s partitionSize Extends an existing partition by the partitionSize value that is specified with the -s flag. The partitionName value can also be specified with the -P flag.
partition assign [-P partitionName] -t targetDevName Creates the relationship between a cache partition name that is specified with the -P flag and a target device name that is specified with the -t flag in the configuration.

The caching state remains 0 (stopped) and caching operation is not started. You must perform the cache start -t action to start the caching operation and change the caching state in the configuration.

partition unassign -t targetDevName [-f] Removes the relationship between a cache partition and the target device name that is specified with the -t flag in the configuration.

You must stop the caching for the partition before removing it or use the force (-f) flag before removing it.

partition unassign [-P partitionName] [-f] Removes the relationship between a cache partition and all its target devices in the configuration.

You must stop the caching for the partition before removing it or use the force (-f) flag before removing it.

Commands to manage caching on target devices

Object Action Flags and parameters Description
cache list   Lists the partitions for which the caching operation is started.
cache start -t targetDevName -P partitionName Starts the caching operation of a target device name that is specified with the -t flag on a cache partition name that is specified with the -P flag.
cache start -t {targetDevName | all} Starts the caching operation of a target device name that is specified with the -t flag for a previously assigned cache partition. The command starts the caching operation for all assigned target devices if you specify the all option with the -t flag.
cache start -f Loads the cache engine even if there is no cache device.
cache stop -t {targetDevName | all} Stops the caching operation of a target device name that is specified with the -t flag. The command stops the caching operation for all assigned target devices when the all option is specified with the -t flag.

The cache partition assignment definition is not removed from the configuration.

cache stop -p {poolName | all} Stops the caching operation of all target devices of a cache pool name that is specified with the -p flag. The command stops caching for all assigned target devices when the all option is specified with the -p flag.

The cache partition assignment definition is not removed from the configuration.

Statistics monitoring commands

Object Action Flags and parameters Description
monitor start   Starts monitoring the caching operation.
monitor stop   Stops monitoring the caching operation.
monitor get {-h -s | -h | -s} Gets the caching I/O statistics. The command displays the statistics if the -s flag is specified. The command displays the header if the -h flag is specified.

Commands to manage the cache engine

Object Action Flags and parameters Description
engine list [-l] Lists the cache engine path that is set in the configuration. If the -l flag is specified, additional information about the cache engine and its capabilities are listed.
engine register -n cePath Registers the cache engine (cePath) that is specified with the -n flag.
engine unregister [-n cePath] Unregisters the cache engine. If the cePath value is not specified with the -n flag, deactivate the cache engine. You must not remove its definition from the configuration.

Examples

  1. To create a cache pool from a list of cache devices, enter the following command:
    cache_mgt pool create -d hdisk1,hdisk2,hdisk3 -p cmpool0
    The output is displayed similar to the following example:
    Pool cmpool0 created with device hdisk1.
  2. To list the cache pool, enter the following command:
    cache_mgt pool list -l
    The output is displayed similar to the following example:
    cmpool0,hdisk1
  3. To create a cache partition in a pool that has the partition size of 80 MB, enter the following command:
    cache_mgt partition create -p cmpool0 -s 80M -P part1
    The output is displayed similar to the following example:
    Partition part1 created in pool cmpool0.
  4. To list the cache partitions, enter the following command:
    cache_mgt partition list -l
    The output is displayed similar to the following example:
    part1,cmpool0
  5. To assign a cache partition to a target device, enter the following command:
    cache_mgt partition assign -t hdisk2 -P part1
    The output is displayed similar to the following example:
    Partition part1 assigned to target hdisk2.
  6. To start caching of a target device, enter the following command:
    cache_mgt cache start -t hdisk2
    The output is displayed similar to the following example:
    Cache for target hdisk2 has been started.
  7. To list all target devices that are started or for which caching is assigned, enter the following command:
    cache_mgt cache list
    The output is displayed similar to the following example:
    hdisk2,part1,active
  8. To extend an existing cache pool, enter the following command:
    cache_mgt pool extend -p cmpool0 -d hdisk5 -f
    The output is displayed similar to the following example:
    Pool cmpool0 extended with device hdisk5.
  9. To extend an existing cache partition by size 120 MB, enter the following command:
    cache_mgt partition extend -P part1 -s 120M
    The output is displayed similar to the following example:
    Partition part1 extended by size 120M.
  10. To stop the caching operation of a target device, and then to list the partitions, enter the following commands:
    cache_mgt cache stop -t hdisk2 
    
    cache_mgt cache list
    
    The output is displayed similar to the following example:
    Cache for target hdisk2 has been stopped.
    
    hdisk2,part1,inactive
  11. To unassign the target device from a cache partition, enter the following command:
    cache_mgt partition unassign -t hdisk2
    The output is displayed similar to the following example:
    Partition part1 unassigned from target hdisk2.
  12. To remove a cache partition from a cache pool, enter the following command:
    cache_mgt partition remove -P part1
    The output is displayed similar to the following example:
    Partition part1 removed.
  13. To remove the cache pool, enter the following command:
    cache_mgt pool remove -p cmpool0
    The output is displayed similar to the following example:
    Pool cmpool0 removed.