Windows Server 2012 Hyper-V Cluster With NIC Teaming #WS2012 #vswitch   14 comments

In my previous post “ http://robertsmit.wordpress.com/2013/02/04/team-in-windows-2012-dos-and-donts/ “ I showed how to create a Windows server 2012 nic team. But what can you do with it ?

suppose you have multiple servers running windows server 2012 and they all have 4 10gb Nic’s this is a nice playground.

In my demo I have only 2 1gb nic’s but the samples are the same for any server.

Sample copy with nic teaming

clip_image002

 

What do we need to setup a Windows server 2012 with a hyper-v cluster ( I used the GUI version ) datacenter edition.

We can do the installation with a GUI or by PowerShell. I do a Mix GUI/posh

first we need to have the hyper-v and the Failover cluster feature installed

If you don’t know how to start

go to PowerShell ISE if you want.

or just the plain PowerShell

get-windowsfeature

This will show you a list of all the components you can install or have been installed

clip_image002[6] clip_image004[4] clip_image006[4]

I do not know the name of the feature so I looked it up.

Install-WindowsFeature -Name Failover-Clustering

Install-WindowsFeature –Name Hyper-V -IncludeManagementTools –Restart

I have already done this so no reboot is needed.

Well the TEAM you could do this by GUI or with Posh

clip_image008[4]

One fine tip If you use PowerShell keep your nic names simple no “ local area connection “ 1,2,3,4 etc.  in the GUI you can click but is PowerShell you have to type and I know we are lazy.

Create the Team in PowerShell

New-NetLbfoTeam Team1 NIC1SW1,NIC2SW2 -TeamingMode SwitchIndependent -LoadBalancingAlgorithm HyperVPort -a

clip_image010[4]

the –a is Accept else you get a yes or no .

clip_image012[4]  clip_image014[4]

Now that the team is there We can create a virtual switch that can hold our network adapters

New-VMSwitch “VirtualSwitch” -MinimumBandwidthMode Weight -NetAdapterName “Team01″ -AllowManagementOS 0

-AllowManagementOS 0 means no lan connection

Edit 18-12-2013 So If you do want a network connection use 1

clip_image016[4]

Now We create a virtual nic that connect us to the LAN or management

Add-VMNetworkAdapter -ManagementOS -Name “LAN” -SwitchName “VirtualSwitch”

clip_image018[4]

As You can see the Vnic is added to the adapter list

clip_image020[4] clip_image022[4]

As we compare both adapters you can see that the Team holds only the Virtual switch protocol and the LAN hold an IP Winking smile

But what about QoS yes you will see a lot of different points on the web and all different yes you can set this.

Here is a nice link Microsoft also published some best practices for QoS.

http://technet.microsoft.com/en-us/library/jj735303.aspx

Keep in mind that the Weight off all your nic’s should be 100

Don’t do DCB and Minimum Bandwidth rules on the same NICs, You can set this on every VM if you like or on the adapter. But ask your self do you need this  ?

Live migration network needs the most power.

This is how you set this :  these are just samples test before you set this is IMHO

Set-VMSwitch “VirtualSwitch -DefaultFlowMinimumBandwidthWeight 50

Set-VMNetworkAdapter -ManagementOS -Name “LiveMigration” -MinimumBandwidthWeight 20

Set-VMNetworkAdapter -ManagementOS -Name “CSV” -MinimumBandwidthWeight 50

Set-VMNetworkAdapter -ManagementOS -Name “Management” -MinimumBandwidthWeight 30

I do not set this It is up to you

clip_image024[4]

To create more Adapters it goes like this :

Add-VMNetworkAdapter -ManagementOS -Name “Management” -SwitchName “VirtualSwitch”

Add-VMNetworkAdapter -ManagementOS -Name “LiveMigration” -SwitchName “VirtualSwitch”

Add-VMNetworkAdapter -ManagementOS -Name “CSV” -SwitchName “VirtualSwitch”

And if you want to use a VLAN on these adapter yes you can :

 

Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName “Management” -Access -VlanId 111

Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName “LiveMigration” -Access -VlanId 15

Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName “CSV” -Access -VlanId 11

 

The default value for the -ManagementOS is True. This means that these three interfaces now show up in you

GUI with the names vEthernet (Management), vEthernet (Live Migration) and vEthernet (Cluster).

To separate the traffic between the interfaces we assign each vNIC its own VLAN.

clip_image026[4]

Now that we have set and created the Vswitch and the Vnic’s we can get some info about this config

 

Get-VMNetworkAdapter -ManagementOS -Name * | ft Name, VMName, MinimumBandwidthWeight, BandwidthPercentage, IsManagementOS

Get-Help Set-VMNetworkAdapter -Full

Get-Help Set-VMNetworkAdapterVlan -Full

Get-Help New-VMSwitch -Full

Get-Help Set-VMSwitch –Full

these command should give you a lot of info about these commands

or update-help get all the latest versions.

clip_image028[4]

Get-NetAdapterVmq

Get-NetLbfoTeam

clip_image030[4] clip_image032[4]

clip_image034[4]

Get-VMSwitch |fl *

Now you will get a full list of all the settings

Get-VMNetworkAdapter -ManagementOS

Get-VMNetworkAdapterVlan

Set the IP adress

get-NetIPAddress

Yes but how to set this easy but there are multiple ways. and by gui if you like.

New-NetIPAddress -PrefixLength 8 -InterfaceIndex 68 -IPAddress 12.12.12.12 image

With the above settings you can list all the adapters and find the InterfaceIndex to set the IP adress

clip_image036[4]

Get-VMNetworkAdapter -ManagementOS |where name -eq “csv” |fl *

Or just list one adapter

clip_image038[4] clip_image040[4]

New-NetIPAddress -PrefixLength 8 -InterfaceIndex 68 -IPAddress 12.12.12.12 can set the IP but also this

New-NetIPAddress -InterfaceAlias “vEthernet (nlb01)” -IPAddress 1.1.1.100 -PrefixLength “24″ -DefaultGateway 1.1.1.254

So there are multiple ways to set the IP based on InterfaceAlias or InterfaceIndex

And DNS settings  :  Set-DnsClientServerAddress -InterfaceAlias “vEthernet (nlb01)” -ServerAddresses 8.8.8.8, 4.4.4.4

and if you don’t want a gateway

New-NetIPAddress -InterfaceAlias “iSCSI01″ -IPAddress 192.168.100.11 -PrefixLength “24″

clip_image042[4]   clip_image044[4]  clip_image046[4]

Cluster Creation Using all the Virtual nics

Now that all the network adapters are in place and all the nics have an IP address nicely named we can create our cluster I will do this quickly I created so many post on how to create a windows server 2012 cluster.

http://robertsmit.wordpress.com/2013/01/15/how-to-create-a-new-windows-server-2012-failover-cluster-setup/

Open the FCM I do the Validation a few warnings and yes I know.

clip_image048[4]

Verifying that a node does not have multiple adapters connected to the same subnet.

Adapters vEthernet (LAN) and vEthernet (Management) on node I5NODE02.mvp.local have IP addresses on the same subnet.

Adapters vEthernet (ISCSI02) and vEthernet (ISCSI01) on node I5NODE02.mvp.local have IP addresses on the same subnet.

Adapters vEthernet (NLB02) and vEthernet (NLB01) on node I5NODE02.mvp.local have IP addresses on the same subnet.

I ignore the Warnings for now.

clip_image050[4]  clip_image052[4]

Now that my cluster is ready and I see all the NICs but they are named cluster network 1 to 5 yes you can rename this. And I advice this to do just to find the Nic easily  don’t mesh up the wrong network.

 

clip_image054[4]  clip_image056[4]

just go to the properties of the nic and rename it

clip_image058[4]  clip_image060[4]  clip_image062[5]

One thing left configure your live migration settings.

If you look at the VM network adapter here you can set the Bandwidth.

 

Greetings.

http://robertsmit.wordpress.com

@clustermvp

Posted February 5, 2013 by Robert Smit [MVP] in Windows Cluster, Windows Server 2012

Tagged with

14 responses to “Windows Server 2012 Hyper-V Cluster With NIC Teaming #WS2012 #vswitch

Subscribe to comments with RSS.

  1. Dear Robert,

    Thank you for the reply.

    I have a small request please.

    Could you please send your recent post as word document?
    http://robertsmit.wordpress.com/2013/02/05/windows-server-2012-hyper-v-cluster-with-nic-teaming-ws2012-vswitch/

    The problem is that I am not able to see the screenshots, the ISP provider is blocking the images via proxy :(

    Your help is highly appreciated.

    Thank you and regards,

  2. This is a great walkthrough – thank you!! However, after going through some of it, I realized that I don’t need one of the VMNetworkAdapter devices that I created. Remove-VMNetworkAdapter doesn’t remove it – it just disconnects it from a VM. Is there some way to delete a vEthernet device? In my GUI, the Delete option is disabled.

    • this should also delete the adapter unless you have any connections to the nic. in my lab I showed that is was deleted. but I will look in to it.
      Thanks for the comment.
      I will let you know in a few days. ( sry )

      • Robert,

        Great post! Thanks for sharing. I also am trying to remove an wanted NIC. The GUI is grayed out as well. The remove-vmnetworkadpater fails as well.

  3. Pingback: Microsoft Most Valuable Professional (MVP) – Best Posts of the Week around Windows Server, Exchange, SystemCenter and more – #15 - Flo's Datacenter Report

  4. Pingback: Dell Community

  5. Pingback: Microsoft Most Valuable Professional (MVP) – Best Posts of the Week around Windows Server, Exchange, SystemCenter and more – #15 - Dell TechCenter - TechCenter - Dell Community

  6. Pingback: Microsoft Most Valuable Professional (MVP) – Best Posts of the Week around Windows Server, Exchange, SystemCenter and more – #15 | ServerGround.net

  7. Pingback: Server King » Dell’s Digest for February 11, 2013

  8. Pingback: Hyper-V King

  9. Hi Robert , Thanks for these helpful articles,
    Can you tell me in windows server 2012 hyper-v how to map a Physical NIC(pnic) to a virtual NIC(vnic) , is there any way or powershell commands to find this?

  10. in this blog post all the physical nics are teams and on top of them are vnics so this is the way to connect them.

  11. Hi – followed your article. Setup a team, added vswitch then added seperate virtual network adapters tagged for management, livemigration, storage etc using vlan tagging. All semed ok, but I found that none of those adapters could talk to real world, including my management connection.
    I recreated the vswitch, but with the -AllowManagementOS value set to 1 instead of 0 stated above. Everything started working as desired.
    So i wondered why you were isolating the switch and therefore the virtual adapters from the host OS, when in fact its the host OS that needs to use those adapters?

    • Thanks for pointing me to this, I have several environments and I do not want that all vm’s can talk to the host.
      So my environment is based on several Hyper-v clusters in a separate domain and the Running VM’s are in a different domain. The goal of the post is showing you how to create the Vswitch / networks.

      I checked the post again and there is a line -AllowManagementOS 0 means no lan connection ;-)
      So if you do want LAN put this to 1

      It is now there.

      Now that the team is there We can create a virtual switch that can hold our network adapters

      New-VMSwitch “VirtualSwitch” -MinimumBandwidthMode Weight -NetAdapterName “Team01″ -AllowManagementOS 0

      -AllowManagementOS 0 means no lan connection

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

  • Now Reading

    Microsoft Windows Server 2012 Dynamic Access Control
  • Follow

    Get every new post delivered to your Inbox.

    Join 1,090 other followers

    %d bloggers like this: