Dwarfsoft [GPA]

NIC Bind Order for Microsoft Failover Cluster Virtual Adapter

by on Oct.24, 2012, under Scripting, Work

Print This Post Print This Post

I’ve been busy working on a project that is implementing a SQL Geo-Cluster. One of the requirements was to modify the NIC bind order such that the order of preference is Production,Heartbeat,…,Microsoft Failover Cluster Virtual Adapter. Most of this can be achieved through the Network Adapter Advanced Configuration window (Start->run->ncpa.cpl->Advanced Menu->Advanced Settings…) but the Microsoft Failover Cluster Virtual Adapter is a Hidden adapter and needs to be handled separately.

The original Suggestion from the Design document is to run “wmic nicconfig get description,settingid”. This list is used to get the SettingId of the NIC where the description is “Microsoft Failover Cluster Virtual Adapter”. The SettingId is then checked and moved in HKLM\SYSTEM\CurrentControlSet\services\tcpip\Linkage\Bind. The line in the Multi String that equals “\Device\” needs to be moved to the last line.

This can be achieved in PowerShell in quick order:

$device = "\Device\"+(gwmi Win32_NetworkAdapterConfiguration | ?{ $_.Description -like "*Microsoft Failover Cluster Virtual Adapter*" } | Select -ExpandProperty SettingId)
$binds = get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\services\tcpip\Linkage\" | Select -ExpandProperty Bind
$outbind = ($binds | ?{ $_ -ne $device })+$device
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\services\tcpip\Linkage" -Name Bind -Value $outbind -Type MultiString

Cheers, Chris.

:, , , , , ,

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!