Virtual Kim

@Kim_Bottu … Virtually Gung Ho

Create a vSwitch using PowerCLI

# NumPorts is not needed anymore in vSphere 5.5, the ports are elastically assigned.
# vmnic0 and vmnic1 are assigned to the vSwitch
# Nic Teaming policy has been set to IPHash.
# Portgroups are set to inherit NIC Teaming policy from the vSwitch.

$vmhost_array = @(“”,””,””)
Foreach ($vmhost in $vmhost_array)
$vswitch0 = New-VirtualSwitch -VMHost $vmhost -Name vSwitch0 -Nic vmnic0,vmnic1 -NumPorts 1016| Get-NicTeamingPolicy | Set-NicTeamingPolicy -LoadBalancingPolicy LoadBalanceIP
$vportgroup = New-VirtualPortGroup -VirtualSwitch vswitch0 -Name “” -VlanID 1 | Get-NicTeamingPolicy | Set-NicTeamingPolicy -InheritFailoverOrder:$true
$vportgroup = New-VirtualPortGroup -VirtualSwitch vswitch0 -Name “” -VlanID 2 | Get-NicTeamingPolicy | Set-NicTeamingPolicy -InheritFailoverOrder:$true

Leave a Reply

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

You are commenting using your 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


This entry was posted on February 18, 2015 by in PowerCLI, Script, vSwitch and tagged , , .


Follow Virtual Kim on

Blog Stats

  • 27,573 hits
%d bloggers like this: