How to do VM attachment to OVS bridge in HyperV Failover Cluster
I have a Failover Cluster of 2 HyperV Windows Server 2012 R2 DataCenter. Both servers have OVS installed and configured in exactly the same way:
PS C:\Users\Administrator.VBN> Get-NetAdapter
Name InterfaceDescription ifIndex Status MacAddress LinkSpeed
---- -------------------- ------- ------ ---------- ---------
br0 Hyper-V Virtual Ethernet Adapter #3 32 Up 00-15-5D-A3-51-0B 10 Gbps
vEthernet (OOB - Virtu... Hyper-V Virtual Ethernet Adapter #2 23 Up 6C-3B-E5-B3-EE-96 10 Gbps
NIC-4 Mgmt OOB HP NC382i DP Multifunction Gigabi...#54 12 Up 6C-3B-E5-B3-EE-96 1 Gbps
NIC-3 LudoLab HP NC382i DP Multifunction Gigabi...#53 15 Up 6C-3B-E5-B3-EE-94 1 Gbps
NIC-5 iSCSI HP NC382T PCIe DP Multifunction G...#64 24 Up 10-60-4B-B2-0F-8C 1 Gbps
NIC-2 POC Team HP NC382i DP Multifunction Gigabi...#52 14 Up 6C-3B-E5-B3-EE-9A 1 Gbps
NIC-1 POC Team HP NC382i DP Multifunction Gigabi...#51 13 Up 6C-3B-E5-B3-EE-98 1 Gbps
POC Teaming Microsoft Network Adapter Multiplexo... 19 Up 6C-3B-E5-B3-EE-98 2 Gbps
NIC-6 Clustering HP NC382T PCIe DP Multifunction G...#65 25 Up 10-60-4B-B2-0F-8E 1 Gbps
PS C:\Users\Administrator.VBN> Get-VMSwitch -Name LudoLab
Name SwitchType NetAdapterInterfaceDescription
---- ---------- ------------------------------
LudoLab External HP NC382i DP Multifunction Gigabit Server Adapter #53
PS C:\Users\Administrator.VBN> Get-VMSwitchExtension -VMSwitchName LudoLab -Name "Open vSwitch Extension"
Id : 583CC151-73EC-4A6A-8B47-578297AD7623
Name : Open vSwitch Extension
Vendor : Cloudbase Solutions Srl
Version : 2.5.0.1
ExtensionType : Forwarding
ParentExtensionId :
ParentExtensionName :
SwitchId : 853568bc-80b4-46a2-9bad-967e904cf076
SwitchName : LudoLab
Enabled : True
Running : True
ComputerName : HYPERV1
Key :
IsDeleted : False
PS C:\Users\Administrator.VBN> ovs-vsctl show
f43a3bbb-c96a-4c83-a5f9-47d7310ec6d2
Bridge "br0"
Port "br0"
Interface "br0"
type: internal
Port "NIC-3 LudoLab"
trunks: [101, 102]
Interface "NIC-3 LudoLab"
I now have a VM1 on the Failover Cluster, located on HyperV1. I want to attach it to the OVS bridge on vlan 101, so on HyperV1 I do this:
$vnic = Get-VMNetworkAdapter VM1
$vnic[0] | Set-VMNetworkAdapterOVSPort -OVSPortName VM1-Eth1
Connect-VMNetworkAdapter -VMNetworkAdapter $vnic[0] -SwitchName LudoLab
ovs-vsctl add-port br0 VM1-Eth1 tag=101
This works fine and my VM1 now has connectivity over the OVS bridge on VLAN101; my OVS bridge on HyperV1 now looks like this:
PS C:\Users\Administrator.VBN> ovs-vsctl show
f43a3bbb-c96a-4c83-a5f9-47d7310ec6d2
Bridge "br0"
Port "br0"
Interface "br0"
type: internal
Port "VM1-Eth1"
tag: 101
Interface "VM1-Eth1"
Port "NIC-3 LudoLab"
trunks: [101, 102]
Interface "NIC-3 LudoLab"
However, I need my HyperV2 server to have exactly the same OVS configuration, for when I live-migrate VM1 to it.
So I try and configure this on HyperV2, but get an error:
PS C:\Users\Administrator.VBN> ovs-vsctl add-port br0 VM1-Eth1 tag=101
ovs-vsctl : ovs-vsctl: Error detected while setting up 'VM1-Eth1'. See ovs-vswitchd log for details.
At line:1 char:1
+ ovs-vsctl add-port br0 VM1-Eth1 tag=101
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (ovs-vsctl: Erro...og for details.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
The entry in ovs-vswitchd.log is:
2016-09-05T14:16:21.988Z|00103|dpif|WARN|system@ovs-system: failed to add VM2-Eth1 as port: Invalid argument
In spite of the error message, "ovs-vsctl show" on HyperV2 now shows the same identical OVS configuration as for HyperV1. However, if I now live-migrate my VM1 to HyperV2 the VM loses network connectivity.
In order to correct this I need to do these steps on HyperV2:
ovs-vsctl del-port ...