Howdy Community,
I just uncovered an interesting situation that I wanted to share. I was brought a scenario where the goal was to deploy VBR via code. There was a snag with the job creation and we realized this dilemma:
- When creating a backup job that targets VDC Vault, the job requires encryption to be enabled.
- When creating jobs with Powershell, the job must first be created and then encryption settings are modified afterwards.
The first thing I want to say about this is that it is indeed a known limitation that is scheduled to be fixed. :)
In the meantime, is there anything we can do about this? Yes! I wrote and published a sample script to show how I achieved this. The short version of this is:
- Create a temporary job to a non-Vault repository.
- Enable encryption on the temporary job
- Clone the job targeting the Vault Repository
In detail, my sample does the following:
- Define your variables:
- Encryption Key
- I’m getting my key from an existing key already in the VBR System.
- VMName
- For this example, I kept it simple and used a single VM.
- Job Names
- Define a Temp Job name, this will be deleted at the end of the script for cleanliness
- Define the Production Job Name, this is the job that will point to Vault and live on past the script.
- Description
- Add a description to the job as desired.
- Repositories
- Default Repo, or whatever non-Vault repository you have. This will not hold any backups and is only used as a placeholder for the initial job creation.
- Vault Repo for the final result of the job creation.
- Encryption Key
- Create job
- Piped into this line: Enabled Encryption & Disable Synthetic Full backups
- Clone job with the target at Vault
- Delete the temp job.
Hopefully this comes in handy for someone out there. In the meantime, happy coding!
-AC