Unsolved
This post is more than 5 years old
75 Posts
0
1154
December 26th, 2010 23:00
Which are right scripts to start session/activate snaps on Linux systems?
Good Morning... and Merry Christmas (ok, I'm late)
I've got 2x RHEL servers (one production and one Datawhare house purpose) and I'd like to use Snapview snapshots from the first machine to the other one (both of them are virtual machines).
I've implemented an sh script in order to start multiple sessions and activate multiple snapshots onto the seconds system.
#! /bin/sh
/opt/Navisphere/bin/naviseccli -user snap -password snap -Scope 0 -Address CLARIION_SPA snapview -startsession session_1 -snapshotname snap_XXX1 -consistent
/usr/admsnap/admsnap activate -s session_1 -o /dev/sdg1
/bin/mount /dev/sdg1 /snap_1 -t ext3
#end script
I've serveral scripts like this one (that start session_2 .... snap_2 ; session_3 .... snap_3) but note that source lun is always the same but snaps are activated in different hours.
My problem is that every time that I reboot the secondary server, Linux re-enumarates the devices list and the admsnap activate commands starts snaps on different dev item.... (sometimes /dev/sdg1 or /dev/sdi... so on....) and seems that I cannot fix the snap on a particular /dev object... and It seems that even if I call session_1 and snap_1 (from the first line command), snapview use to activate the snap number 3 or 4 (looking into Unisphere)....
Where am I wrong?
Shall I do a script for starting a unique Snapview session and then activate multiple snapshots?
Thanks for anyone that can help me....
PS: I know, I should do admsnap flush and umount source lun in order to have consistency....


dynamox
11 Legend
•
20.4K Posts
•
87.4K Points
0
December 27th, 2010 21:00
try udev for device name consistency
http://en.wikipedia.org/wiki/Udev
riker82
75 Posts
0
December 30th, 2010 23:00
right way...
I've also did an "advanced" script:
#! /bin/sh
/opt/Navisphere/bin/naviseccli -user xxx -password xxxxx -Scope 0 -Address xxx.xxx.xxx.xxx snapview -startsession session_ALLDB -snapshotname snap_ALLDB -consistent
/usr/admsnap/admsnap activate -s session_ALLDB > /tmp/admsnap_ALLDB.log
device=`awk '{print $6 }' /tmp/admsnap_ALLDB.log | awk 'NF > 0' | cut -d '.' -f1`
#catch the sixth column of the messagge:
"Scanning for new devices.
Activated session session_ALLDB on device /dev/sdk."
#then remove the spaces (awk 'NF > 0') and remove the dot at the end of /dev/sdk. (in this case)
/bin/mount $device"1" /snap_ALLDB -t ext3 <-- the result of device variable is /dev/sdk (plus 1)
#fine script
SKT2
2 Intern
•
1.3K Posts
0
January 9th, 2011 18:00
what version of RHEL do you have?
driskollt1
131 Posts
0
January 10th, 2011 08:00
If you have device IDs changing you could add some script logic to check the volmap for each LUN before running your snap session command.
use navisecceli with "server -volmap -host "
you could also try user "server -remoteconfig -host -scan" or "server -update -host -rescandevices" to rescan for new devices.