Script to import backup file into Veeam and then restore VMs

PowerShell script exchange

Script to import backup file into Veeam and then restore VMs

Veeam Logoby rolltidega » Wed Mar 09, 2016 8:35 pm

I apologize if this is already available but I am not a Powershell guru. I am looking for some guidance. This would pertain to version 9. I have backups being sent to my side via Cloud Connect backup. (I cannot use the replication option to do this for some internal reasons that I cannot explain). What I need to do on a regular basis is import these backups and restore the VMs into vCenter on my side. I want to use a PowerShell script to import the backups into Veeam and then pass the parameters to restore all the VMs in this backup file (always using the latest backup). I would need to specify all the stuff you would normally specify in the GUI, such as Host/Cluster, Datastore, Folder and Network. I will need these VMs to be overwritten by the next restore. Hopefully that makes sense.

Any help would be greatly appreciated. Thanks!
rolltidega
Novice
 
Posts: 4
Liked: 2 times
Joined: Tue Apr 05, 2011 12:10 pm
Full Name: Shawn Cannon

Re: Script to import backup file into Veeam and then restore

Veeam Logoby PTide » Thu Mar 10, 2016 2:51 pm

Hi,

You can import a backup with this cmdlet. To restore a VM from backup use this cmdlet. To restore all VMs from a backup to the most recent RP you'll need to combine foreach loops and where conditions. This thread might be helpful.

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

Re: Script to import backup file into Veeam and then restore

Veeam Logoby j0dan » Sun Mar 26, 2017 2:16 am

rolltidega wrote:I apologize if this is already available but I am not a Powershell guru. I am looking for some guidance. This would pertain to version 9. I have backups being sent to my side via Cloud Connect backup. (I cannot use the replication option to do this for some internal reasons that I cannot explain). What I need to do on a regular basis is import these backups and restore the VMs into vCenter on my side. I want to use a PowerShell script to import the backups into Veeam and then pass the parameters to restore all the VMs in this backup file (always using the latest backup). I would need to specify all the stuff you would normally specify in the GUI, such as Host/Cluster, Datastore, Folder and Network. I will need these VMs to be overwritten by the next restore. Hopefully that makes sense.

Any help would be greatly appreciated. Thanks!


Have you made any progress on this? We're interested in doing this too and would be nice to pool our efforts.
j0dan
Service Provider
 
Posts: 4
Liked: never
Joined: Thu Nov 03, 2016 1:03 am
Full Name: Dan Buhler

Re: Script to import backup file into Veeam and then restore

Veeam Logoby v.Eremin » Mon Mar 27, 2017 4:20 pm

What I need to do on a regular basis is import these backups and restore the VMs into vCenter on my side

Import action seems unnecessary, as information regarding backups is already present in db and therefore can be accessed via PowerShell.

Anyway, general algorithm should look similar to the following ones:

1) Find required restore point - Get-VBRRestorePoint
2) Find required Virtual Infrastructure details (Server, Resource Pool, Datastore) - Get-VBRServer, Find-VBRViResourcePool, Find-VBRViDatastore
3) Restore VM, using collected data - Start-VBRRestoreVM

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: No registered users and 2 guests