Veeam v8 – Backing up a single VM with PowerShell

One of the nice additions to VBR v8 is the ability to back up a single VM within a job using Quick Backup. I especially like the fact that they extended this ability to the vSphere Web Client, making it as simple as a right click. You can read more about this functionality on Veeam’s blog:
8 gems in Veeam Availability Suite v8. Part 3: Quick Backup

After reading this post and using the feature a few times, I figured there would be no need to update the Single VM Backup script. It turns out there is still use for a script such as this which was pointed out to me in the comments (Thanks Phil!). Essentially the Quick Backup feature only works on VMs that have previously been backed up, it does not work for new VMs.

Follow this scenario – you create a new VM, add it to a backup job and want to create a nice, clean full backup of this VM. Quick Backup will not work in this case as it does not already have an existing backup of this VM. PowerShell to the rescue!

Just a few tweaks were needed in order to ‘fix’ the script for v8. I also added a version check to both the old and new scripts so that you do not inadvertently run the wrong script and mess up your jobs.

Warning – If you run the original script against v8 it will remove the ‘excluded’ VMs from the job permanently (doh!). There is nothing wrong with the script itself per se, Veeam just happened to make a tweak in v8 that causes the script to fail when re-adding the VMs to the job. This highlights the need to test all scripts running against production systems, including when changes are made like a version upgrade.

Advertisements

3 thoughts on “Veeam v8 – Backing up a single VM with PowerShell

  1. Kenneth

    I am getting this error in Veeam 8.x

    Add-VBRViJobObject : Cannot validate argument on parameter ‘Entities’. The argument is null. Supply a non-null argument and try the command again.
    At C:\Install\Backup_1_VM_in_a_job.ps1:41 char:44
    + Add-VBRViJobObject -job $Job -Entities $Excitem | Out-Null
    + ~~~~~~~~
    + CategoryInfo : InvalidData: (:) [Add-VBRViJobObject], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Veeam.Backup.PowerShell.Command.AddVBRViJobObject

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s