Storage Boards Cleanup
To make it easier to find information about HPE Storage products and solutions, we are doing spring cleaning. This includes consolidation of some older boards, and a simpler structure that more accurately reflects how people use HPE Storage.
3PAR StoreServ Storage
cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble with 3Par script

SOLVED
Go to solution
LARRY FUTCH
Occasional Contributor

Trouble with 3Par script

I'm trying to write a 3Par CLI script to create snapshots of a SQL database and then mount them on another server for use as a reporting server for data mining.  I have all the necessary commands in a batch file.  The problem I'm having is that after the first command, which works correctly, I can't see that any of the other commands are operating at all.

 

Is there a way to run the entire series of commands as a single script?  Also, is there a way to make each command wait to execute until the one before it has completed?

 

Thanks in advance,

Larry

6 REPLIES
Dennis Handly
Acclaimed Contributor

Re: Trouble with 3Par script

Do you have an example of your script?

What OS and shell are you running?

 

>is there a way to make each command wait to execute until the one before it has completed?

 

Unless you create a task, it normally waits.

There is a waittask command.

LARRY FUTCH
Occasional Contributor

Re: Trouble with 3Par script

I attached a copy of the .BAT file below.  I'm trying to run this on Windows 2008 R2. The object of this is to make snapshots of a production SQL server and mount them on another server for report generation.

 

The problem is that after the first 3Par command, nothing else in the entire .BAT file shows up on screen or gives me any indication that it ran at all.

 

 

 

REM Pause the SQL service on the production server
SC \\BPCRMSQALL01 pause "SQL Server (MSSQLSERVER)"
 
 
REM Delay while SQL finishes stopping
timeout 5
 
REM Unmount the SQL Data and SQL Logs drives from the Backup server
removevlun -sys bpc3par1 -pwf pw1 -f rwSS_of_BPCRMSQALL01_SQL_Data 10 BPCPAPPINF01
REM removevlun -sys bpc3par1 -pwf pw1 -f rwSS_of_BPCRMSQALL01_SQL_Logs 11 BPCPAPPINF01
removevv -sys bpc3par1 -pwf pw1 -f -snaponly -cascade roSS_of_BPCRMSQALL01_SQL_Data
REM removevv -sys bpc3par1 -pwf pw1 -f -snaponly -cascade roSS_of_BPCRMSQALL01_SQL_Logs
 
 
REM Make new snapshots of the production server volumes
REM call snapdata1
createsv -sys bpc3par1 -pwf pw1 -f -exp 48h -ro roSS_of_BPCRMSQALL01_SQL_Data vv_BPCRMSQALL01_SQL_Data
timeout 5
REM call snaplogs1
REM createsv -sys bpc3par1 -pwf pw1 -f -exp 48h -ro roSS_of_BPCRMSQALL01_SQL_Logs vv_BPCRMSQALL01_SQL_Logs
timeout 5
REM call snapdata2
createsv -sys bpc3par1 -pwf pw1 -f -exp 48h rwSS_of_BPCRMSQALL01_SQL_Data roSS_of_BPCRMSQALL01_SQL_Data
timeout 5
REM call snaplogs2
createsv -sys bpc3par1 -pwf pw1 -f -exp 48h rwSS_of_BPCRMSQALL01_SQL_Logs roSS_of_BPCRMSQALL01_SQL_Logs
timeout 10
 
REM Map the snapshots to the Backup server
createvlun rwSS_of_BPCRMSQALL01_SQL_Data 10 BPCPAPPINF01
REM createvlun rwSS_of_BPCRMSQALL01_SQL_Data 11 BPCPAPPINF01
 
REM Delay to let the O.S. recognize the drives.
timeout 180
 
 
REM Continue the SQL Service on the Report server
REM net start MSSQLSERVER
REM net start SQLSERVERAGENT
REM net continue MSSQLSERVER
SC \\BPCRMSQALL01 continue "SQL Server (MSSQLSERVER)"

Sheldon Smith
Honored Contributor
Solution

Re: Trouble with 3Par script

That's because after the first CLI command, they didn't run. Windows (command line interface) is dumber than a box of rocks.

The 3PAR CLI installation puts the CLI itself and all the commands in the CLI's bin folder. To keep the size of the CLI installation down, each command is a .CMD stub that passes the command verb and all its arguments to CLI.exe.

You either need to "call" each command or preface each command with "CLI". For example:

REM Unmount the SQL Data and SQL Logs drives from the Backup server
cli removevlun -sys bpc3par1 -pwf pw1 -f rwSS_of_BPCRMSQALL01_SQL_Data 10 BPCPAPPINF01
REM removevlun -sys bpc3par1 -pwf pw1 -f rwSS_of_BPCRMSQALL01_SQL_Logs 11 BPCPAPPINF01
cli removevv -sys bpc3par1 -pwf pw1 -f -snaponly -cascade roSS_of_BPCRMSQALL01_SQL_Data
REM removevv -sys bpc3par1 -pwf pw1 -f -snaponly -cascade roSS_of_BPCRMSQALL01_SQL_Logs


Note: While I work for Hewlett Packard Enterprise, all of my comments (whether noted or not), are my own and are not any official representation of the company.
----------
If my post was useful, click on my KUDOS! thumb below!
LARRY FUTCH
Occasional Contributor

Re: Trouble with 3Par script

Many thanks.  I added CLI to the front of each command and it works perfectly now.

phillbl1
Frequent Advisor

Re: Trouble with 3Par script

hi,

great post, we are looking at the same solution.  from reading though i am not sure if you are using the recovery manager software for 3par?  then again to have the commands available to do the script you may have?

 

i was just wondering as we are going to use the 3par recovery manager to do PIT snap shots of the sql database and then we would like to mount them on a seperate server running SQL to allow devs to test.  So i from reading this post it looks like we could schedule the sql snap shots using the software and then use the midle part of the script to mount the snap shot on a seperate server.

 

One thing i was wondering though was how you go about deleting the snap shot from the remote sql server, does the 3par have the cli commands to do this in a clean way?

 

thanks

 

Sheldon Smith
Honored Contributor

Re: Trouble with 3Par script

The "cli" commands above are the basic HP 3PAR OS commands. In addition, with HP 3PAR Recovery Manager for Microsoft SQL Server, there is an additional set of commands starting "HpRmCli Sql". Sounds like you want the "HpRmCli Sql unmount" and probably the "HpRmCli Sql remove" commands. See the HP 3PAR Recovery Manager for Microsoft SQL Server User Guide.

 


Note: While I work for HP, all of my comments (whether noted or not), are my own and are not any official representation of the company.
----------
If my post was useful, click on my KUDOS! "White Star" !


Note: While I work for Hewlett Packard Enterprise, all of my comments (whether noted or not), are my own and are not any official representation of the company.
----------
If my post was useful, click on my KUDOS! thumb below!