To verify VMs with a SureBackup job, you can instruct Veeam Backup & Replication to run predefined tests for VMs or use custom verification scripts.
Veeam Backup & Replication can verify VMs with the following predefined tests:
- Heartbeat test. When the VM starts, Veeam Backup & Replication performs a heartbeat test. It waits for a heartbeat signal from VMware Tools installed inside the VM to determine that the VM guest OS is running. If the signal comes regularly at specific time intervals, the test is passed.
- Ping test. Veeam Backup & Replication sends ping requests to the VM from the backup server and checks if the VM can respond to them. If the VM responds to ping requests, the test is passed.
- Application test. Veeam Backup & Replication waits for applications inside the VM to start and runs a script against these applications. Veeam Backup & Replication uses two types of predefined scripts:
- For DNS servers, domain controllers, Global Catalog servers, mail servers and web servers, Veeam Backup & Replication uses a script that probes an application-specific port. For example, to verify a domain controller, Veeam Backup & Replication probes port 389 for a response. If the response is received, the test is passed.
- For Microsoft SQL Server, Veeam Backup & Replication uses a script that attempts to connect to instances and databases on the Microsoft SQL Server. For more information, see Microsoft SQL Server Checker Script.
To run the heartbeat and ping tests, you must have VMware Tools installed inside the VM. If VMware Tools are not installed, these tests will be skipped.
You can run verification tests for VMs added to the application group or processed with a linked SureBackup job. Settings for verification tests can be specified and customized in the application group or SureBackup job settings.
If you need to verify a virtualized Microsoft SQL Server, you can instruct Veeam Backup & Replication to run the Microsoft SQL Server Checker script against it during the SureBackup job. The script sequentially performs the following operations:
- Connects to Microsoft SQL Server instances.
- Enumerates databases on these instances.
- Employs the USE SQL statement to connect to databases and check their availability.
By default, the script is located on the backup server by the following path: %ProgramFiles%\Veeam\Backup and Replication\Backup\Veeam.Backup.SqlChecker.vbs.
The script runs on the backup server side, not from inside of a Microsoft SQL Server VM. For this reason, Named Pipes or TCP/IP connections must be enabled for the Microsoft SQL Server running in the virtual lab. For more information, see https://msdn.microsoft.com/en-us/library/dd983822(v=nav.71).aspx.
Credentials for Script Execution
To execute the script, Veeam Backup & Replication connects to Microsoft SQL Server. By default, Veeam Backup & Replication uses the account under which the Veeam Backup Service is running. If you need to run the script under another account, you can specify credentials for this account. The script supports Microsoft Windows and SQL Server authentication methods.
- For the Microsoft Windows authentication mode, you can specify credentials for the account on the Credentials tab in the application group or SureBackup job settings.
- For the SQL Server authentication mode, you must pass credentials of the account as arguments to the script. You can do it via the UI or command line interface.
To pass credentials via the UI, in the application group or SureBackup job settings, select to use a custom script, specify a path to the Microsoft SQL Server Checker script (by default, %ProgramFiles%\Veeam\Backup and Replication\Backup\Veeam.Backup.SqlChecker.vbs) and specify the user name and password in the Arguments field.
To pass credentials via the command line, run the script from the command line in with the following parameters:
cscript Veeam.Backup.SqlChecker.vbs [logs folder] <sql server[\instance]> <username> <password>
Even if you use the Microsoft SQL Server authentication mode, in some cases, you may need to specify credentials of the account to connect to the machine on which Microsoft SQL Server is installed. To do this, use the Credentials tab in the application group or SureBackup job settings.
By default, Veeam Backup & Replication verifies all databases on all instances of Microsoft SQL Server. However, you can exclude specific databases from verification — for example, VMware vCenter Server database. To exclude an instance or a database, you must open the script in the text editor and edit the Settings section in the following way:
- To exclude specific databases, uncomment the 'gDBsToExclude.Push "dbname" line in the script and specify name(s) of database(s) that you want to exclude. To exclude several databases, use a comma.
- To exclude specific instances, uncomment the 'gInstancesToExclude.Push "instancename" line in the script and specify name(s) of instances that you want to exclude. To exclude several instances, use a comma.
- To exclude the default instance, uncomment the 'gInstancesToExclude.Push "MSSQLSERVER" line.
Instance and database names are case sensitive.
To define whether the script has completed successfully or not, Veeam Backup & Replication publishes the following return codes in the SureBackup job session statistics:
- 0 — test is passed successfully.
- 1 — you use a wrong syntax for the script command.
- 2 — Veeam Backup & Replication is unable to connect to Microsoft SQL Server.
- 3 — all instances are excluded from the check.
- 4 — error occurred while Veeam Backup & Replication was getting the list of databases.
- 5 — unknown error
- 6 — one or more databases are not accessible.
Results of script execution are written to the log file located by the following path: %programdata%\Veeam\Backup\<name of the job>\<VM name>_SQLChecker.log. If necessary, you can change the log file location. To do this, you must pass a new path to the log file in the %log_path% argument in the application group or SureBackup job settings.
In addition to recovery verification tests, Veeam Backup & Replication allows you to perform backup file validation. For backup file validation, Veeam Backup & Replication performs a CRC check for backup files of VMs verified by the SureBackup job. You can also validate backup files for VMs from the application group with this test.
To validate the backup file, Veeam Backup & Replication uses the checksum algorithm. When Veeam Backup & Replication creates a backup file for a VM, it calculates a checksum for every data block in the backup file and stores this data in the backup file, together with VM data. During the backup file validation test, Veeam Backup & Replication de-compresses the backup file, re-calculates checksums for data blocks in the uncompressed backup file and compares them with initial checksum values. If the results match, the test is passed.
The backup file validation test is started after recovery verification tests. As soon as Veeam Backup & Replication completes all "live" verification for all VMs in the SureBackup job, it unpublishes VMs and starts the backup file validation test.
The result of the backup file validation test impacts the state of the SureBackup job session. If the validation tests are completed successfully but the backup validation is not passed, Veeam Backup & Replication marks the SureBackup job session with the Warning or Error status.