The use of virtual hostnames with SAP systems is a familiar approach to SAP customers, allowing the decoupling of actual SAP Server hostnames from the hostname referred to by the SAP instance. It provides a degree of abstraction allowing for simpler virtualization, naming conventions, hardware lifecycles, organizational policies, datacenter migrations and Disaster Recovery.
This blog post will provide step-by-step instructions on how to reliably deploy an Azure VM with the actual VM Server hostname, as well as the SAP Virtual hostname on a single network interface. These instructions only apply to Windows Operating system.
NOTE: Please note that the configuration described in this article does not apply to servers using Windows Server Failover Clustering (WSFC) which can provide high availability to SAP Database and SAP Central Services servers(A/SCS.) This configuration can be applied to SAP Application Servers and 2-tier SAP systems (Application, and SCS servers installed on a single VM.)
When migrating to Microsoft Azure, many customers choose to use a single network interface for their SAP VMs, as it simplifies automation of deployments and management. A common design misconception is that multiple network interfaces increase network throughput, however in Microsoft Azure, unlike many on-premises configurations, Azure Virtual Machines can scale network bandwidth to their potential maximum for that VM size with just a single network interface. There is no need for multiple network interfaces to scale bandwidth.
As detailed in SAP Note 2109662 - Windows returns wrong IP address as source IP however, the SAP installation will throw an error unless Windows IP addresses and the DNS registration of VM hostname and the SAP Virtual hostname are configured properly.
This configuration is detailed in SAP Note 1564275 - Install SAP Systems Using Virtual Host Names on Windows, however this blog will focus on how to accomplish this specifically in Microsoft Azure.
In this blog we will use the example of an SAP App server with 1 Network Interface attached and the following configuration:
Figure 0: A layout of what we want to achieve
First, let us look at the updates needed from the Portal.
When you are adding an additional IP configuration to the Azure NIC from Microsoft Azure portal, you can add an additional IP configuration on the Home > Network interface > “NIC Name” > IP configurations blade in the following way:
Figure 1: Open NIC configuration blade and click "Add"
Figure 2: adding second IP configuration in the add ipconfig blade
Now we move to the VM and RDP into it. The first thing you will notice once you boot-up is that, only one IP configuration is visible in the VM. The reason is that Azure DHCP, by default, assigns the primary IP configuration from the Azure NIC to the network interface within the VM. The secondary IP configurations must be manually assigned at the VM OS level.
Figure 3: Output of "ipconfig /all" on the VM
Now that we are on the VM, let us walk through the steps needed to allow us to use SAP virtual hostnames on Windows.
Figure 4: Uncheck the checkbox highlighted to prevent auto registration of IP addresses.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DNSRegisteredAdapters\{<36 character GUID corresponding to the network adapter that TCPIP was bound to>}
Figure 5: Set the IP addresses manually
Note: If you set this properly, you will experience a short disconnection to your RDP session and connect back. If you did not set any of the properties correctly, you will not be able to connect back until the VM is rebooted.
Figure 6: the primary address should show up on the "Advanced" properties window
Figure 7: After adding the secondary IP configuration on the network adapter
#Get interface alias, ip addresses and the skip as source before starting
Get-NetAdapter | Get-NetIPAddress | `
Where-Object -FilterScript { $_.AddressFamily -eq "IPv4" } | `
Select-Object InterfaceAlias, IPAddress, SkipAsSource
$primaryIP = "10.0.0.8" #replace with your primary ip
$netInterface = "Ethernet 3" #replace with your network adapter name
# get all the IP addresses on the interface, filtered by IPv4 and excluding
# the $primaryIP
[array]$IPs = Get-NetIPAddress -InterfaceAlias $netInterface | ``
Where-Object { $_.AddressFamily -eq "IPv4" -and $_.IPAddress -ne $primaryIP }
# set primary IP SkipAsSource to false
Set-NetIPAddress -IPAddress $primaryIP -InterfaceAlias $netInterface -SkipAsSource $false
# set other IP addresses with SkipAsSource equal to true
Set-NetIPAddress -IPAddress $IPs.IPAddress -InterfaceAlias $netInterface -SkipAsSource $true
#check all properties are set properly
Get-NetAdapter | Get-NetIPAddress | `
Where-Object -FilterScript { $_.AddressFamily -eq "IPv4" } | `
Select-Object InterfaceAlias, IPAddress, SkipAsSource
Once we complete running the code, the output from the Get-NetAdapter command above should look like this:
Figure 8: setting "SkipAsSource" to True on the secondary IP address of the NIC
Figure 9: Host (A) records in DNS for the server and virtual hostnames
Figure 10: setting to update the PTR records in DNS
New-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Lsa\MSV1_0' `
-Name "BackConnectionHostNames" `
-Value "sapvhost","sapvhost.contoso.local" `
-PropertyType MultiString
Note: This setting would not need a server restart to work. You can complete all the steps and reboot the machine
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters' `
-Name "DisableStrictNameChecking" `
-Value "1" `
-PropertyType DWord
Figure 11: validating that the second IP shows up in ‘ipconfig /all’ command
Figure 12: validating that reverse lookup works for secondary IP
Figure 13: checking the shares are available by running net view command
Figure 14: Test connecting to SAP virtual hostname from MMC
To recap the configuration above, here are the 6 basic steps required on the Windows virtual machine to prep it for SAP installation using virtual hostnames with a single network interface:
Figure 15: After setting SkipAsSource, the interface details
(ex: sapvhost.contoso.local sapvhost <Not a space, but a carriage return between these>)
To ensure you have completed these steps correctly you can validate the configuration by:
After executing this set of steps on your VM, you are now prepared to start the SAP installation by starting SAPinst on the VM using virtual hostnames. Start SAPinst from an administrative command prompt and execute the following case-sensitive command: SAPinst.exe SAPINST_USE_HOSTNAME=<virtualhostname>.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.