Hi everyone,
Using VCD 1.5, initiating a VApp from a Template works fine for me. Adding a VM to an existing empty VApp was a next task, but I tried to recompose the VApp with no success.
I used the RecomposeVAppParams Block from two other Discussions, but it doesn't help either.
The error is the following: message="The VCD entity network "SupportNet" specified for VM "W7-64Test" does not exist." The existing VM in the Source-href is working well and exists in a VAppTemplate. The OrgNetwork "SupportNet" exists too.
While calling the method recomposeVApp I sent the following XML-Body and used an existing VApp, which is completely empty.
<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="https://vcd.iscinternal.com/api/vApp/vm-a1a941a6-c06b-4b89-8e45-5ac6050a345f" name="test2"/>
<InstantiationParams>
<NetworkConnectionSection ovf:required="false">
<ovf:Info>Specifies the available VM network connections</ovf:Info>
<NetworkConnection network="SupportNet" needsCustomization="false">
<NetworkConnectionIndex>0</NetworkConnectionIndex>
<IpAddress>192.168.0.23</IpAddress>
<IsConnected>false</IsConnected>
<IpAddressAllocationMode>MANUAL</IpAddressAllocationMode>
</NetworkConnection>
</NetworkConnectionSection>
</InstantiationParams>
<NetworkAssignment innerNetwork="PXE BOOT" containerNetwork="SupportNet321"/>
</SourcedItem>
</RecomposeVAppParams>
Thanks,
Tom
Hi,
You are missing the primary network connection index.
Refer to this sample XML
<NetworkConnectionSection ovf:required="false">
<ovf:Info>Specifies the available VM network connections</ovf:Info>
<PrimaryNetworkConnectionIndex>0</PrimaryNetworkConnectionIndex>
<NetworkConnection network="direct" needsCustomization="false">
<NetworkConnectionIndex>0</NetworkConnectionIndex>
<IpAddress/>
<IsConnected>true</IsConnected>
<IpAddressAllocationMode>POOL</IpAddressAllocationMode>
</NetworkConnection>
</NetworkConnectionSection>
Regards,
Rajesh Kamal.
Hi,
The request that you sending says,
Add this vm(https://vcd.iscinternal.com/api/vApp/vm-a1a941a6-c06b-4b89-8e45-5ac6050a345f) to my empty vapp.
To the vm's nic you are saying connect to the vapp's network "SupportNet" and not to the org network "SupportNet".
Modify the XML to something like this and try,
<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">
<InstantiationParams>
<NetworkConfigSection>
<ovf:Info>Configuration parameters for logical networks</ovf:Info>
<NetworkConfig networkName="SupportNet">
<Configuration>
<ParentNetwork href="org network SupportNet href" />
<FenceMode>bridged</FenceMode>
</Configuration>
</NetworkConfig>
</NetworkConfigSection>
</InstantiationParams>
<SourcedItem sourceDelete="false">
<Source href="https://vcd.iscinternal.com/api/vApp/vm-a1a941a6-c06b-4b89-8e45-5ac6050a345f" name="test2"/>
<InstantiationParams>
<NetworkConnectionSection ovf:required="false">
<ovf:Info>Specifies the available VM network connections</ovf:Info>
<NetworkConnection network="SupportNet" needsCustomization="false">
<NetworkConnectionIndex>0</NetworkConnectionIndex>
<IpAddress>192.168.0.23</IpAddress>
<IsConnected>false</IsConnected>
<IpAddressAllocationMode>MANUAL</IpAddressAllocationMode>
</NetworkConnection>
</NetworkConnectionSection>
</InstantiationParams>
<NetworkAssignment innerNetwork="PXE BOOT" containerNetwork="SupportNet321"/>
</SourcedItem>
</RecomposeVAppParams>
Now you are saying to create a SupportNet vapp network backed by the SupportNet org network.
The vm now is backed by the SupportNet vapp network.
Regards,
Rajesh Kamal.
Hi Tom,
does your Template VM has an internal Network calle PXE BOOT? If not THATS the error.
in the <NetworkAsssigmnet > inner network = the Network name that the Template VM is using and vApp Network can be the vApp or the OrgNet NAME
Hi,
thanks for your answer. To put the NetworkConfigSection like mentioned above solves this error.
Now there is a new one:
UriUtils | Unable to read property restapi.baseUri from the configuration file. Using primary cell IP.
NetworkConnectionSectionHandler | The primary network connection index was not specified
com.vmware.vcloud.api.presentation.entity.security.OperationDeniedException: This operation is denied.
I checked that it is not depending on user privileges. I have the rights esp. for "Read Customization Specifications" etc.
"SupportNet" is now set in all 4 properties. In conclusion, does these 4 Network Properties mean:
NetworkConfigSection - NetworkConfig networkName="SupportNet" = OrgNetwork used in vApp
NetworkConnectionSection - NetworkConnection network="SupportNet" = vApp Network
NetworkAssignment innerNetwork = vApp Network of VM Template in the original vAppTemplate
NetworkAssignment containerNetwork = OrgNetwork used in vApp (same as NetworkConfigSection)
Thanks,
Tom
Hi,
You are missing the primary network connection index.
Refer to this sample XML
<NetworkConnectionSection ovf:required="false">
<ovf:Info>Specifies the available VM network connections</ovf:Info>
<PrimaryNetworkConnectionIndex>0</PrimaryNetworkConnectionIndex>
<NetworkConnection network="direct" needsCustomization="false">
<NetworkConnectionIndex>0</NetworkConnectionIndex>
<IpAddress/>
<IsConnected>true</IsConnected>
<IpAddressAllocationMode>POOL</IpAddressAllocationMode>
</NetworkConnection>
</NetworkConnectionSection>
Regards,
Rajesh Kamal.
Hi Rajesh,
Your hint works well. But did I run now into an authorization problem?
<code>UriUtils | Unable to read property restapi.baseUri from the configuration file. Using primary cell IP. |
UriUtils | Unable to read property restapi.baseUri from the configuration file. Using primary cell IP. |
JaxRsDispatcherServlet | Successfully completed request |
AuthorizationMethodInterceptor | Authorizing method: public abstract com.vmware.vcloud.api.presentation.entity.vdc.ResourceEntitySpec com.vmware.vcloud.api.presentation.service.VdcService.getResourceEntitySpec(com.vmware.vcloud.api.presentation.entity.common.EntityRef). |
AuthorizationMethodInterceptor | Authorizing method: public abstract com.vmware.vcloud.api.presentation.entity.vapp.VmSpec com.vmware.vcloud.api.presentation.service.VAppService.getVmSpec(com.vmware.vcloud.api.presentation.entity.common.EntityRef). |
VmManagerImpl | CPU units: mhz |
AuthorizationMethodInterceptor | Authorizing method: public abstract com.vmware.vcloud.api.presentation.entity.common.TaskSpec com.vmware.vcloud.api.presentation.service.VdcService.recomposeVApp(com.vmware.vcloud.api.presentation.entity.vdc.ComposeVAppParams). |
VmManagerImpl | CPU units: mhz |
AuthorizationMethodInterceptor | Custom Method: com.vmware.vcloud.vdc.impl.VdcServiceImpl.authorizeRecomposeVApp returned false |
CustomExceptionMapper | REST API CustomExceptionMapper caught following exception |
com.vmware.vcloud.api.presentation.entity.security.OperationDeniedException: This operation is denied.</code>
Thanks,
Tom
Hi,
You login as what kind of a user, Ex: Org admin.
Regards,
Rajesh Kamal.
Hi,
I am a organization admin (system -> role -> organization admin) which has all possible rights enabled. I also tried it with a system admin, but this doesn't work either (same error message in log).
Thanks,
Tom
please post your complete REST request your using ATM.
Hi, this is the complete post:
<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">
<InstantiationParams>
<NetworkConfigSection>
<ovf:Info>Configuration parameters for logical networks</ovf:Info>
<NetworkConfig networkName="SupportNet">
<Configuration>
<ParentNetwork href="link-to-network" />
<FenceMode>bridged</FenceMode>
</Configuration>
</NetworkConfig>
</NetworkConfigSection>
</InstantiationParams>
<SourcedItem sourceDelete="false">
<Source href="link-to-vm" name="test2"/>
<InstantiationParams>
<NetworkConnectionSection ovf:required="false">
<ovf:Info>Specifies the available VM network connections</ovf:Info>
<PrimaryNetworkConnectionIndex>0</PrimaryNetworkConnectionIndex>
<NetworkConnection network="SupportNet" needsCustomization="false">
<NetworkConnectionIndex>0</NetworkConnectionIndex>
<IpAddress>192.168.0.23</IpAddress>
<IsConnected>true</IsConnected>
<IpAddressAllocationMode>MANUAL</IpAddressAllocationMode>
</NetworkConnection>
</NetworkConnectionSection>
</InstantiationParams>
<NetworkAssignment innerNetwork="SupportNet" containerNetwork="SupportNet"/>
</SourcedItem>
</RecomposeVAppParams>
Thanks,
Tom
So..after a quick look the first <InstantiationParams> is not needed. You just add the VM to the vApp. As the vApp has allready the config you want you just add the VM and map <NetworkAssignment> the networks of the VMTemplate to the Org or vApp network of the vApp.
The inner Network is the Network of the VM (as in the name of the Network you created the VM in) and the ContainerNet is the Org or vApp network of your vApp you want to add it to.
<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="link-to-vm" name="test2"/><InstantiationParams>
<NetworkConnectionSection ovf:required="false">
<ovf:Info>Specifies the available VM network connections</ovf:Info>
<PrimaryNetworkConnectionIndex>0</PrimaryNetworkConnectionIndex>
<NetworkConnection network="SupportNet" needsCustomization="false">
<NetworkConnectionIndex>0</NetworkConnectionIndex>
<IpAddress>192.168.0.23</IpAddress>
<IsConnected>true</IsConnected>
<IpAddressAllocationMode>MANUAL</IpAddressAllocationMode>
</NetworkConnection>
</NetworkConnectionSection>
</InstantiationParams><NetworkAssignment innerNetwork="SupportNet" containerNetwork="SupportNet"/>
</SourcedItem>
</RecomposeVAppParams>
That is exactly the same XML I have created after post #5. Leaving or not leaving the first InstantiationParams result in the same error (#6). Did you used the XML in a test call in your environment with no error?
Thanks,
Tom
Just for closing this issue, problem is solved.
Not mentioned in the error message, but the wrong IP which is not in the range of the Pool (of the attribute network in NetworkConnection) results in the error.
Thanks,
Tom
I am trying to add a bridged vapp network as well, and am unsuccessful; I'm doing practically the same thing:
Every time I get: Unable to perform this action. Contact your cloud administrator.
The exact same logic works great for ComposeVapp, and sticking an existing vapp network works as well.
Thanks!!