Veeam Backup & Replication v10: Data Integration API examples
At VeeamON 2019, I did a live demo around the new Veeam Backup & Replication v10 feature called “Data Integration API“. This is a great new feature that will make 3rd party integration into your backups even easier.
After the demo, I had several discussions about the use cases and people asked me for the specific code (and even the Veeam Backup & Replication build used at VeeamON). At that point in time, I would redirect them to my sneak peek post which contained a video of the demo. During the BETA and RC phase of Veeam Backup & Replication v10, there was a blog post on the official Veeam blog which contains a short example on how to present backup data taken from the last restore point in a backup to an external server via iSCSI. On top of that, I silently published the code on my personal GitHub so people could leverage it.
As Veeam Backup & Replication v10 is now GA, I decided to make this quick blog post so everyone can get started with the API and provide some other examples. The scripts are now also available via my personal GitHub and I’ve also added the examples to VeeamHUB, Veeam’s community-driven GitHub.
- Example 1: Publish backup data for a SINGLE virtual machine using the LAST restore point in a backup
- Example 2: Publish backup data for EVERY virtual machine using the LAST restore point in a backup
- Example 3: Publish ALL backup data for EVERY virtual machine in a backup (this mounts all the data for every restore point available)
Disclaimer: The scripts provided are based upon testing with Veeam Backup & Replication v10 GA in a lab-based environment. I suggest to analyze the scripts and modify them to your needs before running it in production.
Below is a list of parameters you will have to change based upon the script you want to use.
(Only in the first example)
# The vmname variable $vmname is where you define the Virtual Machine name
$vmname = "MYVIRTUALMACHINENAME"
(Below is available in every example)
# The backup variable $backup is populated by the cmdlet Get-VBRBackup which will return info regarding the backup data
$backup = Get-VBRBackup -Name "MYBACKUP"
# Provide the host name of the target server
$targetServerName = "TARGETSERVER"
# Provide the credentials to access the remote server, for example: lab\administrator
# These must be stored within the Credentials manager in Veeam Backup & Replication
$targetAdminCreds = Get-VBRCredentials -name "LAB\Administrator"
Below is the output when you leverage example 3 and mount all the backup data in your backup file. We have 7 restore points available which will be published upon running the script.
The published disks can be seen in the history tab within the Veeam Backup & Replication console, as well as the “Instant Recovery” tab.
And finally, you can see the disks mounted on the target server via Windows Disk Manager.
Get creative!
As you can see, it is really simple to publish data and get creative on how to leverage it for data analytics, forensics… Did you already make something or have an amazing idea? We encourage you to publish it to VeeamHub and share it with everyone.
Let’s get creative!