Tag Archives: Port Group

vmwarevss

Using PowerCLI to create Virtual Machine Port Groups

So basically I had a host failure where all of the configure was lost, if I was more savvy with Powershell/PowerCLI, I would have been able to rebuild it all via scripts, but that clones the settings from a working host.

But nevermind that is for a different day of learning.

So I configured the host to the point of Networking, so the vSwitches had the correct NICs, but I needed to do all the port groups, which in the GUI if you have a few to do is time consuming.

So in PowereCLI, pull all of your information, port-group names and VLAN IDs.

Get-Vmhost -name <FQDN of host> | Get-VirtualSwitch -name  | Get-VirtualPortGroup

2014-11-12_00-07-01

To create a port-group

Get-Vmhost -name <FQDN of host> | Get-VirtualSwitch -Name  | New-VirtualPortgroup -Name "Name of PG" -VlanID
2014-11-13_10-58-47

Obviously this is a very short crude method of achieving what I need, but here you can see the basic building blocks needed to create Port Group in PowerCLI.
Regards

Dean