PowerShell script exchange
Post Reply
larry
Veteran
Posts: 387
Liked: 97 times
Joined: Mar 24, 2010 5:47 pm
Full Name: Larry Walker
Contact:

powershell instant recover SAN snapshot ?

Post by larry »

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.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: powershell instant recover SAN snapshot ?

Post by veremin »

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.
larry
Veteran
Posts: 387
Liked: 97 times
Joined: Mar 24, 2010 5:47 pm
Full Name: Larry Walker
Contact:

Re: powershell instant recover SAN snapshot ?

Post by larry »

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
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: powershell instant recover SAN snapshot ?

Post by veremin »

I'm wondering what the results of this script were. Did you succeed in what you were trying to achieve?
larry
Veteran
Posts: 387
Liked: 97 times
Joined: Mar 24, 2010 5:47 pm
Full Name: Larry Walker
Contact:

Re: powershell instant recover SAN snapshot ?

Post by larry »

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.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: powershell instant recover SAN snapshot ?

Post by veremin » 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests