Hi everyone, Who of you knows Veeam SureBackup? I hope everybody! By default Veeam delivers some nice little scripts to verify that your backup is restorable and that the application inside is responding. For the most requirements these default scripts are enough but it is qutie easy to build your custom scripts to verify whatever you want inside your backups / replicas. Last week I was on a customer meeting. We implemented SureBackup in his environment. After we created all necessary virtal labs and application groups he asked me:” How can I verify that my fileserver backup is valid?”
My answer was: “Puhhh, I have no idea but we will find a way with a little custom script.”
In the following steps I will show you how easy it was to approach the customers demands. It took us less than one hour to build and test his fileserver backup validation.
1. Step 1: Build a script
To test a fileserver for recovery purpose we need to know that the shares are acessible. So we decided to build a small batch script that tests the fileserver share access.
“if exist \fileserver01.lab.local\shares\users\fraack\ exit /b 0 exit /b 1”
So our batch file looks like this. Here you have to fill in the share name and thats it. Important for Veeam SureBackup is the return code 0 or 1. 0 means success and 1 means error.
If your script is created go name it fileserver.bat and copy it to the following directory of your Veeam Backup Server: “C:\Program Files\Veeam\Backup and Replication\Backup”
2. Step 2: Build a Veeam Application Group role
At this point we want to create a custom file server role that we can assignt later on to our fileserver inside the application group menu. Therfore we have to navigate with the file explorer on the Veeam backup server to the following path: “C:\Program Files\Veeam\Backup and Replication\Backup\SbRoles"
There you should see a similiar view like this.
Now copy any random existing role and name it fileserver or fileserver01 or whatever you like.
Right click the new fileserver.xml file and click edit. In this file we have to change the following values:
- UID by using a common UID Generator just copy and paste
- the name section to identify it later on inside the Veeam UI
- the script name Consider: If your are not using the default path like described in step 1 you have to fill in the whole path.
- remove the section arguments.
After your modification your XML file should look like this.
3. Step 3: Assign fileserver role to fileserver in application group
At this point everything is configured. We only need to assign the newly created role to our fileserver inside the apllication group setting. So lets jump back to the Veeam UI and edit the settings of your desired application group.
Select the new created role for your file server inside the application group settings and save it.
4. Step 4: Test it
Now please run your SureBackup Job and verify that your script is working probably. If you want to force an error you can modify your little batch script and type in a sharename that is not existing on this filserver. If everthing is fine your SureBackup script test should end with success.