Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

15288

November 5th, 2015 13:00

How to "refresh" a snapshot using CLI?

I need to create a set of commands for our AIX Sysadmins that will allow them to run scripts against an XIO array to refresh a snapshot on demand.  They do not want me to re-map/mask the snapshot devices every time.  They are fine with stopping the DB and unmounting the filesystems.  They did just fine with TimeFinder on Vmax so I have no trust issues with giving them an account on the XIO.  And before anyone suggests it, we are having issues getting Appsync running so I'm steering away from that.  Since they're unix guys they want a command, not a GUI solution.

I am not a fan of RESTful API.  I have plenty of other things to do and becoming a JSON programmer is not one of them.  The documentation for RESTFUL is awful.  The doc for XIO commands is awful.  There are no cookbooks.  There are no models.  

I'm told I can "refresh" an existing snap but I can't find any XMS CLI (or RESTFUL API) commands to "refresh".  Is this a single command?  Is it an operand of a command?  Is it a series of commands?  I'm lost.  Any help would be appreciated.  Thanks.

1 Rookie

 • 

20.4K Posts

November 18th, 2015 10:00

Solutions Enabler is the gold standard, no arguing there. Itzikr's page does have an example, scroll all the way to the bottom of the linked page.

727 Posts

November 6th, 2015 19:00

If you are planning to build a script, the recommendation is to use RestAPI since we make sure that RestAPI is kept backward compatible going forward. There is no such guarantee for CLI.

In any case, you should be looking at ‘create snapshot and reassign’ command for the snapshot refresh operation. Snapshot refresh is a new feature that was added in XtremIO 4.0 release. You should reach out to your EMC account team to help understand how snapshot refresh works.

1 Rookie

 • 

20.4K Posts

November 6th, 2015 20:00

27 Posts

November 17th, 2015 07:00

Itzikr's Blog is useless.  No use cases.  No commands.  No examples.  Just marketing crap.  Why are there no decent models or examples showing how to do what should be a relatively simple process?  Show me an example in GUI.  Show me one in XMCLI.  Show me an example using a shell script that doesn't need to jump through flaming hoops.  None to be found.  This is not TimeFinder.

27 Posts

November 19th, 2015 06:00

Unfortunately the snapshot refresh is not working.  I've tried the GUI, and CLI with the "reassign" option, and both methods  fail to refresh the snap from the CG and tanks the command with repeatable errors when you decline to save the backup.  It also insists on creating a newly randomly named snap that it remaps to the target host.  I need to refresh the target volumes/snaps with a copy from the source CG on demand.  I can't put randomly numbered snapshot names in a script and update it every time I run it.   At this point support L2 and L3 have seen the issue and are working on it. 

27 Posts

November 19th, 2015 13:00

This has now been acknowledged by EMC as a bug and is supposed to be addressed in the upcoming 4.0.2 patch release.  In the meantime the solution (using XMCLI) is to use the create-snapshot-and-reassign command WITHOUT the "no-backup" option, then do a shell-game rename of the current snapshot-set to "old", the new snap to "current", then delete the old volumes.  It works for my purposes.  Reply to this thread if you want a copy of the script posted.

727 Posts

November 19th, 2015 19:00

Both of those are known issues and are scheduled to be fixed in the next service pack. More specifically, we are fixing the issue where the command fails when you decline to save the backup snapshot. You should not have this issue though if you are refreshing the snapshot from a consistency group.

We are also making the refresh process convenient by not relying on the randomly generated name of the snapshot.

2 Posts

November 24th, 2015 19:00

Marvin, could you post the script/commands that you are using to do the refresh?

Thanks

27 Posts

November 25th, 2015 06:00

The script is below.  The original script was written by Scott H. (EMC).  I jazzed it up a bit for my use.  The basic idea is a shell game of snap, rename, delete old stuff. Reply if questions...

#25Nov2015 MDK.

# The settings below will need to be modified

#

# XMS_USER - Username on the XMS. Needs ssh key-auth configured

# XMS_HOST - Hostname/IP of the XMS

# XIO_CLUSTER - Cluster name within XMS (use "show-clusters" command to determine it)

# CG      - Consistency Group to refresh FROM

# SNAPSET      - Snapshot Set to refresh TO.  Data in this SNAPSET will be  overwritten!

############################################

# Make sure they specified the required parms.

############################################

while getopts u:h:c:g:s: parms

do

  case $parms in

  u) XMS_USER=$OPTARG;;

  h) XMS_HOST=$OPTARG;;

  c) XIO_CLUSTER=$OPTARG;;

  g) CG=$OPTARG;;

  s) SNAPSET=$OPTARG;;

  esac

done

SHOW_USAGE () {

WHAT=$1

echo

echo "Error: $WHAT not specified."

echo

echo "Must specify format:"

echo

echo "$0 -u XMS_USER -h XMS_HOST -c XIO_Cluster -g ConsistencyGroup -s SnapShotSet"

echo

exit

}

FAIL () {

REASON=$*

echo

echo "$0 $REASON command failed with rc=$RC.  Cluster=$XIO_CLUSTER, CG=$CG, SnapSet=$SNAPSET"

echo

exit $RC

}

if [ -z "$XMS_USER" ]; then SHOW_USAGE XMS_USER; fi

if [ -z "$XMS_HOST" ]; then SHOW_USAGE XMS_HOST; fi

if [ -z "$XIO_CLUSTER" ]; then SHOW_USAGE XIO_CLUSTER; fi

if [ -z "$CG" ]; then SHOW_USAGE ConsistencyGroup; fi

if [ -z "$SNAPSET" ]; then SHOW_USAGE SNAPSET; fi

#echo XMS_USER is $XMS_USER

#echo XMS_HOST is $XMS_HOST

#echo XIO_CLUSTER is $XIO_CLUSTER

#echo CG is $CG

#echo SNAPSET is $SNAPSET

#######################################################

# Temporary Snapshot Set names used during refresh

#######################################################

SSNEW="${SNAPSET}"-new.`date '+%s'`

SSOLD="${SNAPSET}"-old.`date '+%s'`

#######################################################

# Refresh the snapshot set, WITHOUT the no-backup option

# NOTE: THIS IS NOT CREATING A NEW SNAPSHOT - IT IS REFRESHING IN PLACE!

#######################################################

ssh ${XMS_USER}@${XMS_HOST} create-snapshot-and-reassign cluster-id=\"${XIO_CLUSTER}\" from-consistency-group-id=\"${CG}\" to-snapshot-set-id=\"${SNAPSET}\"  snapshot-set-name=\"${SSNEW}\"

RC=$?

if [ ! $RC = 0 ]; then

  FAIL "create-snapshot-and-reassign"

fi

#######################################################

# Rename snapshot sets. Current becomes old, new becomes current

#######################################################

ssh ${XMS_USER}@${XMS_HOST} rename cluster-id=\"${XIO_CLUSTER}\" snapshot-set-id=\"${SNAPSET}\" new-name=\"${SSOLD}\"

RC=$?

if [ ! $RC = 0 ]; then FAIL "rename-1"; fi

ssh ${XMS_USER}@${XMS_HOST} rename cluster-id=\"${XIO_CLUSTER}\" snapshot-set-id=\"${SSNEW}\" new-name=\"${SNAPSET}\"

RC=$?

if [ ! $RC = 0 ]; then FAIL "rename-2"; fi

#################################################################################

# NOTE - At this point you can take the database out of backup mode.

#################################################################################

#######################################################

# Generate list of all volumes in the snapshot set

#######################################################

Vols=`ssh ${XMS_USER}@${XMS_HOST} show-snapshot-set cluster-id=\"${XIO_CLUSTER}\" ss-id=\"${SSOLD}\" | awk '/\tName: / { print $2 }'`

#######################################################

# Delete the old volumes one at a time

#######################################################

for volname in $Vols

do

  echo Deleting volume $volname

  ssh ${XMS_USER}@${XMS_HOST} remove-volume cluster-id=\"${XIO_CLUSTER}\" vol-id=\"${volname}\"

  RC=$?

  if [ ! $RC = 0 ]; then FAIL "delete of volume $volname"; fi

done

echo "Snapshot complete"

1 Rookie

 • 

20.4K Posts

November 26th, 2015 06:00

Marvin,

i am a symcli guy myself so i am trying to translate what you are doing in the script to solutions enabler terminology ..so that that i understand that volume refresh works in XtremIO. In Timefinder/Snap i would simply create/activate my STD/VDEV pairing to give me my snapshot, later one if it needed to be re-freshed i would recreate/active.  I am trying to understand why do we have to play this game with creating new snapshot , rename current to old and then rename new to current. I assume this does not change snapshot volume WWN and AIX does not need to be rescanned and all its hdisk/hdiskpower go nuts ?

5 Practitioner

 • 

274.2K Posts

December 10th, 2015 07:00

you assume correctly. Snapshot WWN and mapping stays the same so for the host it's just unmap, refresh snapshot , map. The only thing that changes it's the snapshot name on the xtremIO so we have to do this "game" of creating/rename in order to be able to rerun the script automatically everyday.

10 Posts

December 17th, 2015 09:00

Any ETA on when this patch will be out? I'm doing implementations now where customers want this functionality.

Thanks.

27 Posts

December 17th, 2015 12:00

According to my EMC SE, this patch should have been available yesterday (12/16/15).

727 Posts

December 18th, 2015 13:00

The patch was pushed out by a few days and we are waiting for a new GA date.

727 Posts

December 18th, 2015 13:00

Dynamox – think of a refresh operation as consisting of a source (or “from") volume and a target (or “to”) volume. Currently, the code behaves such that you cannot use the same command repeatedly to refresh the same target volumes from the same source volumes. This is being fixed in the next service pack for XtremIO.

No Events found!

Top