6 Replies Latest reply on Aug 23, 2016 3:23 AM by VivekShabadi

    Create a new VM within a vApp

    mrudloff Hot Shot

      I can find anything in the documentation about creating a new VM within an existing vApp or creating a new vApp and a new VM within it ..


      Is this at all possible ? 

        • 1. Re: Create a new VM within a vApp
          anniyan Novice

          Yes, you can create new VM within a vApp.



          Recompose a vApp to Add or Remove Virtual Machines
          The vCloud API supports recomposition of a vApp to add or remove virtual machines

          (Vm elements). To recompose a vApp, a client makes a recomposeVApp request,

          supplying a RecomposeVAppParams element as the request body. The

          RecomposeVAppParams element allows an arbitrary number of DeleteItem elements,
          but is otherwise identical to ComposeVAppParams. This means that in addition to

          adding or removing virtual machines, a recomposeVApp request can also change the

          name and description of the vApp, and can supply new InstantiationParams to change

          various sections of the composed vApp or any of the added virtual machines.



          Specify you VM attributes in RecomposeVAppParams->Item->InstantiationParams and call something similar to:


          POST http://vcloud.example.com/api/v1.0/vApp/vapp-33/action/recomposeVApp

          • 2. Re: Create a new VM within a vApp
            Daniel Langenhan Enthusiast

            Code Example


            <RecomposeVAppParams xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" xmlns:environment_1="http://schemas.dmtf.org/ovf/environment/1">
                <SourcedItem sourceDelete="false">
            <Source href="" name="test2"/>
            <NetworkConnectionSection ovf:required="false"> 
            <ovf:Info>Specifies the available VM network connections</ovf:Info>
            <NetworkConnection network="ONet_OSS" needsCustomization="true">
             <NetworkAssignment innerNetwork="PXE BOOT" containerNetwork="ONet_OSS"/>
            • 3. Re: Create a new VM within a vApp
              Todor Todorov Hot Shot
              VMware Employees

              Please note that the Recompose vApp operation allows you to add existing VMs to the vApp, i.e. VMs from other vApps or vApp templates are copied/moved to the target vApp. With the current version of the vCD REST API it's not possible to add a new blank VM to a vApp which is possible through the vCD UI.



              Todor Todorov

              • 4. Re: Create a new VM within a vApp
                tejit2004 Novice



                Currently I am using vmware API vesion 5.1.


                I have already composed a vApp (Not Instantiated) and Now I want to update the vApp by creating Virtual Machines, Document doesn't have proper XML. It's bits and pieces and I am not able to understand.


                Is it possible to create new VMs in the app? If yes then Can you please provide me the entire XML for that? My requirement is to create VMs.



                Tejas Trivedi.

                • 5. Re: Create a new VM within a vApp
                  JigneshKakadiya Novice



                  I am not able to use the same VM(source) template to create multiple VMs in same vApp simultaneously. It give me error "The entity SOURCE_VM_TEMPLATE is busy completing an operation.

                  Can you please give me the idea how can I achieve this since I have only one source VM and cloning multiple times same time in a vApp?




                  • 6. Re: Create a new VM within a vApp
                    VivekShabadi Lurker

                    Hi All,

                    I have the following questions regarding the "Recompose a vApp to Add, Remove, or Reconfigure Virtual Machines".

                    I was searching for an example or sample xml for add/creating a vm in the vapp. The api documentation about "RecomposeVAppParams" doesnt clearly explain creating/adding a new vm to the vapp. Also, what is the purpose of "SourceItem" tag in "RecomposeVAppParams"? Does it act as template for creating new vm? Will the new VM be automatically cloned and added to the vApp? Could you please provide an example for the same?


                    I am referring to the documentation: http://pubs.vmware.com/vcd-810/index.jsp?topic=%2Fcom.vmware.vcloud.api.sp.doc_20_0%2FGUID-4D27F630-43B8-44A4-88E8-4B196714A011.html



                    Vivek Shabadi.