I think it has to do w/ the way you are defining your physical adapters. You are capturing them as strings, but the Set-TeamingPolicy "MakeNicActive" and "MakeNicUnused" are looking for physical nic objects.
#Get the vmnics for setting Active & Unused for each Portgroup
$vmkAct = Read-Host "
Enter Active Nic for $vmk teaming policy (vmnic#) "
$vmkAct = Get-VMhostNetworkAdapter -Name $vmkAct
$vmkUnused = Read-Host "
Enter Unused Nic for $vmk teamng policy (vmnic#) "
$vmkUnused = Get-VMhostNetworkAdapter -Name $vmkUnused
Hi Chris -
Thanks for the response. I actually thought that exact same thing. I did test an 'explicit' pNic assignment with no luck. I call all my pNics earlier in my script this way:
$esxNics = Get-VMHostNetworkAdapter -VMhost $esxHost -Physical
Then to test an 'explicit' pNic assignment, I did this script:
Get-VirtualPortgroup -Name $vmk | Get-NicTeamingPolicy | Set-NicTeamingPolicy -InheritFailoverOrder $false -MakeNicActive $esxNics -MakeNicUnused $esxNics
...still didn't work.
The reason I need to kind of do my script the way I'm doing it is because of how iSCSI pNic assignment and iSCSI Teaming works - only 1 Active pNic can be assigned to the PG, with all others marked as Unused.
The issue isn't syntax or anything like that with my script. The issue has to be I think, as we both think... something in how you call and/or assign the Nics. I just don't know what that "rule" is. And it isn't documented anywhere that I've searched, including VMware 'Code" and PCLI docs. Ugh. Well.. even though I tried that yesterday. Think I'll try it again and see. If you have any idea how to modify my script to assign an explicit pNic as Active on a PG and other Inactive, let me know.
Ok, so I ended up figuring out how to do this. When setting pNics as 'Active', 'Standby', or 'Unused', you do NOT need to do an explicit call to the parameter "-InhertitedFailoverOrder". All you need to do is an explicit call to the Nic types you want: -MakeNicActive -MakeNicStandby or -MakeNicUnused . The 'Inherit Failover Order' policy setting will get changed automatically when setting the pNics on the PG. So to state how I resolved this, I still used my original code, but simply removed the -InheritedFailoverOrder parameter and voila! It worked! Thanks Chris for chiming in. Much appreciated.