VMware Cloud Community
Tom247
Contributor
Contributor
Jump to solution

The VCD entity network .. specified for VM .. does not exist.

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

0 Kudos
1 Solution

Accepted Solutions
rkamal
VMware Employee
VMware Employee
Jump to solution

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.

View solution in original post

0 Kudos
13 Replies
rkamal
VMware Employee
VMware Employee
Jump to solution

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.

Windspirit
Hot Shot
Hot Shot
Jump to solution

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

Tom247
Contributor
Contributor
Jump to solution

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

0 Kudos
rkamal
VMware Employee
VMware Employee
Jump to solution

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.

0 Kudos
Tom247
Contributor
Contributor
Jump to solution

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

0 Kudos
rkamal
VMware Employee
VMware Employee
Jump to solution

Hi,

You login as what kind of a user, Ex: Org admin.

Regards,

Rajesh Kamal.

0 Kudos
Tom247
Contributor
Contributor
Jump to solution

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

0 Kudos
Windspirit
Hot Shot
Hot Shot
Jump to solution

please post your complete REST request your using ATM.

0 Kudos
Tom247
Contributor
Contributor
Jump to solution

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

0 Kudos
Windspirit
Hot Shot
Hot Shot
Jump to solution

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>

0 Kudos
Tom247
Contributor
Contributor
Jump to solution

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

0 Kudos
Tom247
Contributor
Contributor
Jump to solution

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

0 Kudos
mkhand02
Contributor
Contributor
Jump to solution

I am trying to add a bridged vapp network as well, and am unsuccessful;  I'm doing practically the same thing:

    <ns6:Description>vdcservergroup1</ns6:Description>
    <ns6:InstantiationParams>
        <ns6:NetworkConfigSection>
            <ns2:Info/>
            <ns6:NetworkConfig networkName="vdcNetworkTest">
                <ns6:Configuration>
                    <ns6:ParentNetwork type="application/vnd.vmware.vcloud.network+xml" name="vdcNetworkTest" href="<url>/api/network/d3e98225-c87c-44fb-b370-25f0344157a3"/>
                    <ns6:FenceMode>bridged</ns6:FenceMode>
                </ns6:Configuration>
            </ns6:NetworkConfig>
        </ns6:NetworkConfigSection>
    </ns6:InstantiationParams>
    <ns6:SourcedItem sourceDelete="false">
        <ns6:Source name="SPI-DEBIAN6052" href=""<url>/api/vAppTemplate/vm-52aa0935-eb85-4c78-91a3-170a7aa97735"/>
        <ns6:InstantiationParams>
            <ns6:NetworkConnectionSection>
                <ns2:Info/>
                <ns6:PrimaryNetworkConnectionIndex>0</ns6:PrimaryNetworkConnectionIndex>
                <ns6:NetworkConnection network="vdcNetworkTest" needsCustomization="true">
                    <ns6:NetworkConnectionIndex>0</ns6:NetworkConnectionIndex>
                    <ns6:IsConnected>false</ns6:IsConnected>
                    <ns6:MACAddress>00:50:56:01:05:f8</ns6:MACAddress>
                    <ns6:IpAddressAllocationMode>POOL</ns6:IpAddressAllocationMode>
                </ns6:NetworkConnection>
            </ns6:NetworkConnectionSection>
        </ns6:InstantiationParams>
    </ns6:SourcedItem>
</ns6:RecomposeVAppParams>

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!!

0 Kudos