I’ll be the first to admit that I’m not an automation expert. That being said, I also like to start small, and one area I’d think is a good area for many is PowerShell. For Veeam Backup & Replication, I’d like to draw your attention to the PowerShell User Guide: https://helpcenter.veeam.com/docs/backup/powershell/getting_started.html?ver=110
This is a great place to start with PowerShell and for a small task like creating jobs, it’s so easy even Rick Vanover can do it. Take for example this 5-line PowerShell script:
$repository = Get-VBRBackupRepository -Name "NAS"
$TagsOnlyWayToGo = Find-VBRViEntity -Name "fwu-Engineering" -Tags
Add-VBRViBackupJob -Name "__FWU Backup - Engineering" -BackupRepository $repository -Entity $TagsOnlyWayToGo -Description "Provider level backup job of Engineering - 24h RPO"
Set-VBRJobSchedule -Job "__FWU Backup - Engineering" -Periodicaly -FullPeriod 24 -PeriodicallyKind Hours
Enable-VBRJobSchedule -Job "__FWU Backup - Engineering"
You also may have/want to add this string to get PowerShell going:
Add-PSSnapin VeeamPSSnapin
Connect-VBRServer
Once your session is active, the simple 5-line script will create a job, let me walk through each line:
$repository = Get-VBRBackupRepository -Name "NAS"
I have a pre-defined backup repository called “NAS” and this is the target for my backup job to go to.
$TagsOnlyWayToGo = Find-VBRViEntity -Name "fwu-Engineering" -Tags
I may be a bit boasty, indicating that for this VMware backup job - vSphere Tags are the only way to go and I’m adding to the job a tag type called “fwu-Engineering” and any VM or other object tagged with that will be put in the job. Easy-peasy.
Add-VBRViBackupJob -Name "__FWU Backup - Engineering" -BackupRepository $repository -Entity $TagsOnlyWayToGo -Description "Provider level backup job of Engineering - 24h RPO"
I gave the job a name here, and a description. Use the descriptions here, makes troubleshooting a bit easier later.
Set-VBRJobSchedule -Job "__FWU Backup - Engineering" -Periodicaly -FullPeriod 24 -PeriodicallyKind Hours
I am not too particular on the job other than I want it to run every 24 hours; and I set that here.
Enable-VBRJobSchedule -Job "__FWU Backup - Engineering"
Enable the job and go!
I have done a few demos where I was able to quickly onboard backups for a number of different tags, one job per tag quite easily. I like PowerShell job creation as it can ensure they are consistently done and is a quick and easy way to do it.
Like I said - I’m no Automation Guru but the beauty about Veeam here is you can start small, as simple as jobs and build on that. Let me know if you’ve ever done a PowerShell job creation.