

We can use the command Get-VMHost | Get-VirtualSwitch -name vSwitch3 | New-VirtualPortGroup -Name Application33 -VLanID 33. We are setting a port group which is on a switch, which is on a host. In order to do this, think about the progression of the command in PowerCLI. We’re going to create a new port group called Servers, on VLAN 33. In this case, we are going to want to use the New-VirtualPortGroup PowerCLI command since we are using a standard vSwitch. We can use Get-VICommand *portgroup to find out what we have available to us. Now, we need to create some virtual port groups for our switch. While creating a switch with the New-VirtualSwitch command is a great start, we are going to need more than that connect virtual machines to the vSwitch. The output tells us our switch has been created, and we can confirm it in vCenter. Once again, PowerCLI is nice enough to tell us we really do not need to bother with the number of ports on vSphere 5.5 and later. To create vSwitch3 using vmnics 3 and 4 and enabling jumbo frames we can type New-VirtualSwitch -VMHost -Name vSwitch3 -NumPorts 64 -nic vmnic4,vmnic5 -mtu 9000. Luckily, we have all the information we need to use the New-VirtualSwitch command to create a new vSwitch on our host,. The output of Get-Help New-VirtualSwitch tells us exactly the information we need to create our new Standard vSwitch. It is simple to find out the syntax for this command by using the get-help feature. This command will create a new Standard vSwitch for us. When we look at all of the vSphere switch commands we can use within PowerCLI by typing Get-VICommand *switch, we will see some commands prefixed with New and Set.īefore we can set a virtual switch, we first need to create it by using the New-VirtualSwitch command. Summary of vSphere Switch Standard PowerCLI Commands.
