SQL Backup Script

PowerShell script exchange

SQL Backup Script

Veeam Logoby steri » Tue Aug 11, 2015 9:54 am

Hi.

I have an SQL Cluster with direct attached Network Cards in the configuration.
The problem is i can not Backup this Cluster because i can not snapshot this machines with the direct attached network cards in Online state.

Now i need a script to test the server is SQL Cluster active. When it is active do a SQL Cluster change.
After this... Shutdown the server for backup.... Backup the Server.... After Backup is complete start the server again and make it SQL Cluster active again after SQL Sync is complete.

Then start with the second SQL Server

Have anyone practice experience with this solution ? Maybe an example Script ? Thanks a lot

Best Regards

Steri
steri
Influencer
 
Posts: 10
Liked: 2 times
Joined: Thu Aug 06, 2015 4:34 pm

Re: SQL Backup Script

Veeam Logoby PTide » Tue Aug 11, 2015 1:13 pm

Hi,

I'm not sure whether the offline mode lets you to take a snapshot...If yes, then the best way to do a backup would be to use a combination of pre- and post- job scripts.

Here is a logical schema:

1. Script before job (Backup Job -> Storage -> Advanced -> Advanced):

1.1 Call script insider1.bat inside VM

insider.bat:
Code: Select all
if [ Active ]
 {
 Switch Roles
 }
Shutdown


2. Backup VM

3. Script after job (Backup Job -> Storage -> Advanced -> Advanced):

3.1 Power On
3.2 Call script insider2.bat inside VM

insider2.bat:
Code: Select all
If [ SyncComplete ]
 {
 SetActive(ThisMachine)
 }
 Else
 {
 Wait
 SetActive(ThisMachine)
 }


Such a schema will proccess all VMs in a job in the same way.

If the offline state does not let you to do a snapshot, then you might want to add a few lines utilizing PowerCLI in order to detach your direct I/O NIC temporarily and add it back after backup procedure is finished.

Thank you.
PTide
Veeam Software
 
Posts: 3021
Liked: 246 times
Joined: Tue May 19, 2015 1:46 pm

Re: SQL Backup Script

Veeam Logoby PTide » Tue Aug 11, 2015 1:45 pm

P.S. Also please specify what is "direct attached network card"? Is it SR-IOV or Direct path?

Thank you.
PTide
Veeam Software
 
Posts: 3021
Liked: 246 times
Joined: Tue May 19, 2015 1:46 pm

Re: SQL Backup Script

Veeam Logoby steri » Tue Aug 11, 2015 2:07 pm

Hi.

The method is SR-IOV Passthrough

Regards Steri
steri
Influencer
 
Posts: 10
Liked: 2 times
Joined: Thu Aug 06, 2015 4:34 pm

Re: SQL Backup Script

Veeam Logoby PTide » Tue Aug 11, 2015 2:30 pm

It's definetily possible to take a snapshot of a powered-off VM with direct I/O device attached. I believe that the same applies to SR-IOV, but I can't tell that for sure - haven't tested that yet. If snapshots are "ok" with powered-off SR-IOV VM then the approach I've mentioned in my first post seems to be a way to go.

Thank you.
PTide
Veeam Software
 
Posts: 3021
Liked: 246 times
Joined: Tue May 19, 2015 1:46 pm

Re: SQL Backup Script

Veeam Logoby steri » Wed Aug 12, 2015 11:44 am

You can snapshot a powered off VM

Regards Steri
steri
Influencer
 
Posts: 10
Liked: 2 times
Joined: Thu Aug 06, 2015 4:34 pm


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 5 guests