Automation Scripts

Automation Scripts

BDRSuite Scripts can be used to automate many BDRSuite functions, such as bulk addition, getting customized reports etc. We have written python scripts using BDRSuite APIs to automate a few use cases in this guide.
For example, the python scripts enables the user to;
  1. To add a large number of credentials
  2. To add a large number of ESXi/vCenter, Hyper-V Standalone/Cluster/SMB, Windows Servers, and Workstations to the list of data sources
  3. To get customized reports from the BDRSuite servers.

Prerequisites

  1. Downloading the script files
  2. Installing the dependency packages
  3. Authentication
  4. Installing and Preparing Python for BDRSuite Offsite DR Server

Downloading the script files

Download the BDRSuiteScripts.zip from the BDRSuite Backup Server machine and unzip it.

Copy the BDRSuiteScripts folder extracted from the zip file to the Vembu Directory;
Windows BDRSuite Backup Server
$$InstallationDirectory\Vembu\
For example, C:\Program Files\Vembu\
Linux BDR Backup Server
$$InstallationDirectory/Vembu/
For Example, home/vembubdr/Vembu

Installing the dependency packages

Pandas package is required for executing a few custom report script.
To install the package open command prompt with administrative privileges and run the command given below;
command>> “C:\Program Files\Vembu\BackupForAWS\Python37\python.exe” “C:\Program Files\Vembu\BackupForAWS\Python37\Scripts\pip.exe” install pandas
Notes
Note: The dependency packages need to be installed only once.

Authentication

Follow the steps required to proceed with the authentication protocol for executing the automation scripts.
The auth.csv file will be present inside the BDRSuiteAutentication Folder.
Windows BDR Backup Server
$$InstallationDirectory\Vembu\BDRSuiteScripts\BDRAutentication\auth.csv
Linux BDR Backup Server
$$InstallationDirectory/Vembu/BDRSuiteScripts/BDRAutentication/auth.csv
Open the auth.csv file using any text editor and update the following inputs.
a. UserName: Login user name created for the BDRSuite Backup Server web console.
b. password_md5: Update the md5 value of login password of the BDRSuite Backup Server.
Use the following link to get the md5 value - https://www.md5hashgenerator.com/
Example: The md5 value of ‘admin’ is ‘21232f297a57a5a743894a0e4a801fc3’
c. endpoint_url: Update the URL BDRSuite Backup Server of which you want to get the custom report.
Sample Input : The sample input is as follows;
UserName,password_md5,endpoint_url
admin,21232f297a57a5a743894a0e4a801fc3,http://127.0.0.1:6060/bdrwebservices.php

Installing and Preparing Python for BDRSuite Offsite DR Server

  1. Download the latest python version(v3 and above recommended) from the following URL, https://www.python.org/downloads/
  2. Run the python installer and choose Add Python to PATH option in the Installation Wizard before proceeding with the installation.
  3. Open command prompt with administrative privileges.
  4. Run the following command in Command Prompt to install the dependency packages of python.
Command: 
pip install pandas
For example:
Windows: C:\Rebuild>pip install pandas
Linux: /home/Rebuild>pip3 install pandas
For example:
Windows: C:\BDRSuiteScripts>pip install pandas
Linux: /home/BDRSuiteScripts>pip3 install pandas

Script Library

Add Credentials

This operation will add a large number of credentials of Host/Entities to the BDRSuite backup server. Follow the steps given below to prepare the input file and execute the python script for adding credentials of Hosts/Entities,
Notes
Note: Applicable To Windows BDR Backup Server and Linux BDR Backup Server.
1. The input.csv file for Add Credentials operation will be present inside the following folder
Windows BDR Backup Server
$$InstallationDirectory\Vembu\BDRSuiteScripts\AddCredentials\input.csv
For Example, C:\ProgramFiles\Vembu\BDRSuiteScripts\AddCredentials\input.csv
Linux BDR Backup Server
$$InstallationDirectory/Vembu/BDRSuiteScripts/AddCredentials/input.csv
For Example, home/vembubdr/Vembu/BDRSuiteScripts/AddCredentials/input.csv
2. Open the input.csv file using any text editor and give inputs
Sample Input
Action,credentialName,credentialUsername,credentialPassword
ADD_CREDENTIALS,CredentialName1,root,******
ADD_CREDENTIALS,CredentialName2,root,******
Input Details
Name
Type
Description
Mandatory/Optional
Action
String
ADD_CREDENTIALS
Mandatory
CredentialName
String
Value specifying the name of the credential to be added.
Mandatory
CredentialUserName
String
Value specifying the username of the credential to be added.
Mandatory
CredentialPassword
String
Value specifying the name of the credential to be added.
Mandatory
3. The python script for adding credentials will be present inside the following folder
Windows BDR Backup Server
$$InstallationDirectory\Vembu\BDRSuiteScripts\AddCredentials\AddCredentials.py
For Example, C:\Program Files\Vembu\BDRSuiteScripts\AddCredentials\AddCredentials.py
Linux BDR Backup Server
$$InstallationDirectory/Vembu/BDRSuiteScripts/AddCredentials/AddCredentials.py
For Example, home/vembubdr/Vembu/BDRSuiteScripts/AddCredentials/AddCredentials.py
4. Open command prompt with administrative privileges. Change the working directory to where you have downloaded the python script folder and run the file with command given below
Windows BDR Backup Server
$$InstallationDirectory\Vembu\BackupForAWS\Python37\python.exe” AddCredentials.py
For Example, C:\Program Files\Vembu\BackupForAWS\Python37\python.exe” AddCredentials.py
Linux BDR Backup Server
$$InstallationDirectory/Vembu/BackupForAWS/Python37/bin/python” AddCredentials.py
For Example,  home/vembubdr/Vembu/BackupForAWS/Python37/bin/python” AddCredentials.py
5. After successful execution of the script the output will be saved as a csv file
6. Open output.csv to check the response in the following location below
Windows BDR Backup Server
$$InstallationDirectory\Vembu\BDRSuiteScripts\AddCredentials\output.csv
For Example, C:\ProgramFiles\Vembu\BDRSuiteScripts\AddCredentials\output.csv 
Linux BDR Backup Server
$$InstallationDirectory/Vembu/BDRSuiteScripts/AddCredentials/output.csv
For Example,  home/vembubdr/Vembu/BDRSuiteScripts/AddCredentials/output.csv 

Add ESXi/vCenter Servers

This operation will add a large number of ESXi/vCenter Servers to the BDRSuite backup server. Follow the steps given below to prepare the input file and execute the python script for adding ESXi/vCenter Servers.
Notes
Note: Applicable To Windows BDR Backup Server and Linux BDR Backup Server.
1. The input.csv file for adding ESXi/vCenter Servers operation will be present inside the following;
Windows BDR Backup Server
$$InstallationDirectory\Vembu\BDRSuiteScripts\AddVMwareHost\input.csv
For Example,  C:\Program Files\Vembu\BDRSuiteScripts\AddVMwareHost\input.csv 
Linux BDR Backup Server
$$InstallationDirectory/Vembu/BDRSuiteScripts/AddVMwareHost/input.csv
For Example,  home/vembubudr/Vembu/BDRSuiteScripts/AddVMwareHost/input.csv
2. Open the input.csv file using any text editor and give inputs.
Sample Input
Action,hostIP,PortNumber,useExistingCredential,credentialName,credentialUserName,credentialPassword
ADD_VMWARE_HOST,192.168.102.85,443,vmware5,,,
ADD_VMWARE_HOST,192.168.102.27,443,,27,root,Vembu123$
Input Details:
Name 
Type
Description
Mandatory/Optional
Action
String
ADD_VMWARE_HOST
Mandatory
hostIP
String
Value specifying IP address of VMware host to be added.
Mandatory
portNumber
String
Value specifying port number which will be used for data communication between VMWare host and backup server.By default it is 443
Mandatory
useExistingCredentialsString
Value specifying the credential name for VMWare host to be added
Mandatory for adding host using existing credential
CredentialName
String
Value specifying the name of the credential to be added.
Mandatory for adding host using fresh/new credential
CredentialUserName
String
Value specifying User name of VMware host  to be added.
Mandatory for adding host using fresh/new credential
CredentialPassword
String
Value specifying password of VMware host to be added.
Mandatory for adding host using fresh/new credential
3. The python script for adding VMware host, will be present inside the following folder.
Windows BDR Backup Server
$$InstallationDirectory\Vembu\BDRSuiteScripts\AddVMwareHost\AddVmwareHost.py
For Example,  C:\Program Files\Vembu\BDRSuiteScripts\AddVMwareHost\AddVmwareHost.py
Linux BDR Backup Server
$$InstallationDirectory/Vembu/BDRSuiteScripts/AddVMwareHost/AddVmwareHost.py 
For Example,  home/vembubudr/Vembu/BDRSuiteScripts/AddVMwareHost/AddVmwareHost.py 
4. Open command prompt with administrative privileges. Change the working directory to where you have download the python script folder and run the file with command given below.
Windows BDR Backup Server
$$InstallationDirectory\Vembu\BackupForAWS\Python37\python.exe” AddVmwareHost.py
For Example, C:\Program Files\Vembu\BackupForAWS\Python37\python.exe” AddVmwareHost.py
Linux BDR Backup Server
“$$InstallationDirectory/Vembu/BackupForAWS/Python37/bin/python” AddVmwareHost.py
For Example, home/vembubdr/Vembu/BackupForAWS/Python37/bin/python” AddVmwareHost.py
5. After successful execution of the script the output will be saved as a csv file.
6. Open output.csv to check the response in the following location below.
Windows BDR Backup Server
$$InstallationDirectory\Vembu\BDRSuiteScripts\AddVMwareHost\output.csv
For Example,  C:\Program Files\Vembu\BDRSuiteScripts\AddVMwareHost\output.csv
Linux BDR Backup Server
$$InstallationDirectory/Vembu/BDRSuiteScripts/AddVMwareHost/output.csv
For Example, home/vembubudr/Vembu/BDRSuiteScripts/AddVMwareHost/output.csv

Add Microsoft Hyper-V Hosts

This operation will add a large number of Hyper-V Standalone/Cluster/SMB Servers to the BDRSuite backup server. Follow the steps given below to prepare the input file and execute the python script for adding Microsoft Hyper-V Hosts.
Notes
Note: Applicable to Windows BDR Backup Server.
1. The input.csv file for adding Microsoft Hyper-V Hosts operation will be present inside the following folder.
Windows BDR Backup Server
$$InstallationDirectory\Vembu\BDRSuiteScripts\AddHyperVHost\input.csv
For Example,  C:\Program Files\Vembu\BDRSuiteScripts\AddHyperVHost\input.csv
2. Open the input.csv file using any text editor and give inputs.
Sample Input
Action,hostIP,PortNumber,serverType,useExistingCredential,credentialName,credentialUserName,credentialPassword
ADD_HYPERV_HOST,192.168.102.119,42005,0,hyperv,,,
ADD_HYPERV_HOST,192.168.102.127,42005,0,,newhypervadd,administrator,*****

Name
Type
Description
Mandatory/Optional
Action
String
ADD_HYPERV_HOST
Mandatory
HostIP
String
Value specifying IP address of HyperV host to be added.
Mandatory
PortNumber
String
Value specifying port number which will be used for data communication between HyperV host and backup server.By default it is 42005.
Mandatory
ServerType
Integer
Value specifying the type of HyperV Server to be added

0-HyperV StandAlone

1-HyperV Cluster

2.HyperV SMB

3-HyperV SMB Cluster

Mandatory
useExistingCredential
String
Value specifying the credential name for HyperV host to be added
Mandatory for adding host using existing credential
credentialName
String
Value specifying the name of the credential to be added.
Mandatory for adding host using fresh credential
credentialUserName
String
Value specifying User name of HyperV host  to be added.
Mandatory for adding host using fresh credential
credentialPassword
String
Value specifying password of HyperV host to be added.
Mandatory for adding host using fresh credential
3.  The python script for adding Hyper-V host will be present inside the following folder.
Windows BDR Backup Server
$$InstallationDirectory\Vembu\BDRSuiteScripts\AddHyperVHost\AddHyperVHost.py
For Example, C:\ProgramFiles\Vembu\BDRSuiteScripts\AddHyperVHost\AddHyperVHost.py
4. Open command prompt with administrative privileges. Change the working directory to where you have download the python script folder and run the file with command given below.
Windows BDR Backup Server
$$InstallationDirectory\Vembu\BackupForAWS\Python37\python.exe” AddHyperVHost.py 
For Example, C:\Program Files\Vembu\BackupForAWS\Python37\python.exe” AddHyperVHost.py 
5. After successful execution of the script the output will be saved as a csv file.
6.Open output.csv to check the response in the following location below.
Windows BDR Backup Server
$$InstallationDirectory\Vembu\BDRSuiteScripts\AddHyperVHost\output.csv
For Example,  C:\Program Files\Vembu\BDRSuiteScripts\AddHyperVHost\output.csv

Add Microsoft Windows Machines (DiskImage Backup)

This operation will add a large number of Microsoft Windows Servers to the BDRSuite backup server. Follow the steps given below to prepare the input file and execute the python script for adding Microsoft Windows Machines.
1. The input.csv file for adding Microsoft Windows Machines operation will be present inside the following folder
Windows BDR Backup Server
$$InstallationDirectory\Vembu\BDRSuiteScripts\AddDiskImageHost\input.csv
For Example, C:\ProgramFiles\Vembu\BDRSuiteScripts\AddDiskImageHost\input.csv
2. Open the input.csv file using any text editor and give inputs.
Sample Input
Action,hostIP,PortNumber,useExistingCredential,credentialName,credentialUserName,credentialPassword
ADD_DISKIMAGE_HOST,192.168.102.119,42005,diskimage,,,
ADD_DISKIMAGE_HOST,192.168.102.127,42005,,newdiskimageadd,administrator,***
Input Details
Name 
Type
Description
Mandatory/Optional
Action
String
ADD_DISKIMAGE_HOST
Mandatory
hostIP
String
Value specifying IP address of Windows Disk Image host to be added.
Mandatory
PortNumber
String
Value specifying port number which will be used for data communication between Windows Disk Image host and backup server.
Mandatory
useExistingCredential
String
Value specifying the credential name for Windows Disk Image host to be added
Mandatory for adding host using existing credential
credentialName
String
Value specifying the name of the credential to be added.
Mandatory for adding host using fresh credential
credentialUserName
String
Value specifying User name of Windows Disk Image host  to be added.
Mandatory for adding host using fresh credential
credentialPassword
String
Value specifying password of Windows Disk Image host to be added.
Mandatory for adding host using fresh credential
3.  The python script for adding Windows Host will be present inside the following folder.
Windows BDR Backup Server
$$InstallationDirectory\Vembu\BDRSuiteScripts\AddDiskImageHost\AddDiskImageHost.py
For Example, C:\ProgramFiles\Vembu\BDRSuiteScripts\AddDiskImageHost\AddDiskImageHost.py
4. Open command prompt with administrative privileges. Change the working directory to where you have download the python script folder and run the file with command given below
Windows BDR Backup Server
$$InstallationDirectory\Vembu\BackupForAWS\Python37\python.exe” AddDiskImageHost.py
For Example, C:\Program Files\Vembu\BackupForAWS\Python37\python.exe” AddDiskImageHost.py
5. After successful execution of the script the output will be saved as a csv file.
6. Open output.csv to check the response in the following location below.
Windows BDR Backup Server
$$InstallationDirectory\Vembu\BDRSuiteScripts\AddCredentials\output.csv
For Example, C:\ProgramFiles\Vembu\BDRSuiteScripts\AddDiskImageHost\output.csv

 




 


    • Related Articles

    • Can I run custom scripts before and after each backup job?

      Yes, BDRSuite allows you to run custom scripts in the form of batch files automatically before and after every backup job. This feature also as pre/post scripts enables you to prepare applications for backup mode before the backup starts and revert ...
    • Can I run custom scripts before and after disk image backup?

      Yes, BDRSuite allows you to run custom scripts before and after disk image backups. This feature enables you to automate pre-backup and post-backup tasks, providing greater flexibility and control over your backup operations.
    • Introduction

      BDRSuite exposes its objects with WebServices Application Programming Interface(API) by invoking actions through HTTP protocol in the form of requests with the corresponding parameters and receiving responses for the action This topicwill help you ...
    • Resolving Issue - "No Databases Were Listed for Backup" in BDRSuite

      KB ID: 109000 Cause: BDRSuite utilizes a PowerShell script to list databases available in Exchange Server. If the execution of PowerShell scripts is disabled in the Exchange Server, BDRSuite will not be able to list the available databases during the ...
    • How do I add my Microsoft 365 account to BDRSuite for backup?

      To add your Microsoft 365 account to BDRSuite for backup, follow these steps: Go to the Microsoft 365 section in BDRSuite Backup Server. Select one of the following methods to add and authorize your account: Automatic Process: BDRSuite completes the ...