Home > vSphere API > Moving Virtual Machine Back From Distributed Virtual Switch

Moving Virtual Machine Back From Distributed Virtual Switch

After blogging about moving virtual machines from a standard virtual switch to a distributed virtual switch, I saw a new question in VI Java API forum on how to roll it back. Technically, I don’t see any reason why one should switch back because using distributed virtual switch gives you a lot of benefits. But the decision is not mine but yours. Whatever you want to do, we help do it easily.

The method involved is still the ReconfigVM_Task() defined with VirtualMachine managed object. The difference comes with the parameter, mainly the backing. When it comes to Web Service API, it’s better to show either code or SOAP message. To me, SOAP message is even better because you can reference it even using toolkit like PowerCLI.

Time to learn how to "Google" and manage your VMware and clouds in a fast and secure


The following is recorded with Onyx. Based on this SOAP request, I think you can easily write code to achieve the same.

<soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <ReconfigVM_Task xmlns="urn:internalvim25">
      <_this xsi:type="ManagedObjectReference" type="VirtualMachine" serverGuid="BA9CE658-75F7-4A99-ACE6-99EB1376B94A">vm-344</_this>
          <device xsi:type="VirtualE1000">
              <label>Network adapter 4</label>
            <backing xsi:type="VirtualEthernetCardNetworkBackingInfo">
              <deviceName>VM Network</deviceName>

  1. Prateek
    June 29th, 2011 at 19:05 | #1

    Hi am trying to use a OVFManagerImportVAppFromUrl.java as a reference to deploy an OVF on my host i.e. ESX 5.0. I am using VIM25 SDK. I am facing this error
    “Server returned HTTP response code: 500 for URL:” This is a I/O exception, Before firing this exception a VM without an Operating system is deployed on host. Could any one tell me what might be the problem.

  2. June 29th, 2011 at 21:21 | #2

    Hi Prateek,

    Where did you get the Java code/sample? Thanks!


  3. amogh
    January 14th, 2013 at 23:44 | #3

    how to get cluster data for eg name,uuid from vcenter?

  4. amogh
    January 14th, 2013 at 23:52 | #4

    i am using vijava.. new to this tool,plz help me

  1. No trackbacks yet.