-
- Influencer
- Posts: 24
- Liked: 3 times
- Joined: Aug 06, 2015 4:34 pm
- Contact:
SQL Backup Script
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
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
-
- Product Manager
- Posts: 6551
- Liked: 765 times
- Joined: May 19, 2015 1:46 pm
- Contact:
Re: SQL Backup Script
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:
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:
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.
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
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)
}
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.
-
- Product Manager
- Posts: 6551
- Liked: 765 times
- Joined: May 19, 2015 1:46 pm
- Contact:
Re: SQL Backup Script
P.S. Also please specify what is "direct attached network card"? Is it SR-IOV or Direct path?
Thank you.
Thank you.
-
- Influencer
- Posts: 24
- Liked: 3 times
- Joined: Aug 06, 2015 4:34 pm
- Contact:
Re: SQL Backup Script
Hi.
The method is SR-IOV Passthrough
Regards Steri
The method is SR-IOV Passthrough
Regards Steri
-
- Product Manager
- Posts: 6551
- Liked: 765 times
- Joined: May 19, 2015 1:46 pm
- Contact:
Re: SQL Backup Script
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.
Thank you.
-
- Influencer
- Posts: 24
- Liked: 3 times
- Joined: Aug 06, 2015 4:34 pm
- Contact:
Re: SQL Backup Script
You can snapshot a powered off VM
Regards Steri
Regards Steri
-
- Lurker
- Posts: 2
- Liked: never
- Joined: Oct 02, 2018 12:15 pm
- Contact:
Re: SQL Backup Script
Do you have a sample script?
-
- Product Manager
- Posts: 20406
- Liked: 2299 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: SQL Backup Script
You should use PowerCLI for that:
Be aware that example has been written from the memory, so, the required syntax might be slightly different.
Thanks.
Code: Select all
$VM = Get-VM -Name "Name of your VM"
New-Snapshot -VM() -Name "Name of snapshot"
Thanks.
Who is online
Users browsing this forum: No registered users and 9 guests