Does anyone have an example of how to change a Vmware vSphere VM's network label (i.e. vlan) from a CLI in Linux?
I've come across VMware's perl SDK, but rather than learn it from scratch and trawl through the dense documentation I was hoping someone may have an example which does the job. Perl wouldn't be my first choice (which also slows me down).
Any help appreciated.
Update: I've come across vmreconfig.pl, which looks like it should do the job, but I haven't seen any example of how it can manage network ports.
After some serious googling, perl bashing and a little despair I hit on this forum post, and in particular of interest, this script.
Usage:
Just the job!
Well it's not the VM's 'network label' that you need to change but the appropriate vSwitch's port group - obviously this will change this name for all VMs that use that port group.
That said I've trawled through the PERL command line reference and cannot find a way to do this at all sorry, only through the GUI. That said I did find in THIS, under the 'Managed Object Type'/'Network' there's a method called 'Rename_Task' - I think that's how they do it via the GUI.
Of course be aware that doing this to a single host will break vMotion/DRS as these require the port groups to be identically named across a cluster.