Hey All,
I'm cloning a VM using the SOAP API. The clone operation completes successfully and Virtual Center as well as the booted VM indicate the network info (IP Address, gateway, netmask, etc) have all been applied properly. The "Network Connection", however, is unspecified in Virtual Center. I have two connections to chose from in Virtual Center and I'm assuming I need to specify one of these in the SOAP request. I don't see anything obvious in the documentation that shows how to do this. Here's the SOAP message I'm sending:
Any help is appreciated!
-jd
I suspect you'd want to change your VirtualEthernetCard.NetworkBackingInfo through the deviceChange property of vm.ConfigSpec. You can find plenty of examples of changing the vswitch uplink to get the code for how it would be done. Or if you post up some code you could probably get some suggestions from the community.
You must add VirtualMachineConfigSpec to add VirtualEthernetCard device, please refer following soap request snippet
<config>
<deviceChange>
<operation>add</operation>
<device xsi:type="VirtualPCNet32">
<key>4</key>
<backing xsi:type="VirtualEthernetCardNetworkBackingInfo">
<deviceName>VM Network</deviceName>
</backing>
<addressType>generated</addressType>
</device>
</deviceChange>
</config>
OK,
I tried this and now I get a "fault.NicSettingMismatch.summary" in Virtual Center. I'm attempting to a clone a vm from a template. The template already has the NIC configured, its just that its not connected when I check the settings of the cloned VM. As such, do I need to add a new device or simply connect the existing one?
Any help is greatly appreciated,
-jd
I've made it a bit further. I'm able to edit the nic, I just can't specify what network to connect it to. My XML follows. It seems like specifying the