HPE Storage Users Group
https://3parug.net/

Is there a way to script snapshots for volumes?
https://3parug.net/viewtopic.php?f=17&t=73
Page 1 of 2

Author:  rksm2002in [ Wed Aug 10, 2011 4:49 pm ]
Post subject:  Is there a way to script snapshots for volumes?

I have many redhat server which are connected to my 3par storage array. Every time I have to take snap shots of vluns which are exported to all the host, I have to do it manually. Is there a way that I can create a script that can ssh in to the 3par and take snap shots for all the volumes or some selected volumes?
Right now I have a script that logs on to the 3par, but its takes snapshot of only one volume not all is there any way that I can do it for all the volumes?

Author:  3ParEE [ Wed Aug 10, 2011 6:47 pm ]
Post subject:  Re: Is there a way to script snapshots for volumes?

If you would like to create a group snapshot why don't you use a group snapshot? I don't know what InForm OS version you have, but I'm going to assume you have 2.3.1 (If you don't please go to InForm OS 2.3.1 MU4):


Syntax (2.3.1)
cli% creategroupsv -h
creategroupsv - Create consistent group snapshots of a list of virtual volumes.

SYNTAX
creategroupsv [option] <copy_of_VV>[:<snapshot_VV>[:<ID>]]...

DESCRIPTION
The creategroupsv command creates consistent group snapshots of a list of
virtual volumes. Consistent group snapshots are all created at the same
point in time so that related structures on different volumes in the group
remain consistent.

AUTHORITY
Super, Edit

OPTIONS
-ro
Specifies that read-only snapshots are created. The default is
read-write snapshots. To create read-only snapshots, all specified
virtual volumes must be read-write. For read-write snapshots, all
specified virtual volumes must be read-only.

-exp <time>{d|D|h|H}
Specifies the relative time from the current time that volume will
expire. <time> is a positive integer value and in the range of 1 -
43,800 hours (1825 days). Time can be specified in days or hours
providing either the 'd' or 'D' for day and 'h' or 'H' for hours
following the entered time value.

-comment <comment>
Specifies any additional information up to 511 characters for the
volume.

-f
Do not ask for confirmation before creating group snapshots with
retention time (-retain).

-retain <time>{d|D|h|H}
Specifies the amount of time, relative to the current time, that the
volume will be retained. <time> is a positive integer value and in the
range of 1 - 43,800 hours (1825 days). Time can be specified in days
or hours providing either the 'd' or 'D' for day and 'h' or 'H' for
hours following the entered time value.

Note: If the volume is not in any domain, then its retention time
cannot exceed the value of the system's VVRetentionTimeMax. The default
value for the system's VVRetentionTimeMax is 14 days. If the volume
belongs to a domain, then its retention time cannot exceed the value of
the domain's VVRetentionTimeMax, if set. The retention time cannot be
removed or reduced once it is set. If the volume has its retention time
set, it cannot be removed within its retention time. If both expiration
time and retention time are specified, then the retention time cannot
be longer than the expiration time.

This option requires the 3PAR Virtual Lock license. Contact your local
service provider for more information.

SPECIFIERS
<copy_of_VV>
Specifies the name of the virtual volume being copied (the parent
volume).

<snapshot_VV>
Optional name of the snapshot virtual volumes. If <snapshot_VV> is not
specified, the system tries to automatically generate the snapshot name
of the form <copy_of_VV>.<type><number> where <type> is either ro or rw
and <number> is either empty or the lowest number starting from 0 that
does not conflict with an existing volume name. If the generated name is
too long (because the <copy_of_VV> name is too long) the command will
fail, and the user is required to specify <snapshot_VV> explicitly.

<ID>
Optional ID of the <snapshot_VV>. If the <ID> is not specified, an ID is
chosen automatically.

NOTES
Use of this command requires a Virtual Copy license. Contact your
local 3PAR representative for information.

Consistent group snapshots are all created at the same point in time so that
related structures on different volumes in the group remain consistent.

A maximum of 256 writable virtual copies per volume are allowed.

A maximum of 2048 virtual copies per volume are allowed.

EXAMPLES
In the following example, virtual volumes VV1 and VV2, and their underlying
logical disks are created using the createaldvv command. A read-only
snapshot of the volumes is then taken and a list of the volumes is generated
using the creategroupsv command:

cli% createaldvv -pct 10 VV1 4g
cli% createaldvv -pct 10 VV2 4g
cli% creategroupsv -ro VV1 VV2


That should help you so you don't have to issue so many commands. Now the scripting part I'll leave to someone else. Hope this helps.

Author:  Richard Siemers [ Wed Aug 17, 2011 11:07 am ]
Post subject:  Re: Is there a way to script snapshots for volumes?

Sounds to me like "creategroupsv" was what you were looking for?

Author:  rksm2002in [ Wed Aug 17, 2011 1:17 pm ]
Post subject:  Re: Is there a way to script snapshots for volumes?

hey 3ParEE,

thanks that was exactly i was looking for. Well I created a script and installed a public key and wrote a bunch of updatevv commands for all the volumes, but using the group one, i dont have to ssh in to 3par again and again and run show many updatevv for each volumes. thanks!!!

Thank You
rksm2002in

Author:  chunklet [ Thu Aug 22, 2013 1:50 pm ]
Post subject:  Re: Is there a way to script snapshots for volumes?

I find this useful

Create vvsets as appropriate for simultaneous snaps of vv's that share some commonality, for instance the same server, cluster or application.

createsv -ro -exp 30d @vvname@.@d@ vvsetname

this will create snaps that automatically expire in 30 days and have the same name as the parent vv, appended with the two digit day of the month it was created.

Author:  Christian [ Fri Sep 06, 2013 6:51 am ]
Post subject:  Re: Is there a way to script snapshots for volumes?

You could also look at : createsched - Allows users to schedule tasks.

That way you don't need to create a SSH script.

Author:  Richard Siemers [ Mon Sep 09, 2013 5:07 pm ]
Post subject:  Re: Is there a way to script snapshots for volumes?

Christian wrote:
You could also look at : createsched - Allows users to schedule tasks.

That way you don't need to create a SSH script.


P.S. if you use AD authentication on your 3par, use a LOCAL account for createsched. tasks scheduled with your AD account will fail to authenticate.

Author:  hdtvguy [ Thu Oct 10, 2013 1:22 pm ]
Post subject:  Re: Is there a way to script snapshots for volumes?

I am attaching a batch file that will help you. It accepts 3 parameters, the array name, a volume name (accepts wildcards) and then an expiration time. We run this every day against various volume wildcard strings to take daily snapshots of volumes on our array. Really simplifies massive snapshot creation. By accepting expiration duration it allows you to not have to worry about clean up. I am converting this to powershell in the near future. We run this on a windows box using Windows Scheduled task and have the 3par CLI installed. You will need to look at the script to find the name of e password file you use and change it. The default the %arrayname%_admin.pwfile and %ARRAYNAME% is loaded from the first variable passed.



I have some Remote Copy scripts as well and one that syncs snapshots on a target array of remote copies once all volumes in an RC group are done replicating it will refresh teh snaps off that RC group in the target.

Attachments:
snapvvs-oem.txt [6.68 KiB]
Downloaded 5594 times

Author:  marconipoveda [ Fri Mar 14, 2014 6:09 pm ]
Post subject:  Re: Is there a way to script snapshots for volumes?

Hi guys,

I had a vvset01 with 100 virtual volumes and made a virtual copy of the whole vset.

Code:
createsv -f @vvname@-avcrw set:vvset01


How could I update all the copy volumes all at once?

What I tried is this:

Put all my copies into a new vvset vvset01.vcrw and then try to update vvset against vvset

Code:
setuseracl 3paradm updatevv set:vvset01.vcrw
updatevv -f set:vvset01.vcrw


I'm getting "Permision Denied Error". Any ideas?

Best Regards.

Author:  hdtvguy [ Wed Mar 19, 2014 11:11 am ]
Post subject:  Re: Is there a way to script snapshots for volumes?

Not sure, but is there a limit on the number of volumes you can have in a vvset that get refreshed at one time?

Page 1 of 2 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/