Link to home
Start Free TrialLog in
Avatar of erlythornton
erlythornton

asked on

Is there a VMware Web Services API command to change the VLAN assigned to a Virtual Nic on a Virtual Machine in VMware

Hello,

I am looking for a way to change the Virtual LAN that is assigned to a Virtual Network card in a Virtual Machine.  Currently we are starting up our VMs from templates that already have a NIC card assigned to a Virtual LAN.  There are however multiple LANs available in VCenter.  I am looking to see if there ia a command available in the Web Services SDK for VMware where I can dynamically instruct the Virtual Machine I started from that template to change the LAN it's Nic card is attached to.    If not the Web Services API is there another solution where this can be done?
Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Flag of United Kingdom of Great Britain and Northern Ireland image

vSphere Web Access to Virtual Center, allows control of virtual machines, but unfortunately it does not allow you to change network interface network.

The same is also true of vCenter Mobile Access, that does not require vSphere vCenter but does require vCMA.

This is probably possible in using PowerCLI scripts.
Avatar of erlythornton
erlythornton

ASKER

Can you elaborate on the PowerCLI scripts?  Can you point me to the reference to this type or similar type of action and perhaps some example code?
ASKER CERTIFIED SOLUTION
Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Using PowerCLI, PowerGUI and the VMware Community Pack you can change the Network the Virtual Machine is connected to, just needed to browse around.

You select the Virtual Machine, Links, Network Adaptors, Change Properties.

 User generated image
So if you install the above, and connect to vSphere vCenter, you will be able to complete this with no development time.