EDIT 23.06.22: I have put another reply post further down which may be helpful to anyone struggling with this issue. The solution is not perfect and will require your own testing, but it could be useful.
I recently encountered an issue for a customer who wanted to use SureBackup for testing the recovery of their virtual machines, but as they were using VMware NSX-T this was not working. SureBackup with VMware NSX-T is not officially supported by Veeam yet, but by working with Andreas Neufert in the product management team and getting some help with some script code from my colleagues, Solutions Architect Ed Howard, and Technical Account Manager Roland Kiper, I was able to create a workable solution for the customer.
The problem is that when using an NSX-T port group in the virtual lab configuration, the SureBackup job won't be able to automatically map the network to the restored virtual machine. This means the virtual machine is left without a virtual network adapter and therefore can't communicate on the network. Below is a screenshot of the error.
Now, this can be solved by putting the virtual network adapter into the virtual machine and connecting it to the virtual lab isolated network (I'll show how to do this with a script below), but the second problem for this customer was that the SureBackup job ping test was skipped (which happens automatically because of the mapping error), and they wanted to see that this was working.
To get around these two issues we can add two additional roles into the Application Group verification options. One role can run the script to put the virtual network adapter into the SureBackup restored virtual machine(s), the second can perform a ping test. You will likely want to tweak the below details to fit your needs.
1. Firstly on the VBR server you'll need to install VMware PowerCLI and, if SSL certificates aren't used for the vSphere Web Interface, you'll want to suppress the certificate warning prompts in the PowerCLI configuration using something similar to the below.
Code: Select all
Set-PowerCLIConfiguration -Scope AllUsers -InvalidCertificateAction Ignore
Code: Select all
#Connect to vCenter server or ESXi host using PowerCLI. You'll want to use an XML so credentials aren't in plain text.
Connect-viserver -Server [IP address] -User [username] -Password [password]
#Get virtual machine names with an underscore in (which is what a SureBackup provisioned VM will have in the name)
#You can also add other naming rules with -Like and -NotLike as shown here.
$vmNames = get-vm | Where-Object {$_.name -Like "*_*" -And $_.name -NotLike "*_Restore" -And $_.name -NotLike "*_Lab"}
#Takes the virtual machine names found in the command above and checks if any of those don't have a virtual network adapter.
#These virtual machines are stored in a new variable.
$vmNamesNoNetwork = $vmNames | where { $Null -match $_.extensiondata.network }
#Adds the network adapter to the virtual machines and connects it to the virtual lab network.
$vmNamesNoNetwork | foreach {Get-VM -name $_ | New-NetworkAdapter -NetworkName [Virtual Lab Network] -StartConnected}
exit
The code for each of these is below.
AddNetworkAdapter.xml
Code: Select all
<?xml version="1.0" encoding="utf-8" ?>
<SbRoleOptions>
<Role>
<SbRole>
<Id>4CDC7CC4-A906-4de2-979B-E5F74C44832A</Id>
<Name>Add Virtual Network Adapter</Name>
</SbRole>
</Role>
<Options>
<SbVerificationOptions>
<TestScripts>
<TestScripts>
<TestScript>
<Name>Add Virtual Network Adapter</Name>
<Type>Custom</Type>
<TestScriptFilePath>C:\SB_NetworkAdapter.ps1</TestScriptFilePath>
</TestScript>
</TestScripts>
</TestScripts>
<PingEnabled>True</PingEnabled>
</SbVerificationOptions>
</Options>
</SbRoleOptions>
Code: Select all
<?xml version="1.0" encoding="utf-8" ?>
<SbRoleOptions>
<Role>
<SbRole>
<Id>4CDC7CC4-A906-4de2-979B-E5F74C44832B</Id>
<Name>Ping Test</Name>
</SbRole>
</Role>
<Options>
<SbVerificationOptions>
<TestScripts>
<TestScripts>
<TestScript>
<Name>Ping Test</Name>
<Type>Custom</Type>
<TestScriptFilePath>C:\Windows\System32\ping.exe</TestScriptFilePath>
<Arguments>%vm_ip%</Arguments>
</TestScript>
</TestScripts>
</TestScripts>
<PingEnabled>True</PingEnabled>
</SbVerificationOptions>
</Options>
</SbRoleOptions>
Now when you run the SureBackup job you'll see the below in the UI when clicking on the virtual machine being restored. If you watch the tasks in the vSphere Web Interface you'll notice the virtual machine being reconfigured where the first script is adding the virtual network adapter.
You'll want to disable the ping check in the Application Group as shown below as it's being done by the script.
I hope this helps anyone struggling with this until SureBackup and NSX-T is officially supported.
Jay Newell
Technical Account Manager