Protected Network|Powershell

Hi, folks!

Protected Network is turned on by default for every VMs in 2012 R2. To control this option you can use GUI and Powershell.

It’s very simple to find “switch” in GUI,

hv_protected_1

but you may be a little bit confused during searching “protected network” value in powershell.

For example,

PS C:\Windows\system32> Get-VM -VMName SC_VMMR2|Get-VMNetworkAdapter|fl *


IovWeight                : 0
IovQueuePairsRequested   : 1
IovQueuePairsAssigned    :
IovInterruptModeration   : Default
IovUsage                 :
ClusterMonitored         : True
VirtualFunction          :
IsLegacy                 : False
IsManagementOs           : False
IsExternalAdapter        : False
Id                       : Microsoft:1A5B79A6-EDCA-47A0-B023-E21139DFDB96\AE7DB00D-E40F-4FE2-ABA3-C57C1EB7A081
AdapterId                :
DynamicMacAddressEnabled : True
MacAddress               : 00155D191E06
MacAddressSpoofing       : Off
SwitchId                 :
Connected                : False
PoolName                 : Primordial
SwitchName               :
AclList                  : {}
ExtendedAclList          : {}
IsolationSetting         : Microsoft.HyperV.PowerShell.VMNetworkAdapterIsolationSetting
CurrentIsolationMode     : Vlan
RoutingDomainList        : {}
DhcpGuard                : Off
RouterGuard              : Off
PortMirroringMode        : None
IeeePriorityTag          : Off
VirtualSubnetId          : 0
DynamicIPAddressLimit    : 0
StormLimit               : 0
AllowTeaming             : Off
VMQWeight                : 100
IPsecOffloadMaxSA        : 512
VmqUsage                 :
IPsecOffloadSAUsage      :
VFDataPathActive         : False
VMQueue                  :
MandatoryFeatureId       : {}
MandatoryFeatureName     : {}
VlanSetting              : Microsoft.HyperV.PowerShell.VMNetworkAdapterVlanSetting
BandwidthSetting         :
BandwidthPercentage      : 0
TestReplicaPoolName      :
TestReplicaSwitchName    :
StatusDescription        :
Status                   :
IPAddresses              : {}
ComputerName             : HV01
Name                     : Network Adapter
IsDeleted                : False
VMId                     : 1a5b79a6-edca-47a0-b023-e21139dfdb96
VMName                   : SC_VMMR2
VMSnapshotId             : 00000000-0000-0000-0000-000000000000
VMSnapshotName           :
Key                      :

Err..where is the value for Protected Network?Улыбка

Ok. Let’s begin from what is really protected network (PN). PN adds to Hyper-V  Cluster an ability to monitor a network health for every vNICs and moves VMs to another Hyper-V node if a network disconnection is detected. = it’s a really cluster monitoring option.

To change settings of vNICs we have to use Set-VMNetworkAdapter cmdlet:

I’m dummy and want to get some help:

Get-Help Set-VMNetworkAdapter -Detailed

..

 -NotMonitoredInCluster <bool>

..

hmm..is it what we are looking for?

Let’s try to apply some changes.

Get-VM -VMName SC_VMMR2|Set-VMNetworkAdapter -NotMonitoredInCluster $True

Get-VM -VMName SC_VMMR2| Get-VMNetworkAdapter|fl *

..
ClusterMonitored         : False
..

Check in GUI:

hv_protected_2

And finally we found what we wanted.

Sometimes (err..I mean always) we need to really understand what this feature provides and how it works.

Links:

http://blogs.msdn.com/b/virtual_pc_guy/archive/2014/03/11/protected-networks-in-windows-server-2012-r2.aspx

Hyper-V host crashes and has bug checks when you perform a VM live migration in Windows 8.1 and Windows Server 2012 R2

Microsoft has released the most important KB for Hyper-V related with VMQ,LBFO and LM

Consider the following scenario:

  • You have a Windows Server 2012 R2-based computer that is configured for one or more NIC teams by using Windows NIC Teaming (LBFO).
  • You have implemented Windows NIC Teaming (LBFO) in Switch Independent teaming mode by using Hyper-V Port or Dynamic Load Balancing mode. Additionally, you have correctly configured the NICs to use non-overlapping processors. (For more information, see Knowledge Base article 2974384).
  • A Hyper-V virtual switch is bound to one of the LBFO teams.
  • You start a virtual machine on the Hyper-V server, or you live migrate a virtual machine from one server to another server.

In this scenario, you experience one or more of the following issues:

Log Name: System
Source: Microsoft-Windows-Hyper-V-VmSwitch
Date: <DateTime> 
Event ID: 113
Task Category: None
Level: Error
Keywords:
User: SYSTEM
Computer: Server1.contoso.com
Description:
Failed to allocate VMQ for NIC EDCED345-4C96-4C75-92A0-0C4FC5688F73--35BEB899-5BE9-4128-900A-6FE0BBFC7B22
(Friendly Name: Network Adapter) on switch DE4F3664-68D9-4781-825B-882A540FAB08 (Friendly Name: VM Switch).
Reason - The OID failed. Status = {Operation Failed} The requested operation was unsuccessful.

Additionally, the Hyper-V VmSwitch may fail to allocate VMQ queues for virtual machines.

+ This KB solves the problem described here

Download