powershell instant recover SAN snapshot ?

PowerShell script exchange

powershell instant recover SAN snapshot ?

Veeam Logoby larry » Fri Mar 10, 2017 4:16 pm

I there a powershell command to do an instant recovery for a remote netapp snapsot.
No jobs are run from veeam servers at that site.

If I go to backups, storage snapshots I can just right click the job that has a name like SVM_NFS_Norwich_Win7_Norwich_mirror pick VM and I can do the recovery. I want to do the same with powershell.

the Get-VBRBackup -Name "SVM_NFS_Norwich_Win7_Norwich_mirror" returns nothing.
larry
Expert
 
Posts: 383
Liked: 90 times
Joined: Wed Mar 24, 2010 5:47 pm
Full Name: Larry Walker

Re: powershell instant recover SAN snapshot ?

Veeam Logoby v.Eremin » Fri Mar 10, 2017 5:58 pm

I doubt that this functionality has been implemented in PowerShell, but you can try to query all restore points via Get-VBRRestorePoint to see whether needed one is there. If so, you can, then, execute Start-VBRInstantVMRecovery against it. Thanks.
v.Eremin
Veeam Software
 
Posts: 13701
Liked: 1020 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: powershell instant recover SAN snapshot ?

Veeam Logoby larry » Fri Mar 10, 2017 9:56 pm

got it thanks

Code: Select all
$res  = Find-VBRViEntity -ResourcePools -Server "VC" -Name "Resources"

$rp = Get-VBRRestorePoint -Name *vmtoload*  | Sort CreationTime | where-Object  {$_.InsideDir.length -lt 2} | Select -Last 1

$server = Get-VBRServer | where {$_.Name -eq "esxhost"}

$folder = Find-VBRViFolder -Server $server -Name  NorwichDR-Lab140
Start-VBRInstantRecovery -RestorePoint $rp -VMName LarryWin7Nor -Server $server -ResourcePool $res -Folder $folder  -PowerUp -NICsEnabled
larry
Expert
 
Posts: 383
Liked: 90 times
Joined: Wed Mar 24, 2010 5:47 pm
Full Name: Larry Walker

Re: powershell instant recover SAN snapshot ?

Veeam Logoby v.Eremin » Mon Mar 13, 2017 10:44 am

I'm wondering what the results of this script were. Did you succeed in what you were trying to achieve?
v.Eremin
Veeam Software
 
Posts: 13701
Liked: 1020 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: powershell instant recover SAN snapshot ?

Veeam Logoby larry » Mon Mar 13, 2017 6:00 pm

My only thing left is finding which VMs are in an application group. I then will have a fully automated full site fail over to the DR site to 3 esx hosts, tested daily with a surebackup job. I got my surebackup jobs all talking using ESXi foundation with a little manual configuration of the lab appliance. Instant recovery from a remote san snap shot from PS is working. During a real DR the VMs would come up in instant recovery with a script hopefully using the application group to let me know which vm to which esx host that has been tested using. For testing I use the lab appliance for a router, the mascara IP, static mapping and internet proxy appliance. During a real DR I will turn the Lab VMs off.
I did find doing two instant recoveries of the same snap shot to two esx host the file is in use if I do it too quick , even if I use the gui.
I still need to write sure backup scripts to test everything but that is the easy part.

My DR site is a live site as well so I must balance the load between hosts.
larry
Expert
 
Posts: 383
Liked: 90 times
Joined: Wed Mar 24, 2010 5:47 pm
Full Name: Larry Walker

Re: powershell instant recover SAN snapshot ?

Veeam Logoby v.Eremin » Tue Mar 14, 2017 1:00 pm 1 person likes this post

You can get the names of VMs present in a given Application Group via the following PS workaround:

Code: Select all
asnp VeeamPSSnapin
$AppGroup = Get-VSBApplicationGroup -name "Name of your application group"
$Objects = [Veeam.Backup.Core.SureBackup.CSbOiag]::GetAllInApplicationGroup($AppGroup.id)
foreach ($Object in $Objects)
{
Get-VBRRestorePoint | where {$_.objectid -eq $Object.Info.ObjectId} | select VMName -Unique
}


Thanks.
v.Eremin
Veeam Software
 
Posts: 13701
Liked: 1020 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: Bing [Bot] and 1 guest