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.

This chapter includes:


Command Modifiers

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.


Name

Definition

master

The specific master volume referenced in the command

shadow

The specific volume set, whose name defaults to the name of its associated shadow volume

shadowvol

The name of a specific shadow volume

bitmap

The name of a specific bitmap volume

cluster

The name, or tag, of a specific cluster

io-groupname

The specific I/O group, whose name is created when using a move (to group) or an enable command

overflow

The specific overflow volume referenced in the 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.

iiadm -g

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.

Syntax

iiadm -g io-groupname -l 

This command line lists (-l) all volume sets in the I/O group, io-groupname.

iiadm -C

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.

Syntax

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.



-n Option to the -c and -u Command Options

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.

Syntax

iiadm -n -c m shadow
iiadm -n -u m shadow


Command Options

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


Help Information

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.


# iiadm -d
iiadm: option requires an argument -- d
iiadm: unrecognized argument
 
Brief summary:
-e {ind|dep} master_vol shadow_vol bitmap_vol
-[cu {s|m}] volume_set
-[irs] all
-[adDEilPRw] volume_set
-g group_name [options]
-f config_file [options]
-C cluster_tag [options]
-[hilLrsv]
-[IJ] bitmap volume_set
-[OQ] overflow_vol
-P {delay} {units} volume_set

If more than one action item or an incorrectly specified action item is entered, iiadm displays the specific error message to stderr.


Configuration Parameters

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.



ii_bitmap

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.

ii_throttle_units

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.

ii_throttle_delay

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.

ii_debug

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.


Option List

All the command options are listed here in alphabetical order.

To Abort a Copy or Update Operation

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

Syntax

iiadm -a shadow
iiadm -g io-groupname -a

To Attach an Overflow Volume

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

Syntax

iiadm -A overflow shadow
iiadm -g io-groupname -A overflow
iiadm -nA overflow shadow
iiadm -g io-groupname -nA overflow
 

To Copy Volumes



Note - See Cautions: Enable, Copy, and Update Operations



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

Syntax

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 }

Options


s

Update from master to shadow

m

Update from shadow to master




Note - If a remote mirror volume is a target of Point-in-Time Copy update or copy, a remote mirror volume set must be in logging mode for the Point-in-Time Copy software to successfully perform an enable, copy, update, or reset operation on a remote mirror volume. If the set is not in logging mode, the point-in-time copy operation fails and the Remote Mirror software reports that the operation is denied.



 

To Disable Volume Sets



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

Syntax

iiadm -d shadow
iiadm -g io-groupname -d

 

To Detach an Overflow Volume

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

Syntax

iiadm -D shadow
iiadm -g io-groupname -D

To Enable Volume Sets



Note - See Cautions: Enable, Copy, and Update Operations





caution icon

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.



Note - When you are using compact dependent shadow volume sets we suggest that you attach a shared overflow volume right after the sets creation, so as to address a potential out of volume space issue now, instead of later when the compact dependent shadow volume may overflow.



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

Syntax

iiadm -e { ind | dep } master shadowvol bitmap
iiadm -g io-groupname -e { ind | dep } master shadowvol bitmap

Options


[ D ]

ind

Independent shadow. All master volume data is copied to the shadow volume.

dep

Dependent shadow. A master volume-dependent, point-in-time snapshot of the master volume, which is accessible through the shadow volume.




Note - If a Remote Mirror volume is a target of Point-in-Time Copy update or copy, a Remote Mirror volume set must be in logging mode for the Point-in-Time Copy software to successfully perform an enable, copy, update, or reset operation on a Remote Mirror volume. If the set is not in logging mode, the Point-in-Time Copy operation fails and the Remote Mirror software reports that the operation is denied.



To Export a 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

Syntax

iiadm -E shadowvol
iiadm -g io-groupname -E

To Display Command Usage

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

Syntax

iiadm -h

To Display Volume Set Status

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

Syntax

iiadm -i { shadow | all }
iiadm -g io-groupname -i

Options


[ D ]

shadow

Display the status of the named volume set

all

Display the status of all volume sets


Sample output:


# iiadm -i /dev/vx/rdsk/shadowdg/shadowvol1
/dev/vx/rdsk/masterdg/mastervol1: (master volume)
/dev/vx/rdsk/shadowdg/shadowvol1: (shadow volume)
/dev/vx/rdsk/rootdg/bitvol1: (bitmap volume)
Independent copy (this is an independent shadow volume set)
Volume size:      200
Percent of bitmap set: 0 (the bitmap is clean)

Sample output showing a compact dependent shadow volume:


# iiadm -i
/dev/md/rdsk/d3000: (master volume)
/dev/md/rdsk/d3011: (shadow volume)
/dev/md/rdsk/d3021: (bitmap volume)
Dependent copy, compacted shadow space
Volume size:   262144
Shadow chunks total: 2048 Shadow chunks used: 0
Percent of bitmap set: 0
	(bitmap clean)

To Import a 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

Syntax

iiadm -I shadowvol bitmap

To Join a Shadow Volume

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

Syntax

iiadm -J shadowvol bitmap

Options


[ D ]

bitmap

Bitmap volume




Note - You might not need to copy the bitmap to host A if the bitmap is on a dual-ported drive.





caution icon

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.



To List Volume Sets

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

Syntax

iiadm -l
iiadm -g io-groupname -l

Sample output:


# iiadm -l 
ind /dev/vx/rdsk/masterdg/mastervol5 /dev/vx/rdsk/shadowdg/shadowvol5 /dev/vx/rdsk/rootdg/bitvol5
dep /dev/vx/rdsk/masterdg/mastervol4 /dev/vx/rdsk/shadowdg/shadowvol4 /dev/vx/rdsk/rootdg/bitvol4
ind /dev/vx/rdsk/masterdg/mastervol3 /dev/vx/rdsk/shadowdg/shadowvol3 /dev/vx/rdsk/rootdg/bitvol3
dep /dev/vx/rdsk/masterdg/mastervol2 /dev/vx/rdsk/shadowdg/shadowvol2 /dev/vx/rdsk/rootdg/bitvol2
ind /dev/vx/rdsk/masterdg/mastervol1 /dev/vx/rdsk/shadowdg/shadowvol1 /dev/vx/rdsk/rootdg/bitvol1 (suspended)



Note - Typing iiadm with no options lists the same information as typing
iiadm -l.



To List Overflow Volumes or Groups

This option lists all overflow volumes or all I/O groups.

iiadm -L

Syntax

iiadm -L
iiadm -g -L

Sample output:


# iiadm -g -L
groupone
# iiadm -L
/dev/vx/rdsk/rootdg/overflowvol

To Move a Volume Set

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 -m

Syntax

iiadm -g io-groupname -m shadow-1 shadow -2 ... shadow-n
iiadm -g "" -m shadow
 

To Initialize an Overflow Volume

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

Syntax

iiadm -O overflow
iiadm -n -O overflow

To Set Copy Parameters

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

Syntax

iiadm -P delay units shadow
iiadm -P shadow
iiadm -g io-groupname -P delay units
iiadm -g io-groupname -P

Options


[ D ]

delay

Number of system clock ticks (2 to 10000) between copy operations

units

Number of chunks of data (100 to 60000) sent before pausing for the set delay


Sample output:


# iiadm -P /dev/vx/rdsk/shadowdg/shadowvol3
volume: /dev/vx/rdsk/shadowdg/shadowvol3
copy delay: 2
copy unit: 100
# iiadm -g groupone -P
volume: /dev/vx/rdsk/shadowdg/shadowvol2
copy delay: 2
copy unit: 100
volume: /dev/vx/rdsk/shadowdg/shadowvol4
copy delay: 3
copy unit: 1000

To Display Overflow Volume Status

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.



Use this option to determine:

iiadm -Q

Syntax

iiadm -Q overflow

Sample output:


# iiadm -Q /dev/vx/rdsk/rootdg/overflowvol
Total number of attached shadows: 1
Number of currently attached shadows: 1
Total number of chunks: 159
Number of chunks ever allocated: 1
Number of unused chunks: 158

To Reset a Volume Set or I/O Volume Group

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

Syntax

iiadm -R shadow
iiadm -g io-groupname -R


Note - If a remote mirror volume is a target of Point-in-Time Copy update or copy, a remote mirror volume set must be in logging mode for the Point-in-Time Copy software to successfully perform an enable, copy, update, or reset operation on a remote mirror volume. If the set is not in logging mode, the point-in-time copy operation fails and the Remote Mirror software reports that the operation is denied.




procedure icon To Reset a Master Volume With Multiple Shadows



caution icon

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.


# iiadm -R shadow shadow2 ... shadowN

2. Wait for all reset operations to finish.


# iiadm -w shadow shadow2 ... shadowN

3. Reset the volume set that contains the shadow volume you want to use to update the master volume.


# iiadm -R shadow

4. Wait for the copy to complete.


# iiadm -w shadow

5. Reset all dependent shadow sets.


# iiadm -R shadow shadow2 ... shadowN

 

To Update a Volume Set



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

Syntax

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 }

Options


[ D ]

s

Update from master to shadow

m

Update from shadow to master




Note - If a remote mirror volume is a target of Point-in-Time Copy update or copy, a remote mirror volume set must be in logging mode for the Point-in-Time Copy software to successfully perform an enable, copy, update, or reset operation on a remote mirror volume. If the set is not in logging mode, the point-in-time copy operation fails and the Remote Mirror software reports that the operation is denied.



 

To Print Software Versions

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

Syntax

iiadm -v

Sample output:


# iiadm -v
PointInTime version 11.10

To Wait for a Copy or Update Operation to Complete

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

Syntax

iiadm -w shadow
iiadm -g io-groupname -w
iiadm -p -w shadow
iiadm -p -n -w shadow