Using the following:
Code: Select all
$server = Get-VBRServer -Name "esxh-02.my.tld"
$network = Get-VBRViServerNetworkInfo -Server $server | Where-Object {$_.NetworkName -eq "Primary Data Network"}
$mapping = New-VBRViVirtualLabIPMappingRule -ProductionNetwork $network -IsolatedIPAddress 10.48.0.102 -AccessIPAddress 11.48.0.102 -Note "DC-02"
$virtualLab = Get-VBRViVirtualLabConfiguration -Name "ESXH-02 vLab01"
Set-VBRViVirtualLab -VirtualLab $virtualLab -IpMappingRule $mapping
Set-VBRViVirtualLab : VM name cannot contains spaces.
At line:1 char:1
+ Set-VBRViVirtualLab -VirtualLab $virtualLab -IpMappingRule $mapping
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-VBRViVirtualLab], Exception
+ FullyQualifiedErrorId : System.Exception,Veeam.Backup.PowerShell.Cmdlets.SetVBRViVirtualLab
I'm stumped on where a VM name is containing spaces as I am not explicitly specifying a VM name in any of my commands. Can anybody offer any guidance on this?
Also, as I mentioned, I am planning to use this script to add a significant number of static IP mappings to our virtual labs (much more efficient than adding them via the GUI). I'm concerned that the $mapping variable as defined above contains only a single IP mapping and the subsequent Set-VBRVirtualLab will not append entries to the list of static IP mappings, rather replace the single mapping provided by each iteration. Any guidance here would also be appreciated.
Thank you,
Stan