<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article Nic Teaming Policy in VMware PowerCLI Documents</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Nic-Teaming-Policy/ta-p/2778297</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have another question based on the example of adding a virtual switch.&amp;nbsp;&amp;nbsp; What if you also wanted to set the nicTeaming policy of the vSwitch to&amp;nbsp; loadbalance_ip&amp;nbsp; and network failover detection to Link Status Only?&amp;nbsp; I&amp;nbsp; see that those properities are under HostNetworkPolicy, but I'm not sure&amp;nbsp; how you would use that to add that information to this.&amp;nbsp; I'm probably&amp;nbsp; just making this a lot harder than it actually is.&lt;BR /&gt; &lt;BR /&gt; $HS = Find-EntityView -ViewType "HostSystem" &lt;BR /&gt; $nwSys = $HS.ConfigManager.NetworkSystem &lt;BR /&gt; $mor = Get-View -MoRef $nwSys &lt;BR /&gt; $networkConfig = New-Object Vmware.Vim.HostNetworkConfig &lt;BR /&gt; $vswtch = New-Object VMware.Vim.HostVirtualSwitchConfig &lt;BR /&gt; $networkConfig.vswitch = @($vswtch) &lt;BR /&gt; $networkConfig.vswitch[0].name = "SwitchName" &lt;BR /&gt; $spec = New-Object Vmware.Vim.HostVirtualSwitchSpec &lt;BR /&gt; $spec.numPorts = 1 &lt;BR /&gt; $portgrp = New-Object VMware.Vim.HostPortGroupConfig &lt;BR /&gt; $networkConfig.portgroup = @($portgrp) &lt;BR /&gt; $portgropspec = New-Object VMware.Vim.HostPortGroupSpec &lt;BR /&gt; $portgropspec.vswitchName = "SwitchName" &lt;BR /&gt; $portgropspec.Name = "SwitchNamePort" &lt;BR /&gt; $portgropspec.Policy = New-Object VMware.Vim.HostNetworkPolicy &lt;BR /&gt; $networkConfig.vswitch[0].spec = $spec &lt;BR /&gt; $networkConfig.portgroup[0].spec = $portgropspec &lt;BR /&gt; $mor.AddVirtualSwitch("SwitchName",$spec ) $mor.AddPortGroup($portgropspec)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,Jaime&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;As you probably know NIC teaming can be defined on the switch and on the portgroup.&lt;BR /&gt; This example shows how it is done on a portgroup like you asked.&lt;BR /&gt; I left out the vSwitch objects and method so as not confuse you.&lt;BR /&gt; &lt;BR /&gt;&lt;/P&gt;&lt;PRE class="jive-pre"&gt;&lt;CODE class="jive-code jive-java"&gt;&lt;SPAN style="color: navy;"&gt;{&lt;/SPAN&gt;noformat&lt;SPAN style="color: navy;"&gt;}&lt;/SPAN&gt;&lt;BR /&gt;$HS = Get-View -ViewType &lt;SPAN style="color: red;"&gt;"HostSystem"&lt;/SPAN&gt; -Filter @&lt;SPAN style="color: navy;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: red;"&gt;"Name"&lt;/SPAN&gt; = &amp;lt;ESX-name&amp;gt;&lt;SPAN style="color: navy;"&gt;}&lt;/SPAN&gt;&lt;BR /&gt;$nwSys = $HS.ConfigManager.NetworkSystem&lt;BR /&gt;$mor = Get-View $nwSys&lt;BR /&gt; &lt;BR /&gt;$portgropspec = New-Object VMware.Vim.HostPortGroupSpec&lt;BR /&gt;$portgropspec.vswitchName = &amp;lt;vswitch-name&amp;gt;&lt;BR /&gt;$portgropspec.Name = &amp;lt;portgroup-name&amp;gt;&lt;BR /&gt; &lt;BR /&gt;$portgropspec.Policy = New-Object VMware.Vim.HostNetworkPolicy&lt;BR /&gt; &lt;BR /&gt;$portgropspec.Policy.NicTeaming = New-Object VMware.Vim.HostNicTeamingPolicy&lt;BR /&gt;$portgropspec.Policy.NicTeaming.failureCriteria = New-Object VMware.Vim.HostNicFailureCriteria&lt;BR /&gt;$portgropspec.Policy.NicTeaming.failureCriteria.checkBeacon = $false&lt;BR /&gt;$portgropspec.Policy.NicTeaming.failureCriteria.checkDuplex = $false&lt;BR /&gt;$portgropspec.Policy.NicTeaming.failureCriteria.checkErrorPercent = $false&lt;BR /&gt; &lt;BR /&gt;$portgropspec.Policy.NicTeaming.nicOrder = New-Object VMware.Vim.HostNicOrderPolicy&lt;BR /&gt;$portgropspec.Policy.NicTeaming.nicOrder.activeNic = @(&amp;lt;NIC1-name&amp;gt;)&lt;BR /&gt;$portgropspec.Policy.NicTeaming.nicOrder.standbyNic = @(&amp;lt;NIC2-name&amp;gt;)&lt;BR /&gt;$portgropspec.Policy.NicTeaming.policy = &lt;SPAN style="color: red;"&gt;"loadbalance_ip"&lt;/SPAN&gt;&lt;BR /&gt; &lt;BR /&gt;$mor.AddPortGroup($portgropspec)&lt;BR /&gt;&lt;SPAN style="color: navy;"&gt;{&lt;/SPAN&gt;noformat&lt;SPAN style="color: navy;"&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note1: in v1 of the VITK the functionality of the Find-EntityView cmdlet has been replaced by the Get-View cmdlet&lt;BR /&gt; Note2: for &amp;lt;vswitch-name&amp;gt; you use the name of an existing switch&lt;BR /&gt; Note3: "Link Status Only" is the default setting. All flags in the failureCriteria object are set to $false&lt;BR /&gt; Note4: for NIC1-name and NIC2-name you use 2 NICs that are already allocated to the vswitch&lt;BR /&gt; Note5: the choice for Active-Active or Active-Standby is up to you. If&amp;nbsp; you place the 2 NICs in the activeNic array , as&amp;nbsp; @(&amp;lt;NIC1-name&amp;gt;,&amp;lt;NIC2-name&amp;gt;), you will have Active-Active&amp;nbsp; teaming.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;Awesome, thanks for helping me out again.&amp;nbsp; I am using v1 so I have been&amp;nbsp; using the Get-View cmlet.&amp;nbsp; I just copied the example from the FAQ page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jaime&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This document was generated from the following thread: &lt;A _jive_internal="true" href="https://communities.vmware.com/thread/163401"&gt;Nic Teaming Policy&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Aug 2008 15:30:44 GMT</pubDate>
    <dc:creator>dmitrif</dc:creator>
    <dc:date>2008-08-18T15:30:44Z</dc:date>
    <item>
      <title>Nic Teaming Policy</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Nic-Teaming-Policy/ta-p/2778297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have another question based on the example of adding a virtual switch.&amp;nbsp;&amp;nbsp; What if you also wanted to set the nicTeaming policy of the vSwitch to&amp;nbsp; loadbalance_ip&amp;nbsp; and network failover detection to Link Status Only?&amp;nbsp; I&amp;nbsp; see that those properities are under HostNetworkPolicy, but I'm not sure&amp;nbsp; how you would use that to add that information to this.&amp;nbsp; I'm probably&amp;nbsp; just making this a lot harder than it actually is.&lt;BR /&gt; &lt;BR /&gt; $HS = Find-EntityView -ViewType "HostSystem" &lt;BR /&gt; $nwSys = $HS.ConfigManager.NetworkSystem &lt;BR /&gt; $mor = Get-View -MoRef $nwSys &lt;BR /&gt; $networkConfig = New-Object Vmware.Vim.HostNetworkConfig &lt;BR /&gt; $vswtch = New-Object VMware.Vim.HostVirtualSwitchConfig &lt;BR /&gt; $networkConfig.vswitch = @($vswtch) &lt;BR /&gt; $networkConfig.vswitch[0].name = "SwitchName" &lt;BR /&gt; $spec = New-Object Vmware.Vim.HostVirtualSwitchSpec &lt;BR /&gt; $spec.numPorts = 1 &lt;BR /&gt; $portgrp = New-Object VMware.Vim.HostPortGroupConfig &lt;BR /&gt; $networkConfig.portgroup = @($portgrp) &lt;BR /&gt; $portgropspec = New-Object VMware.Vim.HostPortGroupSpec &lt;BR /&gt; $portgropspec.vswitchName = "SwitchName" &lt;BR /&gt; $portgropspec.Name = "SwitchNamePort" &lt;BR /&gt; $portgropspec.Policy = New-Object VMware.Vim.HostNetworkPolicy &lt;BR /&gt; $networkConfig.vswitch[0].spec = $spec &lt;BR /&gt; $networkConfig.portgroup[0].spec = $portgropspec &lt;BR /&gt; $mor.AddVirtualSwitch("SwitchName",$spec ) $mor.AddPortGroup($portgropspec)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,Jaime&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;As you probably know NIC teaming can be defined on the switch and on the portgroup.&lt;BR /&gt; This example shows how it is done on a portgroup like you asked.&lt;BR /&gt; I left out the vSwitch objects and method so as not confuse you.&lt;BR /&gt; &lt;BR /&gt;&lt;/P&gt;&lt;PRE class="jive-pre"&gt;&lt;CODE class="jive-code jive-java"&gt;&lt;SPAN style="color: navy;"&gt;{&lt;/SPAN&gt;noformat&lt;SPAN style="color: navy;"&gt;}&lt;/SPAN&gt;&lt;BR /&gt;$HS = Get-View -ViewType &lt;SPAN style="color: red;"&gt;"HostSystem"&lt;/SPAN&gt; -Filter @&lt;SPAN style="color: navy;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: red;"&gt;"Name"&lt;/SPAN&gt; = &amp;lt;ESX-name&amp;gt;&lt;SPAN style="color: navy;"&gt;}&lt;/SPAN&gt;&lt;BR /&gt;$nwSys = $HS.ConfigManager.NetworkSystem&lt;BR /&gt;$mor = Get-View $nwSys&lt;BR /&gt; &lt;BR /&gt;$portgropspec = New-Object VMware.Vim.HostPortGroupSpec&lt;BR /&gt;$portgropspec.vswitchName = &amp;lt;vswitch-name&amp;gt;&lt;BR /&gt;$portgropspec.Name = &amp;lt;portgroup-name&amp;gt;&lt;BR /&gt; &lt;BR /&gt;$portgropspec.Policy = New-Object VMware.Vim.HostNetworkPolicy&lt;BR /&gt; &lt;BR /&gt;$portgropspec.Policy.NicTeaming = New-Object VMware.Vim.HostNicTeamingPolicy&lt;BR /&gt;$portgropspec.Policy.NicTeaming.failureCriteria = New-Object VMware.Vim.HostNicFailureCriteria&lt;BR /&gt;$portgropspec.Policy.NicTeaming.failureCriteria.checkBeacon = $false&lt;BR /&gt;$portgropspec.Policy.NicTeaming.failureCriteria.checkDuplex = $false&lt;BR /&gt;$portgropspec.Policy.NicTeaming.failureCriteria.checkErrorPercent = $false&lt;BR /&gt; &lt;BR /&gt;$portgropspec.Policy.NicTeaming.nicOrder = New-Object VMware.Vim.HostNicOrderPolicy&lt;BR /&gt;$portgropspec.Policy.NicTeaming.nicOrder.activeNic = @(&amp;lt;NIC1-name&amp;gt;)&lt;BR /&gt;$portgropspec.Policy.NicTeaming.nicOrder.standbyNic = @(&amp;lt;NIC2-name&amp;gt;)&lt;BR /&gt;$portgropspec.Policy.NicTeaming.policy = &lt;SPAN style="color: red;"&gt;"loadbalance_ip"&lt;/SPAN&gt;&lt;BR /&gt; &lt;BR /&gt;$mor.AddPortGroup($portgropspec)&lt;BR /&gt;&lt;SPAN style="color: navy;"&gt;{&lt;/SPAN&gt;noformat&lt;SPAN style="color: navy;"&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note1: in v1 of the VITK the functionality of the Find-EntityView cmdlet has been replaced by the Get-View cmdlet&lt;BR /&gt; Note2: for &amp;lt;vswitch-name&amp;gt; you use the name of an existing switch&lt;BR /&gt; Note3: "Link Status Only" is the default setting. All flags in the failureCriteria object are set to $false&lt;BR /&gt; Note4: for NIC1-name and NIC2-name you use 2 NICs that are already allocated to the vswitch&lt;BR /&gt; Note5: the choice for Active-Active or Active-Standby is up to you. If&amp;nbsp; you place the 2 NICs in the activeNic array , as&amp;nbsp; @(&amp;lt;NIC1-name&amp;gt;,&amp;lt;NIC2-name&amp;gt;), you will have Active-Active&amp;nbsp; teaming.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;Awesome, thanks for helping me out again.&amp;nbsp; I am using v1 so I have been&amp;nbsp; using the Get-View cmlet.&amp;nbsp; I just copied the example from the FAQ page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jaime&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This document was generated from the following thread: &lt;A _jive_internal="true" href="https://communities.vmware.com/thread/163401"&gt;Nic Teaming Policy&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2008 15:30:44 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Documents/Nic-Teaming-Policy/ta-p/2778297</guid>
      <dc:creator>dmitrif</dc:creator>
      <dc:date>2008-08-18T15:30:44Z</dc:date>
    </item>
  </channel>
</rss>

