cmdsess

Use the cmdsess command to run a specific action against a session.

Syntax

Tip: To list all of the session actions that can be run for a session, use the lssessactions command.
Read syntax diagramSkip visual syntax diagramcmdsess-help-h-?-quiet-action backupclone_snapshotconfirm_production_at_site_1confirm_production_at_site_2confirm_production_at_site_3create_snapshotcreate_safeguarded_snapshotdelete_snapshotdelete_thin_clonediscoverenable_copy_to_site_1enable_copy_to_site_2expire_backupflashfree_journal_spacehyperswaphyperswap_h1hyperswap_h2hyperswap_h3initiate_background_copyfailoverh1failoverh2failoverh3migrate_secondaryprepare_for_secondary_migrationrecoverrecoverh1recoverh2recoverh3recover_backuprecover_snapshotre-enable_copy_to_site_1re-enable_copy_to_site_2re-enable_copy_to_site_3
Read syntax diagramSkip visual syntax diagramcmdsess-action re-enable_original_directionrelease_i/orestoreset_production_to_site_1set_production_to_site_2set_production_to_site_3startstart_h1:h2:h3start_h1:h2_h1:h3start_h1:h2start_h1:h3start_h2:h1start_h2:h1_h2:h3start_h2:h1:h3start_h2:h3start_h3:h1:h2start_h3:h1start_h3:h2startgcstartgc_h1:h2_h1:h3startgc_h1:h2startgc_h1:h3startgc_h2:h1startgc_h2:h1_h2:h3startgc_h2:h3startgc_h3:h1startgc_h3:h2startgc_h3:h1:h2startgc_h3:h2:h1startgm_h1:h3
Read syntax diagramSkip visual syntax diagramcmdsess-action startgm_h2:h3startgm_h3:h1:h2startgm_h3:h2:h1stopstoph1h2stoph1h3stoph2h1stoph2h3stoph3h1stoph3h2suspendsuspend_when_drainedsuspendh1h2suspendh1h3suspendh2h1suspendh2h3suspendh3h1suspendh3h2terminateterminateh1h2terminateh1h3terminateh1i1terminateh1r1terminateh1r1_keep_r1terminateh2h3terminateh2i2terminateh3i3terminate_recoverythin_clone_snapshotvalidate_for_secondary_migration-restorefromsnapshot_group_name-recoverfrombackup_id-backupid backup_id-snapshotname snapshot_name-retentiondays retention_days-priority1234-newname snapshot_group_namesession_name -

Parameters

-help | -h | -?
Lists help for the command. If you specify additional parameters and arguments, those parameters and arguments are ignored.
-quiet
Suppresses the confirmation prompt for this command. This flag answers yes to all confirmation prompts.
-action action_type
Specifies the action type (command) depending on the state and type of session. The possible action types are displayed in the syntax diagram and are described in the IBM® Copy Services Manager User's Guide.
-backupid backup_id
Specifies the ID of the backup that you want to use to for the specified command.
This parameter is required if the -action parameter value is expire_backup,, or terminateh1r1, or terminateh1r1_keep_r1 and the session is a Safeguarded Copy session.
The parameter is optional if -action is recover_backup.
-snapshotname snapshot_name
Specifies the name for the snapshot that is to be used for the specified command.
This parameter might be required if the -action parameter value is clone_snapshot, delete_snapshot, thin_clone_snapshot or delete_thin_clone and the session is a Snapshot session.
This parameter can be used instead of the -backupid parameter for these actions.
-retentiondays retention_days
Specifies the number of days this new backup or safeguarded snapshot is to be kept on the hardware. The hardware expires the backup or snapshot automatically after the specified number of days are passed.
This parameter might be required if the -action parameter value is backup and the session is a Safeguarded Copy session or if the -action parameter value is create_safeguarded_snapshot and the session is a Spectrum Virtualize Snapshot session.
-restorefrom snapshot_group_name
Specifies the new name for the snapshot group that you want to use to restore the data in the H1 volumes for the session. The snapshot group must be in the session.
This parameter is optional and only used if the -action parameter value is restore and the session is for XIV storage systems.
-priority { 1 | 2 | 3 | 4 }
Specifies the priority in which the snapshot group is deleted from the session. The value is the number 1 - 4. A value of 1 specifies that the snapshot group is deleted last. A value of 4 specifies that the snapshot group is deleted first.
This parameter is optional and used only if the -action parameter value is create_snapshot and the session is for XIV® storage systems.
-newname snapshot_group_name
Specifies the new name for the snapshot group.
This parameter is optional and used only if the -action parameter value is create_snapshot and the session is for XIV storage systems.
session_name | -

Specifies the name of the session that the action will run against.

Alternatively, use the dash (-) to specify that input for this parameter comes from an input stream (stdin). The dash is supported only in single-shot mode.

Example: Starting a session

The following command runs the Start H1->H2->H3 action on session session1:

csmcli> cmdsess -action start_h1:h2:h3 session1

The following output is returned:

IWNR1813W  This command will initiate the copying of data from 
Site 1 to Site 2 and Site 3 for session session1, overwriting any data on Site 2
and Site 3 for any inactive copy sets. For ESS/DS devices, exactly one path will
be established between each LSS pair without existing paths. Do you want to
continue? [y/n]:y

IWNR1027I  The command Start H1->H2->H3 in session session1 has completed 
successfully.

Example: Reversing the direction of replication

The following command runs the Enable Copy to Site 1 action on the session1 session without prompting for confirmation:

csmcli> cmdsess -quiet -action enable_copy_to_site_1 session1

The following output is returned:

IWNR1027I  The command Enable Copy to Site 1 in session session1 has 
completed successfully.

For multi-target session types, the equivalent parameter is set_production_to_site_x, where x is the production site. For example, the parameter set_production_to_site_2 enables data replication from Site 2 to Site 1 and Site 3.

Example: Creating a snapshot group in a FlashSystem/IBM Spectrum® Accelerate snapshot session

The following command creates a snapshot group in session snap1:

csmcli> cmdsess -action create_snapshot snap1

The following output is returned:

IWNR1855W  This command will create a new snapshot group containing 
snapshots of the source volumes in session snap1. Do you want to continue? [y/n]:y
 
IWNR1026I  The Create Snapshot command in session snap1 has completed.