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 = @(“esx01.host.local”,”esx02.host.local”,”esx03.host.local”)
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 “192.168.1.0” -VlanID 1 | Get-NicTeamingPolicy | Set-NicTeamingPolicy -InheritFailoverOrder:$true
$vportgroup = New-VirtualPortGroup -VirtualSwitch vswitch0 -Name “192.168.2.0” -VlanID 2 | Get-NicTeamingPolicy | Set-NicTeamingPolicy -InheritFailoverOrder:$true

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

Information

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

Navigation

Follow Virtual Kim on WordPress.com

Blog Stats

  • 26,240 hits
%d bloggers like this: