HPE Storage Users Group

A Storage Administrator Community




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Scripting
PostPosted: Fri Apr 12, 2019 11:22 am 

Joined: Thu Mar 14, 2019 9:29 am
Posts: 17
I need help scripting these commands to run nightly.

Create Virtual Copy
createsv -i 1049 OS11_Snap_1049 OS11_49
createsv -i 1640 OS11_Snap_1640 OS11_1640
createsv -i 1641 OS11_Snap_1641 OS11_1641
createsv -i 1642 OS11_Snap_1642 OS11_1642
createsv -i 1643 OS11_Snap_1643 OS11_1643
createsv -i 1059 OS11_Snap_1059 test_159

Export Virtual Copy
createsv OS11_Snap_1049 1049 OS11
createsv OS11_Snap_1640 1640 OS11
createsv OS11_Snap_1641 1641 OS11
createsv OS11_Snap_1642 1642 OS11
createsv OS11_Snap_1643 1643 OS11
createsv OS11_Snap_1059 1059 OS11
createsv OS11_Snap_3014 3014 OS11

Unexport Virtual Copy
removevlun OS11_Snap_1049 1049 OS11
removevlun OS11_Snap_1640 1640 OS11
removevlun OS11_Snap_1641 1641 OS11
removevlun OS11_Snap_1642 1642 OS11
removevlun OS11_Snap_1643 1643 OS11
removevlun OS11_Snap_1059 1059 OS11
removevlun OS11_Snap_3014 3014 OS11

Delete Snap with OS11 in name
removevv -f -snaponly -pat OS11*


Top
 Profile  
Reply with quote  
 Post subject: Re: Scripting
PostPosted: Mon Apr 15, 2019 1:33 am 

Joined: Tue Mar 29, 2016 9:32 pm
Posts: 136
Have anymore info to share ? What operating system are the snaps exported too ? What are the snaps used for ? Are their volume managers involved ? What operating systems do you have to hand for scripting ?

Answer that and I bet a far more elegant method could be done (ie. why delete the snapshots everynight when you can just "updatevv" them instead)


Top
 Profile  
Reply with quote  
 Post subject: Re: Scripting
PostPosted: Mon Apr 15, 2019 8:18 am 

Joined: Thu Mar 14, 2019 9:29 am
Posts: 17
This will be for nightly backups on VMS disks. I tried updatevv and get an error. but if that works then will be easy.

what happens if the snap grows larger than the base lun?


Top
 Profile  
Reply with quote  
 Post subject: Re: Scripting
PostPosted: Mon Apr 15, 2019 2:04 pm 

Joined: Mon Sep 21, 2015 2:11 pm
Posts: 1570
Location: Europe
squant wrote:
what happens if the snap grows larger than the base lun?


As a snapshot only track changes vs the base (or previous snap), one snap can never grow beyond the size of base.

As for snap space for all snaps there is no issue as long as the CPG is allowed to grow.

_________________
The views and opinions expressed are my own and do not necessarily reflect those of my current or previous employers.


Top
 Profile  
Reply with quote  
 Post subject: Re: Scripting
PostPosted: Mon Apr 15, 2019 9:02 pm 

Joined: Tue Mar 29, 2016 9:32 pm
Posts: 136
VMS .. bleuughh ... like to make life fun for yourself :-)

My VMS voodoo is weak (it died long ago in college days), but I would think the general process you want would be :

The following is based on the detail that the snapshots are not being exported to the same VMS host as the source volumes ? (things get fun doing that as the OS could just say "Hey these are my same volumes!" and do weird things) ... your VMS admin might be able to work with that scenario but lets present you have a production VMS server and a backup VMS server.

1) Create a snap of each virtual volume
2) Create a volume set (called say "backup_vms" for this example)
3) Add the snapshot volumes you created to the volume set "backup_vms"
4) Perform an update of all the snapshots at once by running updatevv against the volume set :

"updatevv -removeandrecreate set:backup_vms"
- make sure your 3PAR user has the "updatevv" ACL set (see "showacl" and "setacl")

That'll give you a consistent set of snaps, they'll all have been done at the same time (important for volume managers).
The "-removeandrecreate" option basically lets you keep the same WNNs for each snapshot when you update them (OSs and volume managers like that and essential for in a few steps time ...)

5) Export the snapshot volumes to the VMS host
- Export the snaps individually, DO NOT export the volume set ... exporting volume sets to hosts is the work of the devil and you will regret it even though is sounds oh so useful! :-)
6) Have your VMS admin import the volumes, mount up whatever volume managers and filesystems are there and prove it is good.

So 1 to 6 will get your snaps visible to your backup VMS server. When you want to refresh those snapshots you'd do something like the following :

1) VMS admin unmounts the filesystems/logical volumes that were mounted from the snapshot volumes.
2) On the source VMS server quiese, flush the filesystem caches so everything gets written to the source 3PAR volumes so you can get as clean a snap as possible (or if a database go into hotbackup mode or equivilant)
3) Run the updatevv command "updatevv -removeandrecreate set:backup_vms" to get a refreshed copy of the snapshots
4) VMS admin mounts the filesystems/logical volumes from the snapshots

Easy! Apart from the VMS admin stuff, you are on your own for that! :-)

If you have VMS, you should have old VMS admins, they'll understand this concept as similar to BCVs and such.


Top
 Profile  
Reply with quote  
 Post subject: Re: Scripting
PostPosted: Tue Apr 16, 2019 9:53 am 

Joined: Thu Mar 14, 2019 9:29 am
Posts: 17
before performing the updatevv does the db need to be down? can this be done live?


Top
 Profile  
Reply with quote  
 Post subject: Re: Scripting
PostPosted: Tue Apr 16, 2019 3:43 pm 

Joined: Thu Mar 14, 2019 9:29 am
Posts: 17
the udid changes each time the update takes place. does the snap need to be mounted? once i did the update the disk was not accessable anymore on the vms system. thinking it had to do with the id changing.

Also the base volume is r/w so first i created the snap ro but vms couldn't mount the disk. i then created a snap r/w and the system was able to mount.

updatevv -f -removeandrecreate set:backup_vms


Top
 Profile  
Reply with quote  
 Post subject: Re: Scripting
PostPosted: Tue Apr 16, 2019 4:25 pm 

Joined: Tue Mar 29, 2016 9:32 pm
Posts: 136
squant wrote:
before performing the updatevv does the db need to be down? can this be done live?


In a perfect world the source database should be offline and the filesystems unounted, that'll get you as clean a snapshot as possible.

In the real world you probably can't do that, so having the database in hot backup mode is the next best thing, or if you can't do that even then you'll be doing dirty snaps which may or may not mount cleanly on the backup server and the data may or may not be consistent.


Top
 Profile  
Reply with quote  
 Post subject: Re: Scripting
PostPosted: Tue Apr 16, 2019 5:04 pm 

Joined: Tue Mar 29, 2016 9:32 pm
Posts: 136
squant wrote:
the udid changes each time the update takes place. does the snap need to be mounted? once i did the update the disk was not accessable anymore on the vms system. thinking it had to do with the id changing.

Also the base volume is r/w so first i created the snap ro but vms couldn't mount the disk. i then created a snap r/w and the system was able to mount.

updatevv -f -removeandrecreate set:backup_vms


Ahhh .. VMS, it cares about the UDID (stupid dinosaur! :D )

When creating the snaps you can pick it's starting UDID, but when a snapshot is updated to auto picks a new one (we can keep the WWN of the volume the same with the -removeandrecreate option which is good for other OSs but not VMS it would seem).

And to change the UDID requires the snapshot volume to be unexported from a host ... bummer

you could tweak the process ...

Create the snapshots and decide the UDID up front with : createvv -i <ID you would like and is free and less than 32767>

you'll also have to add a step to unexport the snaps from the backup server before you refresh the snapshots.

Next you will need to add steps to change the UDIDs of each snap back to what they were when you first created them " setvv -udid <ID you picked before> ...."

And finally export the volumes back to the host ... probably with the same LUN ID as from before as well.

That's about all I can think of, VMS is not my thing :-)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 


Who is online

Users browsing this forum: No registered users and 34 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group | DVGFX2 by: Matt