Unsolved
This post is more than 5 years old
92 Posts
0
3553
September 10th, 2009 05:00
Using Navisphere CLI for SnapView
I am trying to find out if I can use Navi CLI to script out the creation of snaps. I want to create the snaps, add them to a storage group, create the snap session and activate the snaps. Once I am done I would want to do the reverse to remove them. I have no clue where to start so I thought I would try here. Thanks for any advice!
0 events found
No Events found!


RRR
4 Operator
•
5.7K Posts
0
September 10th, 2009 07:00
RRR
4 Operator
•
5.7K Posts
0
September 14th, 2009 02:00
chiodp
149 Posts
0
September 21st, 2009 10:00
This mean all the snap you will start need to be configure on the clariion .
A normal procedure for starting and corretly mount a snap with admsnap will be something like this :
1) On production host issue the admsnap start command
2) On backup host issue admsnap activate (this will mount the snap and assign a drive letter if you are in windows)
3) On backup host issue admsnap deactivate ( the mounted snap will disappear )
4) On production host issue the admsnap stop
Regards
Pierluca
ajbarth
14 Posts
0
September 21st, 2009 10:00
AranH1
2.2K Posts
0
September 21st, 2009 12:00
AranH1
2.2K Posts
0
September 21st, 2009 12:00
Ideally I woldlike to use mountvol in the scripts to mount the snapshot to the drive letter of my choice. All you have to do is manually create and mount the snapshot initially and then run mountvol on the mounthost to get the GUID of the snapshot in Windows. Then in your script you use that GUID and the mountvol commands to automatically mount the snapshot. I have had problems getting admsnap to not mount the snapshot to a drive letter, so I have a pause in the script to go to another command prompt to remove the mount points that admsnap assigns so I can use the pre-determined mount points for any backup / development scripts.
The entire process is run from the mount host. This does not require any part of the process to be run on the production host.
Below is an example of the script I use. It is two separate scripts, one to create the create the session and mount the snapshots, and one to stop the session and remove the snapshots. Using the variables you can customize this script to create many snapshots at once.
---- SNAPSHOT CREATION AND MOUNT -----
@echo off
REM Configure the variables for the script
REM One Session variable per storage processor
REM Create variable for each snapshot and drive letter for snapshot
REM Snapshot variables are SP specific
set SPA=10.1.1.1
set SPB=10.1.1.2
set Session_SPA=SNAPTest_SPA
Set StorageGroup=SG1
set Snapshot_A1=LUN120_SNAP02
set Snapshot_A2=LUN121_SNAP02
set Drive_LUN_A1=P:
set Drive_LUN_A2=Q:
cd C:\Scripts
@echo on
REM Process to start new snapshot session and activate snapshot
naviseccli -h %SPA% snapview -startsession %Session_SPA% -snapshotname %Snapshot_A1%,%Snapshot_A2% -consistent -persistence
naviseccli -h %SPA% storagegroup -addsnapshot -gname %StorageGroup% -snapshotname %Snapshot_A1%
admsnap rescan_devices
naviseccli -h %SPA% storagegroup -addsnapshot -gname %StorageGroup% -snapshotname %Snapshot_A2%
admsnap rescan_devices
diskpart /s c:\scripts\diskpart_rescan.txt
admsnap activate -s %Session_SPA%
admsnap rescan_devices
diskpart /s c:\scripts\diskpart_rescan.txt
echo Remove mountpoints assigned to volumes above then
pause
mountvol %Drive_LUN_A1% \\?\Volume{1e2f1f1e-a175-11de-8312-000bcd0de1c9}\
mountvol %Drive_LUN_A2% \\?\Volume{7802e07b-a49d-11de-99c5-000bcd0de1c9}\
exit
----- SNAPSHOT DELETION AND DISMOUNT -----
@echo off
REM Configure the variables for the script
REM One Session variable per storage processor
REM Create variable for each snapshot and drive letter for snapshot
REM Snapshot variables are SP specific
set SPA=10.1.1.1
set SPB=10.1.1.2
set Session_SPA=SNAPTest_SPA
Set StorageGroup=SG1
set Snapshot_A1=LUN120_SNAP02
set Snapshot_A2=LUN121_SNAP02
set Drive_LUN_A1=P:
set Drive_LUN_A2=Q:
cd C:\Scripts
@echo on
REM Process to deactivate snapshots and remove snapshot from host
admsnap flush -o %Drive_LUN_A1%
admsnap flush -o %Drive_LUN_A2%
mountvol %Drive_LUN_A1% /d
mountvol %Drive_LUN_A2% /d
diskpart /s C:\Scripts\diskpart_rescan.txt
admsnap rescan_devices
admsnap deactivate -s %Session_SPA%
admsnap rescan_devices
naviseccli -h %SPA% storagegroup -removesnapshot -gname %StorageGroup% -snapshotname %Snapshot_A1% -o
admsnap rescan_devices
naviseccli -h %SPA% storagegroup -removesnapshot -gname %StorageGroup% -snapshotname %Snapshot_A2% -o
diskpart /s c:\Scripts\diskpart_rescan.txt
naviseccli -h %SPA% snapview -stopsession %Session_SPA% -o
exit
dynamox
9 Legend
•
20.4K Posts
0
November 19th, 2013 07:00
it should have one line "rescan"