VMware vCloud

 View Only
  • 1.  Instantiate vApp error: (400) Bad Request [SOLVED]

    Posted Feb 02, 2011 07:29 PM

    I am attempting to instantiate a vApp from a template, and I am getting a 400 error. I am basically cutting and pasting the example code from the programming guide, and changing out the URIs and names. Details are below, but I changed the names/IDs for security purposes.

    POST https://VCD/api/v1.0/vdc/12345/action/instantiateVAppTemplate

    Content-Type: application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml

    <InstantiateVAppTemplateParams name="Jake Test" xmlns="http://www.vmware.com/vcloud/v1" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" >
    <Description>Test Instantiate</Description>
    <InstantiationParams>
    <NetworkConfigSection>
    <ovf:Info>Configuration parameters for vAppNetwork</ovf:Info>
    <NetworkConfig networkName = "isolation">
    <Configuration>
    <ParentNetwork href="https://VCD/api/v1.0/network/12345"/>
    <FenceMode>bridged</FenceMode>
    </Configuration>
    </NetworkConfig>
    </NetworkConfigSection>
    </InstantiationParams>
    </InstantiateVAppTemplateParams>


  • 2.  RE: Instantiate vApp error: (400) Bad Request [SOLVED]

    Broadcom Employee
    Posted Feb 02, 2011 07:48 PM

    Hi,

    Can you post some more details about the returned error - error message, stack trace (if available)?

    Regards,

    Todor



  • 3.  RE: Instantiate vApp error: (400) Bad Request [SOLVED]

    Posted Feb 02, 2011 08:38 PM

    Here's the error message:

    "The remote server returned an error: (400) Bad Request."

    That's the only info I have, unless you can tell me how to enable tracing for system.net.webrequest in powershell...

    All of my other POSTs work fine, so I am guessing it is a problem with the XML...



  • 4.  RE: Instantiate vApp error: (400) Bad Request [SOLVED]

    Broadcom Employee
    Posted Feb 02, 2011 08:43 PM

    Can you look into <cloud_dir>/logs/container-debug.log to see for any errors which occurred in the same timeframe?



  • 5.  RE: Instantiate vApp error: (400) Bad Request [SOLVED]

    Posted Feb 02, 2011 09:22 PM

    vcloud-container-debug.log has a few of these:

    ...

    [org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'deploy'. One of '{"http://www.vmware.com/vcloud/v1":VAppParent, "http://www.vmware.com/vcloud/v1":InstantiationParams, "http://www.vmware.com/vcloud/v1":Source}' is expected.]

    ...

    Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'deploy'. One of '{"http://www.vmware.com/vcloud/v1":VAppParent, "http://www.vmware.com/vcloud/v1":InstantiationParams, "http://www.vmware.com/vcloud/v1":Source}' is expected.

    Let me know if this is enough, or if you need the full trace.



  • 6.  RE: Instantiate vApp error: (400) Bad Request [SOLVED]

    Broadcom Employee
    Posted Feb 02, 2011 09:52 PM

    Do you have a <deploy> element in your request? You should not have one as the error describes.. Also, in the request you sent in your first post, there's no deploy element.



  • 7.  RE: Instantiate vApp error: (400) Bad Request [SOLVED]

    Posted Feb 02, 2011 10:02 PM

    According to the Programming guide:

    deploy 0 1 xs:boolean True if the vApp should be deployed after
    instantiation. Defaults to false

    Regardless, I have tried it both ways, with and without the deploy element.



  • 8.  RE: Instantiate vApp error: (400) Bad Request [SOLVED]

    Broadcom Employee
    Posted Feb 02, 2011 10:06 PM

    'deploy' is an attribute of the <InstantiateVAppTemplateParams> element, not an element. Do you get the same error when you remove 'deploy'?



  • 9.  RE: Instantiate vApp error: (400) Bad Request [SOLVED]

    Posted Feb 03, 2011 02:55 PM

    So, my code was a little different than what I originally posted, and it did have the deploy element.

    Just to get all the XML stuff out of the way, I did a validation against the XSD, and it found 2 problems. :smileygrin:

    After fixing those, I received another 400 error stating that the creation of this vApp would violate the disk quota. Fixed that too. (Figured out how to turn on System.Net Tracing for powershell! :smileygrin:)

    Now when I try to Instantiate the vApp template, I am getting a 400 error telling me that: "The vCD entity network "internet02" specified for VM "jeos" does not exist."

    Now, I am unsure what to do about this, because the network does in fact exist, and other VMs are running on it just fine. Just to make sure I wasn't crazy, I tried another template with another netowork and it did the same thing.



  • 10.  RE: Instantiate vApp error: (400) Bad Request [SOLVED]

    Posted Feb 03, 2011 07:56 PM

    Okay, I figured it out. The networkName has to match the name of the org network in the vApp Template. Cloned successfully!