This is the third installment in a 4 part series showing some of the REST API functionality with examples.  If you have not already taken the opportunity to read the getting started POST I would recommend having a read of this before going any further, if you are already familiar and want to just dive in to SRDF functionality available with REST then read on.


Symmetrix Remote Data Facility (SRDF) is the gold standard for remote replication in the enterprise storage market.  SRDF provides external protection of data at a remote site over synchronous and asynchronous distances and also in an Active/Active model.  SRDF has been around a long time continuously improving and protecting the worlds most mission critical systems providing disaster recover and disaster avoidance solutions. There is a lot of reading material out there if you are not familiar.  The SRDF Family CLI User Guide goes through all this in detail so I won't attempt to cover off here.  The link to the latest guide is below.

https://support.emc.com/docu78908_Solutions_Enabler_SRDF_Family_8.3.0_CLI_User_Guide.pdf?language=en_US&language=en_US

 

Unisphere for VMAX provides a great deal of automation in the setup of SRDF configurations and this automation provides a lot of simplicity and reduces the configuration overhead when setting up SRDF environment.  To protect a storage group with SRDF, the storage admin simply needs to right click and select protect, and a wizard is launched, the wizard will prompt to protect with local, remote (SRDF) or protectpoint.  When the admin selects SRDF, they just need to select the mode and remote array and the automation will do the rest.

 

Under the covers a lot more is going on:-

  • If the SRDF protection mode is Async or Metro, Unisphere looks for an empty RDF group between the source and target VMAX arrays, if none exists it will create one.
  • If the mode is Synchronous or Adaptive Copy it will choose the least loaded SRDF group for the New Replication groups.
  • No need to pre-create any storage on the target array, SRDF wizard will create the pairs of the correct size and emulation.
  • Optionally start the establish (synchronization) process once pairs are created.

 

REST leverages all this built in automation as it makes the calls to Unisphere which does all the heavy lifting and simplifies the process into just a single step..

 

Unisphere's management interface is built around the protection dashboard,  this is where we will do most of the active management of SRDF from and check on the state of our replication environment.  The protection dashboard is built around the concept of the storage group as the application, as with TimeFinder SnapVX we can already leverage the storage groups for protecting our applications locally we can also do this for remote replication.

 

If it's all so simple why would I use REST to configure SRDF?

 

If you are building automation into your environment for your DevOps team you probably want to cut out the manual portion and repetitive action of clicking into the Unisphere GUI so the REST API is ideal for just such an occasion. The Unipshere for VMAX REST API can be leveraged by any orchestration tool that supports REST so once you have a recipe for what you need to do and have identified your REST calls your API can take full advantage and automate the boring stuff without having to reinvent anything.

 

/83/replication/symmetrix/{symmetrixId}/storagegroup/{storageGroupId}/rdf_group

 

When protecting a storage group we make a POST call to the endpoint and pass a JSON payload with the required parameters.  In this case the Remote Symmetrix ID, (local is part of the REST URI) the replication mode, Sync, Async, Metro or Adaptive Copy Disk.

 

A Sample JSON Payload for protecting with SRDF is shown below

 

{

   "replicationMode": srdfmode,

   "remoteSymmId": remote_sid,

   "remoteStorageGroupName": sg_id,

   "establish": "False"
   }

 

As you can see the payload is minimal and a single call can be used to protect the storage group.  one thing to be aware that the context of the REST call will always be on the source storage group on the source array.  The payload tells the command where to replicate data to and will create the structures to achieve this.

 

Best Practices with REST and SRDF;-

-Create your Pairing with mode using desired replication mode, using REST call above, this ensures if you are using metro or async all the devices are placed a unique RDF group for that application.

-Large data transfers and initial sync should be completed in Adaptive copy mode, and switch to primary mode SRDF/Sync or Async when close to synchronized.    If you are protecting storage groups at the time of creation there will be no reason to delay the synchronization or switch mode of operation.

 

To actually start the synchronization, or modify the groups state of the data you can leverage REST PUT call.


/83/replication/symmetrix/{symmetrixId}/storagegroup/{storageGroupId}/rdf_group/{rdfgNumId}

Sample Payload

{

  "action": "Establish"

}


In order to do a PUT you will need to know the rdf group number so you may need to GET on your storage group to find this information


/83/replication/symmetrix/{symmetrixId}/storagegroup/{storageGroupId}/rdf_group

sample of the returned payload is


{

  "storageGroupName": "SRDF_TEST_SG",

  "symmetrixId": "000197XXXXXX",

  "rdfgs": [1]

}


In this case you would parse the list item rdfgs.


Note the default establish payload will be incremental, Please explore the REST Client or REST API docs for full list of parameters that can be added to the PUT payloads for various SRDF actions.


The Payload for this Call is generally only going to contain the action,  the usual actions would be Establish, Split, Suspend, Restore, Resume, Failover, Failback, or Swap

 

With the 8.3 release and lower you will need to switch to Unisphere GUi to switch RDF modes, however in Unisphere 8.4 the endpoint 84/replication/symmetrix/{symmetrixId}/storagegroup/{storageGroupId}/rdf_group/{rdf_num} will be enhanced to support changing SRDF modes.  The later release is due in Q2 of 2017.

 

To use this call in script is a simple one line, we have already added to the Py4UV Git hub with the full example script shown below.

 

rdf_protect.png

 

Note while there is only one line in the body of the script here, the actual REST call is in rest_univmax.py which looks after all the payload exchange and processing the supplied parameters.  Explore, and if you feel like contributing please clone the GiT and create a pull request.

 

As always source code and example scripts can be found on Github here.  A sample script for creating and establishing an SRDF storage group is posted on Github at the following location.  The file is remotereplication_example.py.  As always these are scripts are tested in our labs but please ensure you understand exactly what is being done before running in your own environment.  

 

A second script has been added to GitHub that will allow you to change state of existing SRDF session.

 

Please check out the GitHub, and also check out the previous blog posts in this series if you have not done already.

 

GitHub - ciarams87/PyU4V: A library showing some of the functionality possible using the ReST API of UniSphere for VMAX

Getting Started with VMAX REST API

Unipshere for VMAX REST API Examples - Episode 1. Provisioning.

Unisphere for VMAX REST API Examples - Episode 2: The VMAX Snaps back

 

Next up : Unisphere for VMAX REST API Examples - Episode 4 Finding the Rogue One in your Environment, Gathering Performance Data via REST.