Hello!
I have a vSphere vCenter VM running Windows 2008 R2 that is hosting many VMs of varying OSs on several different network VLANs (100, 200, 300, etc). I would like to be able to run a command from a guest VM running Red Hat Enterprise Linux 6.5 to tell vCenter to switch the network adapter settings from one VLAN to another and back again. I have done a lot of investigating, but I have been unable to figure out a way to do it. The closest thing I have found to what I am looking for are the commands below, but they are not working.
vmrun -T vc -h 192.168.0.3 -P443 -gu <guestusername> -gp <guestpassword> readVariable "[Datastore Name] RHEL 6.5/RHEL 6.5.vmx" runtimeConfig ethernet0.vnet /dev/vmnet0
vmrun -T vc -h 192.168.0.3 -P443 -gu <guestusername> -gp <guestpassword> writeVariable "[Datastore Name] RHEL 6.5/RHEL 6.5.vmx" runtimeConfig ethernet0.vnet /dev/vmnet1
The readVariable command appears to execute successfully, but produces 0 bytes of data, and the writeVariable command gives an error stating that the operation is not supported. Is vmrun able to perform a switch between a VM's network connections or am I going to need to use a different approach? The reason I need to have a command to run instead of simply going into the guest VM's setting in vCenter and selecting the custom network from the drop down is so that the development and testing team can execute a script at will instead of being given administrative privileges.