I got an Exception while instantiating a vApp template through REST, and get a result as "Bad request",Here it is the log:
com.vmware.vcloud.api.presentation.service.BadRequestException: Changing a routed vApp network to bridged mode and changing the parent network of a bridged vApp network, are not supported while instantiating a vApp template with "Identical copy" (CustomizeOnInstantiate=false) selected.
at com.vmware.vcloud.vdc.impl.VdcServiceImpl.renameDirectConnectedVappNetworks(VdcServiceImpl.java:3614)
at com.vmware.vcloud.vdc.impl.VdcServiceImpl.instantiateVApp(VdcServiceImpl.java:3549)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
....
What should I do? Did I have some wrong configuration?
Regard.
Hi,
You cannot change the MAC address before or during instantiation of the vApp.
However, once the vApp is created (instantiated) and before it's deployed, you can change the MAC address for each of its VMs.
This can be done by modifying the networkConnectionSection in each VM using REST API:
PUT https://<host>/api/vApp/<uuid>/networkConnectionSection
Content-Type: application/vnd.vmware.vcloud.networkConnectionSection+xml
Request body:
Regards,
Todor Todorov
Could you try to instantiate with CustomizeOnInstantiate=true?
Where could I get this option?When I create a vApp Template or somewhere else?
There is a property in the GuestCustomizationSection of a vAppTemplate:
This property will be used as a default. But even if it is false in the template you can still customize all VMs in the vApp before Power ON.
To achieve this through the UI you have to go through all VMs in the vApp -> Properties -> Guest OS Customization -> Enable guest customization.
To do this through the API you will have to get the GuestCustomizationSection of each VM and set enabled=true.
I hope that helps.
Hi,
before I build a vApp from a vApp template, can I set up the mac address for each VM.
I mean using rest api.
now, when I deploy a vApp by a template, mac address is genereted automaticlly. I want to control it to the value I input.
can our rest api support this?
regards
Hi,
You cannot change the MAC address before or during instantiation of the vApp.
However, once the vApp is created (instantiated) and before it's deployed, you can change the MAC address for each of its VMs.
This can be done by modifying the networkConnectionSection in each VM using REST API:
PUT https://<host>/api/vApp/<uuid>/networkConnectionSection
Content-Type: application/vnd.vmware.vcloud.networkConnectionSection+xml
Request body:
Regards,
Todor Todorov
I am working with the .NET API, I am trying to create an image, install some software on that image and then save an updated template back into the catalog. I have this working but can't seem to get the new template to have the correct customization settings.
1) I get the CustomizationSectionType from the vappTemplate.
2) I change CustomizeOnInstantiate = true
3) I then call UpdateSection() on the vappTemplate
Error I get is Cannot change value between "Make Identical Copy" and "Customize VM Settings" (for CustomizeOnInstantiate).
This seemed like the logical place to change it but do I need to change it early or is there something else I need to do before changing that option? Even on one of these saved images in the catalog using the UI I can't change the option both options are grayed out.
Thanks
Cary
I'm having the same problem reported by Caryme
I am working with the .NET API, I am trying to create an image, install some software on that image and then save an updated template back into the catalog. I have this working but can't seem to get the new template to have the correct customization settings.
1) I get the CustomizationSectionType from the vappTemplate.
2) I change CustomizeOnInstantiate = true
3) I then call UpdateSection() on the vappTemplate
Error I get is Cannot change value between "Make Identical Copy" and "Customize VM Settings" (for CustomizeOnInstantiate).
This seemed like the logical place to change it but do I need to change it early or is there something else I need to do before changing that option? Even on one of these saved images in the catalog using the UI I can't change the option both options are grayed out.
To me, it happens when I try to change CustomizeOnInstantiate from `true` to `false`
From vCloud 1.5 doc
PUT /vAppTemplate/{id}/customizationSection
You could try to instantiate the vAppTemplate as it is (with powerOn=false and deploy=false) and after that you should be able to change the customization section of the vApp for each VM individually. Then you can deploy and power on the vApp.
Thanks vtodorov,
You could try to instantiate the vAppTemplate as it is (with powerOn=false and deploy=false) and after that you should be able to change the customization section of the vApp for each VM individually. Then you can deploy and power on the vApp.
Looking at the UI there is a note that says:
When creating a vApp from this template: Make Identical copy Customize VM settings
"This setting is applicable during "Add to My Cloud" and "Add from Catalog" operations.
This could be a mistake in the documentation but generally vAppTemplates are read-only. You can change their name and description only.
ok thanks