VMware {code} Community
ms22006
Contributor
Contributor

Changning VLANs in the Virtual Switch

Hello,

i'm using VMware ESXi 7 on my physical server with 1 active VM with 5 ISP routers that connected to my physical cisco switch. and everything is configured with the virtual switch in VMware.

i also have web dashboard that i want from there to change between VLANs for the specific active VM.

so i'm looking to create api integration to switch between VLANs from my web dashboard.

is it possible? if yes, please share the API documentation with changing VLANs command.

hope everything is clear.

thank you. 

 

0 Kudos
1 Reply
doskiran
Enthusiast
Enthusiast

Use vCLI(vSphere Command-Line Interface) to change vLAN on a particular portgroup in a vSwitch on the standalone ESXi host.
 
Eg: 
> esxcli network vswitch standard portgroup set --portgroup-name=<port_group> --vlan-id=<VLAN ID> 
or 
> vicfg-vswitch.pl --pg <port_group> --vlan <VLAN ID> 
 
Reference:

 

0 Kudos