For When You Can't Have The Real Thing
[ start | index | login ]
start > VMware > ESXi > 6.0 > vCLI > Port Groups

Port Groups

Created by dave. Last edited by dave, 7 years and 59 days ago. Viewed 1,898 times. #1
[edit] [rdf]
labels
attachments
(2017-02-27)

Port Groups using vCLI

export VI_SERVER=vcenter.domain.local
for i in 0 1 2 3 4 5 6; do
  esxcli --vihost esxihost-0$i network vswitch standard portgroup list
done

If you can do that, you’ll be able to add new VLANs (called “port groups” in the vCLI nomenclature) to vSwitches from the command line, like this:

export VI_SERVER=vcenter.domain.local
for i in 0 1 2 3 4 ; do
  esxcli --vihost esxihost-0$i network vswitch standard portgroup add -v vSwitch2 -p BeerCan-204
  esxcli --vihost esxihost-0$i network vswitch standard portgroup set -p BeerCan-204 -v 204
done
for i in 5 6 ; do
  esxcli --vihost esxihost-0$i network vswitch standard portgroup add -v vSwitch1 -p BeerCan-204
  esxcli --vihost esxihost-0$i network vswitch standard portgroup set -p BeerCan-204 -v 204
done
no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt