Thursday, 29 March 2018

To add a Vlan in a VMware cluster in 1 line of command

One task as a Vmware admin was to add a network Vlan on the ESXi server you manage.

How are you going to update a cluster with more than 10 server ? Simple way was access the Vcenter and do it 1 by 1 on network config. Really ?

Can we do like a linux machine, update on 1 command and then enter ?

Get friend with the Vsphere CLI , you can do a batch update on a cluster.

Here are command to add a vlan in a Vmware cluster using Vsphere CLI.

Connect-VIServer vcenter01.localnetwork.local
get-cluster -name datacenter01 | Get-VMHost | Get-VirtualSwitch -name “vSwitch1” | New-VirtualPortGroup -Name “Srv.SecureServers” -VLanId “1337”

You will be thankfull with these command.

Yes thank you .

I am a lazy system admin.

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More