switchrcrelationship

Use the switchrcrelationship command to reverse the roles of primary and secondary volumes in a stand-alone Metro Mirror or Global Mirror relationship when that relationship is in a consistent state.

Syntax

 switchrcrelationship     -primary  {  master  |  aux  } {  rc_rel_id  |  rc_rel_name  }

Parameters

-primarymaster | aux
(Required) Specifies whether the master disk or the auxiliary disk is to be the primary.
rc_rel_id | rc_rel_name
(Required) Specifies the ID or the name of the relationship to switch.

Description

The switchrcrelationship command applies to a stand-alone relationship. It is rejected if it is used to try to switch a relationship that is part of a consistency group. It is normally issued to reverse the roles of the primary and secondary volume in a relationship perhaps as part of a failover process during a disaster recovery event.

Note: You cannot switch a relationship if the primary and secondary volumes are different sizes.

Write access to the old primary disk is lost and write access to the new primary disk is acquired.

This command is successful when the relationship is in a connected, consistent state, and when reversing the direction of the relationship does not lead to a loss of consistency; that is, when the relationship is consistent and synchronized. The relationship must be in one of the following states in order for the switchrcrelationship command to process correctly:
  • ConsistentSynchronized
  • ConsistentStopped and Synchronized
  • Idling and Synchronized
    Note: A command in idling state is rejected if any of the indicated secondary volumes is the target of an existing FlashCopy map.
The relationship moves to the ConsistentSynchronized state after the successful completion of this command. If you specify the -primary parameter with the current primary, the command has no effect.

When the direction of the relationship is changed, a volume that is a secondary volume in a remote copy relationship becomes a primary volume, and a primary volume in a remote copy relationship becomes a secondary volume. If the resultant secondary volume is mapped to a host (type hide_secondary), it is no longer presented to that host. However, the mapping still exists for configuration purposes. If the volume that was a secondary volume before the switch is mapped to a host of type hide_secondary, it is presented to that host because it is no longer a secondary volume.

The switchrcrelationship command is rejected if you use Global Mirroring with the multi cycling mode.

You cannot switch directions for an active-active relationship.

An invocation example

switchrcrelationship -primary master rccopy2

The resulting output:

No feedback