C H A P T E R 5 |
Command-Line Interface |
This chapter describes the Point-in-Time Copy software's command-line interface (CLI) and provides the syntax of the CLI commands. The CLI is designed to control a single shadow volume set, an I/O group consisting of more than one shadow volume set, or selected volume sets or I/O groups within a specific Sun Cluster resource group. The CLI can be invoked interactively or incorporated into a shell script.
The primary user interface to the Point-in-Time Copy software is the /usr/sbin/iiadm command.
The following terms apply to all examples and explanations in this chapter.
The specific volume set, whose name defaults to the name of its associated shadow volume |
|
The specific I/O group, whose name is created when using a move (to group) or an enable command |
|
The iiadm CLI performs only one action per command invocation. You cannot combine multiple options, except with the -g and -C command modifiers. Command modifiers must be entered after the iiadm command and before any other command options or variables, such as names. Note also that the command option is the last non-variable entry on a command line, which prevents confusion with volume names.
The -g command modifier extends most, but not all, existing commands to act on I/O groups. No specific volume set names are needed because the command is carried out against all volume sets within the I/O group specified.
iiadm -g io-groupname -l
This command line lists (-l) all volume sets in the I/O group, io-groupname.
The -C command modifier enhances all existing commands to act on all volume sets associated with the specified Sun Cluster tag. In a cluster environment, enabling a shadow volume set causes it to be tagged with the current cluster tag. Enable volume sets so that master, shadow, bitmap, and overflow volumes are in the same device group, physical and logical, so that failover works correctly. Commands executed in a cluster environment are executed against all volume sets associated with the current cluster. If you need to execute commands against a cluster other than the current one, the -C option enables you to do that.
iiadm -C cluster -l
This command line lists (-l) all shadow volume sets associated with the specified cluster.
iiadm -C cluster -g io-groupname -l
This command line lists all shadow volume sets in the specified I/O group in the cluster whose tag is cluster.
Note - The core and data services software is cluster aware in the Sun Cluster 3.2 environment and provides high availability for the Sun StorageTek data services. |
The -n command modifier, when used with a copy or update command, skips the printing of a query to stderr that asks if you are sure you want to update the master volume. This is particularly useful in scripts where you don't want the process to halt while waiting for an operator answer. See the full command descriptions for details and warnings about using the -n option.
iiadm -n -c m shadow
iiadm -n -u m shadow
When you type an iiadm command, you must include an option telling the software what to do. Usually, you also type one or more volume, set, and group names, that tell the software where to execute the command.
With few exceptions, only one option can be included on a command line. Here are some examples of command lines illustrating the enable option, -e:
iiadm -e ind master shadowvol bitmap
iiadm -g io-groupname -e dep master shadowvol bitmap
iiadm -C cluster -e ind master shadowvol bitmap
If you type an unsupported action item, iiadm displays a brief summary of the help text to stderr. The help message text can also be called up with the
iiadm -h option.
Here is an example of an incorrectly specified action.
If more than one action item or an incorrectly specified action item is entered, iiadm displays the specific error message to stderr.
There are four configuration parameters that directly influence the operation of the Point-in-Time Copy software. You can use vi or another editor to modify these parameters.
Note - When changing any of the parameters described in this section, you must restart the Availability Suite services using dscfgadm in order for the changes to take effect. |
This parameter defaults to 1 upon installation of the software. Possible settings are 0 and 1. When you enable volume groups, they have this value associated with them. Edit the /usr/kernel/drv/ii.conf file to change this value.
If set to 0, the bitmaps are maintained only in memory and their contents are stored in their respective bitmap volumes across shutdowns. However, if the system crashes, there is a possibility of resulting inconsistent data. This is especially the case if the system crashes during a shadow-to-master update in a compact dependent shadow set.
If set to 1, the bitmaps are maintained in the bitmap volume.
This variable holds the default value for units in the copy parameter command, iiadm -P. You can set the default value (from 100 to 60000) for all newly enabled sets by modifying the ii_throttle_units setting in the /usr/kernel/drv/ii.conf file.
This variable holds the default value for delay in the copy parameter command, iiadm -P. You can set the default value (from 2 to 10000) for all newly enabled sets by modifying the ii_throttle_units setting in the /usr/kernel/drv/ii.conf file.
This variable defaults to a value of 0, but can be set to 1 or 2, each of which generates debugging messages to the console. None of the settings changes the operation of the Point-in-Time Copy software.
All the command options are listed here in alphabetical order.
Use this option when you need to abort any copy or update operation before it completes execution. Data remains valid, but the update or copy to the target volume is incomplete. The target volume is now a dependent copy of the source volume. At a later time, you can reissue the update or copy option to resynchronize the volumes.
Note - See Cautions: Enable, Copy, and Update Operations. |
This option aborts any current copy or update operation on the specified volume set or on all volume sets within an I/O group.
iiadm -a shadow
iiadm -g io-groupname -a
This option attaches an overflow volume to a volume set with a compact dependent shadow or to all volume sets within an I/O group that have compact dependent shadows.
Use this option after you enable a volume set with a compact dependent shadow. You can also use this command to attach an overflow volume to an I/O group containing volume sets with compact dependent shadows.
This option supports the optional -n parameter, which directly performs the requested action without prompting. This option is typically used during script processing.
If the volume you are attaching has not yet been initialized (see To Initialize an Overflow Volume), it will be initialized before it is attached. Be certain that you want to initialize the volume, especially when using the -n option.
Note - When using the -n option, the -n must precede the -A option on the command line (for example, -nA or -n -A). |
iiadm -A overflow shadow
iiadm -g io-groupname -A overflow
iiadm -nA overflow shadow
iiadm -g io-groupname -nA overflow
The copy option writes all the data from either the master volume of the volume set to the shadow volume or from the shadow volume to the master volume. You can also copy all masters to all shadows or all shadows to all masters within an I/O group.
If you do a shadow-to-master copy, the system prints a query that asks if a shadow-to-master copy is what you really want. You can stop this message from being printed by using the -n command option.
You can place the shadow volume set under PID lock by using the -p option. See also PID Locking a Shadow Volume Set.
Use this option to synchronize the master and shadow volumes with a full volume copy. If you do not need a full copy, use the update option instead.
iiadm -c { s | m } shadow
iiadm -g io-groupname -c { s | m }
iiadm -p -c { s | m } shadow
iiadm -g io-groupname -p -c { s | m }
Note - See Interaction With svadm. |
The disable option disables a volume set or disables all volume sets in an I/O group. If you disable an independent volume set, the shadow volume contains valid data and remains accessible. If you disable a dependent volume set, the shadow does not contain valid data, the first 64 KB of the volume are erased, and the volume becomes inaccessible for data retrieval.
Use this option to disable the Point-in-Time Copy software for specific volume sets or for all volume sets in specific I/O groups so that the software no longer maintains the shadow volumes' point-in-time snapshots or the associated bitmaps.
Use this option to terminate a volume set association that is no longer needed, such as when you want an independent shadow copy to use for testing. Once disabled, the volume set is no longer usable except as standalone copies. The set cannot be re-enabled.
iiadm -d shadow
iiadm -g io-groupname -d
Use this option to detach an overflow volume from a volume set or from all volume sets within an I/O group.
This option executes only if the volume set has no data on the overflow volume. One such instance is immediately after a point-in-time snapshot of the master is taken.
iiadm -D shadow
iiadm -g io-groupname -D
Caution - When creating shadow volume sets, do not create shadow or bitmap volumes using partitions that include cylinder 0. Data loss might occur. See VTOC Information. |
The enable option enables a point-in-time copy volume set, composed of the specified master volume, shadow volume, and bitmap volume, and then takes a point-in-time snapshot of the master volume. The shadow volume, dependent or independent, houses the point-in-time copy.
You can enable the volume set as a member of an I/O group by specifying the name of the I/O group. If the I/O group exists, the volume set is attached to it. If the I/O group does not exist, the software creates and attaches the volume set to it. The volume set is enabled as a compact dependent shadow volume if the shadow volume you specify is smaller than the master volume.
Use this option to initially create volume sets. You can create the volume sets with or without assigning them to an I/O group. At a later time, you can move any volume set into any I/O group with the move option.
iiadm -e { ind | dep } master shadowvol bitmap
iiadm -g io-groupname -e { ind | dep } master shadowvol bitmap
Independent shadow. All master volume data is copied to the shadow volume. |
|
Dependent shadow. A master volume-dependent, point-in-time snapshot of the master volume, which is accessible through the shadow volume. |
Use this option to export a shadow volume or all the shadow volumes in an I/O group so that another host can import them. For example, you might do this to continue business transactions on a secondary host while the primary host is unavailable.
iiadm -E shadowvol
iiadm -g io-groupname -E
Use this option to display a summary of help content for all Point-in-Time Copy software options and modifiers.
When you type a command improperly, iiadm sends an abbreviated command usage summary to stderr. Use the -h option to display the usage summary of all iiadm options.
iiadm -h
Use this command when you want to display the status of volume sets. Specify the name of the volume set to check its status, or type all (or leave blank) to check all volume sets. A typical use of this option is to check the status of a copy or update operation before using the target volume for any other operations. See also To Wait for a Copy or Update Operation to Complete.
iiadm -i { shadow | all }
iiadm -g io-groupname -i
Sample output showing a compact dependent shadow volume:
Use this option to import a previously exported shadow volume using a specified bitmap. Use this bitmap later to rejoin the shadow volume to its master volume. This is typically done by a secondary host importing the shadow volume exported by the primary host.
iiadm -I shadowvol bitmap
Use this command to join the shadow volume to its master volume using a specific bitmap. See Exporting, Importing, and Joining Shadows in a Standalone Environment for the sequence for joining a shadow volume to its original master volume.
iiadm -J shadowvol bitmap
Note - You might not need to copy the bitmap to host A if the bitmap is on a dual-ported drive. |
Caution - Once a shadow is rejoined to its original master on host A, host B should not use the shadow volume even if it is still accessible. |
This option lists all volume sets or all volume sets in an I/O group. All configured volume sets, including offline and suspended volume sets, are shown.
iiadm -l
iiadm -g io-groupname -l
Note - Typing iiadm with no options lists the same information as typing
|
This option lists all overflow volumes or all I/O groups.
iiadm -L
iiadm -g -L
Use this option to move one or more volume sets into an I/O group. The volume set can be a member of an existing I/O group or not. The move operation does not involve data operations, so there is no need to quiesce the application before moving the volume set. You can move the volume set into the NULL I/O group, meaning no I/O group, by using two quotation marks instead of an I/O group name.
Most Point-in-Time Copy software options, such as the copy option, can be used with the group command to simplify operations. The move option places volume sets into I/O volume groups so that all volumes in the group can be operated on at the same time by a single command.
iiadm -g io-groupname -m shadow-1 shadow -2 ... shadow-n
iiadm -g "" -m shadow
This option initializes an overflow volume for use with volume sets that were enabled with compact dependent shadow volumes.
Once initialized, the overflow volume can be attached to any number of compact dependent shadow volumes, depending on available space.
If existing overflow volume space is insufficient, use this option after you enable a volume set with a compact dependent shadow volume. Then attach the overflow volume to the volume set to receive any data overflows.
This option supports the optional -n parameter, which directly performs the requested action without prompting. This option is typically used during script processing.
Note - When using the -n option, the -n must precede the -O option on the command line (for example, -nO or -n -O). |
iiadm -O overflow
iiadm -n -O overflow
Use this option to tune the copy process so that copy operations do not excessively consume system resources. A throttled copy is tuned by setting the maximum number of chunks of data (100 through 60000) to be sent between pauses and by setting the length of the pause in system clock ticks (2 through 10000). In this way, the copy proceeds to completion without preventing other processes from using the system. The software defaults to minimum settings for both parameters.
Get copy parameters for a specific volume set by using the iiadm -P shadow command. Get copy parameters for an I/O group by using the
iiadm -g io-groupname -P command.
At installation, the Point-in-Time Copy software defaults to the minimum settings for both delay and units parameters. Use this option to speed up copies if your system has idle time during copy operations. Use this command to slow down copies if other applications require more system resources during copy operations.
Note - If a bitmap volume goes offline, the delay and units parameters revert to the default values when the volume is reset with the iiadm -R command. |
iiadm -P delay units shadow
iiadm -P shadow
iiadm -g io-groupname -P delay units
iiadm -g io-groupname -P
Number of system clock ticks (2 to 10000) between copy operations |
|
Number of chunks of data (100 to 60000) sent before pausing for the set delay |
This option displays the status of the specified overflow volume.
Note - For this command option to work correctly, the overflow volume must be attached to at least one compact dependent shadow volume. |
iiadm -Q overflow
This option returns specific offline volume sets, or all offline volume sets in an I/O group, to the online state.
Use this option to return volume sets to the online state after the condition that caused them to be marked offline has been corrected. After executing this option, the best state available for the volume set is reestablished. A point-in-time snapshot is created or, in the case of independent copy volume sets where the bitmap was offline, the master and shadow volumes are marked as different.
Note - If a bitmap volume goes offline, the delay and units parameters revert to the default values when the volume is reset with the iiadm -R command. |
iiadm -R shadow
iiadm -g io-groupname -R
To Reset a Master Volume With Multiple Shadows |
Caution - The iiadm -g group-Rcommand mustnotbe used with multiple shadows of single masters. All the resets occur at the same time, with unpredictable results. |
If the master volume with multiple shadow volumes is placed offline, return it to the online state with the iiadm -R command, as follows:
1. Reset all independent shadow sets except the shadow set that you want to use to update the master volume.
2. Wait for all reset operations to finish.
3. Reset the volume set that contains the shadow volume you want to use to update the master volume.
4. Wait for the copy to complete.
5. Reset all dependent shadow sets.
Note - See Cautions: Enable, Copy, and Update Operations. |
Use this option to update a volume set or all volume sets in an I/O group. The update can be from master to shadow or from shadow to master.
If you do a shadow-to-master update, the system prints a query that asks if a shadow-to-master update is what you really want. You can stop this message from appearing by using the -n command option.
You can place the shadow volume set under a PID lock with the -p option. See also PID Locking a Shadow Volume Set.
Use this option whenever you want to update the point-in-time shadow copy of the master volume or to update the master from the shadow. The update option incrementally updates the volumes with only changed data, as tracked in the bitmaps. An update is very quickly completed, as compared to a full volume copy. If you need a full volume copy, use the copy option.
iiadm -u { s | m } shadow
iiadm -g io-groupname -u { s | m }
iiadm -p -u { s | m } shadow
iiadm -g io-groupname -p -u { s | m }
Use this option to print the version numbers of the major software modules. For example, you might need to know the software versions before you perform a software update.
iiadm -v
This option causes the system to wait for the Point-in-Time Copy software to complete any in-progress copy or update operation on a volume set or on all volume sets in an I/O group. No other commands can execute on that volume set until the copy or update operation is complete.
Use this command when you need to be sure the copy or update operation has completed before invoking another command that affects that volume set.
Use this command after enabling a shadow volume set with the independent option or after you have issued a copy or update command.
Use this command before you disable a shadow volume set that could have a copy or update operation in progress.
You can also use this command with the -p option to remove a process ID (PID) lock from a volume set if you are the originating process. If you are root, you can use the -n option with the -p option to remove a PID lock from a shadow volume set even if the originating process has terminated.
This command is useful as part of a script.
iiadm -w shadow
iiadm -g io-groupname -w
iiadm -p -w shadow
iiadm -p -n -w shadow
Copyright © 2006, Sun Microsystems, Inc. All Rights Reserved.