VMware vCloud

 View Only
Expand all | Collapse all

Get Org Network fails in 5.1

  • 1.  Get Org Network fails in 5.1

    Posted Dec 03, 2012 10:53 AM

    Hi,

    I am having troubles retrieving the organisation network in 5.1. Essentially I am able to retrieve the network reference but the method afterwards failes with a strange error.

    public String NWGet(String switchName) throws VCloudException {
       Collection<ReferenceType> orgNetworkTypeRefs = getOrganization().getNetworkRefs();
      for (ReferenceType orgNetworkTypeRef : orgNetworkTypeRefs) {
         OrgVdcNetwork orgNetwork = OrgVdcNetwork.getOrgVdcNetworkByReference(getVcloudClient(), orgNetworkTypeRef);
         //OrgNetwork orgNetwork = OrgNetwork.getOrgNetworkByReference(getVcloudClient(), orgNetworkTypeRef);
         OrgVdcNetworkType orgNetworkType = orgNetwork.getResource();
       }
       return null;
    }

    And the error is:

    java.lang.ClassCastException: com.vmware.vcloud.api.rest.schema.OrgNetworkType cannot be cast to com.vmware.vcloud.api.rest.schema.OrgVdcNetworkType      at com.vmware.vcloud.sdk.OrgVdcNetwork.getOrgVdcNetworkByReference(OrgVdcNetwork.java:109)

    To me this makes no sense. Any idea what I am doing wrong?



  • 2.  RE: Get Org Network fails in 5.1

    Posted Dec 03, 2012 04:25 PM

    Hi there,

    and directly the next issues:

    when trying to connect to an external network, I am getting this error:

    com.vmware.vcloud.sdk.VCloudException: The VCD entity network "external-network" does not exist.      at com.vmware.vcloud.sdk.Task.waitForTaskCompletion(Task.java:325)      at com.vmware.vcloud.sdk.Task.waitForTask(Task.java:384)

    In 1.5 I did not need to add the external network to the vApp to connect to an external network. So I tried to add the external network manually before adding connecting the VM to the external network. I would be glad if you could provide some MORE docs how to add an external networks to an vApp, if necessary at all.

    After adding the network manually the error looks like this:

    com.vmware.vcloud.sdk.VCloudException: Following error(s) occured while updating network connections:   Internal Server Error      at com.vmware.vcloud.sdk.Task.waitForTaskCompletion(Task.java:325)      at com.vmware.vcloud.sdk.Task.waitForTask(Task.java:384)

    Server log output:

    k=b2308208-e005-4d44-ba99-aafe4261a9d5
    2012-12-03 17:12:55,123 | ERROR    | LocalTaskScheduler-Pool-2 | TaskServiceImpl                | Unable to execute task VAPP_UPDATE_VM(com.vmware.vcloud.entity.task:b2308208-e005-4d44-ba99-aafe4261a9d5) | vcd=d7cf05e1-d9fc-4373-823d-b507f079d9b7,task=b2308208-e005-4d44-ba99-aafe4261a9d5
    [root@VCD51-FULL logs]# tail -n 1000 vcloud-container-debug.log | grep ERROR
    2012-12-03 17:12:55,056 | ERROR    | LocalTaskScheduler-Pool-2 | FutureUtil                     | Failed to add subnet node to NIC | vcd=d7cf05e1-d9fc-4373-823d-b507f079d9b7,task=b2308208-e005-4d44-ba99-aafe4261a9d5
    2012-12-03 17:12:55,123 | ERROR    | LocalTaskScheduler-Pool-2 | TaskServiceImpl                | Unable to execute task VAPP_UPDATE_VM(com.vmware.vcloud.entity.task:b2308208-e005-4d44-ba99-aafe4261a9d5) | vcd=d7cf05e1-d9fc-4373-823d-b507f079d9b7,task=b2308208-e005-4d44-ba99-aafe4261a9d5
    [root@VCD51-FULL logs]#

    Looking into the vCD I can see, that the VM has been connected to external network. But it is in an inconsistent state, so nothing to work with.

    RKamal and friends it would be could if you could tell me if these are bugs, or issue on my side. Atm I think these are all bugs..

    Regards,

    Johannes



  • 3.  RE: Get Org Network fails in 5.1

    Posted Dec 03, 2012 06:50 PM

    Hi,

    vCloud Director 5.1 has completely removed Org Network and replaced it with Org Vdc Network. The UI does not show any trace of the Org Network at all.

    In order to be backward compatible with the old clients/code written against vCD 1.5,

        If the client/code sends 1.5 request header, vCD responds with an Org Network which is backed by an Org Vdc Network.

        If the client/code sends 5.1 request header, vCD responds with an Org Vdc Network.

    Regards,

    Rajesh Kamal.



  • 4.  RE: Get Org Network fails in 5.1

    Posted Dec 03, 2012 07:00 PM

    Hi Rajesh,

    thanks for your answer. That's the behavior I would have expected. But as you can see from my code I am using the 5.1 client side API. Otherwise it would not have been possible to request the OrgVdcNetwork (a change I was aware of).

    If you take look at my code, you can see that this should return an OrgVdcNetwork, but instead I get the conversion error.

    OrgVdcNetwork orgNetwork = OrgVdcNetwork.getOrgVdcNetworkByReference(getVcloudClient(), orgNetworkTypeRef);
         //OrgNetwork orgNetwork = OrgNetwork.getOrgNetworkByReference(getVcloudClient(), orgNetworkTypeRef);
         OrgVdcNetworkType orgNetworkType = orgNetwork.getResource();

    So I still think there is something wrong..



  • 5.  RE: Get Org Network fails in 5.1

    Posted Dec 03, 2012 07:02 PM

    Hi,

    I think you are not logging in as Version.V5_1.

    Since you are logging in as Version.V1_5, vCD API is sending back an Org Network.

    Regards,

    Rajesh Kamal.



  • 6.  RE: Get Org Network fails in 5.1

    Posted Dec 03, 2012 07:23 PM

    Hi Rajesh,

    indeed thanks you were right. But the errors of the second post still occur.

    Any idea about that?

    Regards,

    Johannes



  • 7.  RE: Get Org Network fails in 5.1

    Posted Dec 03, 2012 07:27 PM

    Hi,

    I am not able to figure out what the specific operation was from the code snippets and the exception. It says wait for task and the task throws an error.

    Can you add more details as to what set of API/SDK operations were working in vCD 1.5 is not working against vCD 5.1

    Regards,
    Rajesh Kamal.



  • 8.  RE: Get Org Network fails in 5.1

    Posted Dec 03, 2012 07:31 PM

    Hi Rajesh,

    thanks a lot for your fast response. Here is the code snippet:

    if (networkConnectionType.getNetworkConnectionIndex() == nicIndex) {
         networkConnectionType.setNetwork(networkName);
         if (configure)
              networkConnectionType.setIpAddressAllocationMode(IpAddressAllocationModeType.MANUAL.value());
         else
              networkConnectionType.setIpAddressAllocationMode(IpAddressAllocationModeType.DHCP.value());
         networkConnectionType.setIsConnected(true);
         if (ipAddress != null && configure) {
              networkConnectionType.setIpAddress(ipAddress);
              networkConnectionType.setNeedsCustomization(true);
         }
    }
    Task vmUpdateNetworkConnections  = vm.updateSection(networkConnectionSectionType);            try {      Task.waitForTask(getVcloudClient(), vmUpdateNetworkConnections.getReference(), creationTaskDurationTimeout); } catch (TimeoutException e) {      result = false;      e.printStackTrace(); }

    The line is networkConnectionType.setNetwork(networkName); and it work previously without any issues..

    Thanks again,

    Johannes



  • 9.  RE: Get Org Network fails in 5.1

    Posted Dec 03, 2012 10:52 PM

    Hi,

    Are you saying,

    In vCD 1.5 Ex: you had a VM nic which was not connected to any network, now you are trying to update the nics by specifying the Org Network which is directly connected to an External Network. Updating the VM nics would inturn connect the nic to the Org Network by creating a Vapp Network between the nic and the Org Network. All these were happening automatically in vCD 1.5 as part of the updating the nics.

    In vCD 5.1 all of the above is same except the instead of the Org Network name you are providing the Org Vdc Network name which is directly connected to an External Network. The nic should now be automatically be connected to the Org Vdc Network by creating a Vapp Network between the nic and the Org Vdc Network. You do not see this happening automatically.

    Regards,

    Rajesh Kamal.



  • 10.  RE: Get Org Network fails in 5.1

    Posted Dec 04, 2012 07:16 AM

    Hi Rajesh,

    it is exactly as you described it. Working like a charme in 1.5, but stopped working in 5.1.

    Were there any changes, or do I need to do something differently?

    Regards,

    Johannes



  • 11.  RE: Get Org Network fails in 5.1

    Posted Dec 04, 2012 08:58 PM

    Hi Rajesh,

    any update on this? Our cloud provider is going to migrate to 5.1 in two weeks, and that would be a huge problem, if this would not work anymore.

    Thanks,

    Johannes



  • 12.  RE: Get Org Network fails in 5.1

    Posted Dec 04, 2012 09:58 PM

    Hi,

    I tried this workaround of explicity adding a vapp network(parent network is the org vdc network) to the vapp. Then updating the VM's nic to this vapp network worked.

    You can try something like this and see,

    // Get the org vdc network you want to map the vm's nic to.
    OrgVdcNetwork orgVdcNetwork = OrgVdcNetwork.getOrgVdcNetworkById(
    client,
    "urn:vcloud:network:74d2b27f-9bd4-4f6e-9a2d-d1d25b572c19");
    // Get the vapp which contains the VM.
    Vapp vapp = Vapp.getVappById(client,
    "urn:vcloud:vapp:b469034a-8226-4a26-b1d8-2bf6d03107d9");
    // If the vapp does not contain any networking. Create a new net config
    // section
    NetworkConfigSectionType vappNetworkConfigSection = new NetworkConfigSectionType();
    MsgType networkInfo = new MsgType();
    vappNetworkConfigSection.setInfo(networkInfo);
    List<VAppNetworkConfigurationType> vappNetworks = vappNetworkConfigSection
    .getNetworkConfig();
    // Create a new vapp network and map this network to the org vdc
    // network.
    VAppNetworkConfigurationType vappNetwork = new VAppNetworkConfigurationType();
    vappNetwork.setNetworkName(orgVdcNetwork.getReference().getName());
    NetworkConfigurationType vappNetworkConfig = new NetworkConfigurationType();
    vappNetworkConfig.setParentNetwork(orgVdcNetwork.getReference());
    vappNetworkConfig.setFenceMode(FenceModeValuesType.BRIDGED.value());
    vappNetwork.setConfiguration(vappNetworkConfig);
    vappNetworks.add(vappNetwork);
    // Update the vapp with the newly created vapp network.
    vapp.updateSection(vappNetworkConfigSection).waitForTask(0);
    // Now perform updating the VM nics.
    VM vm = vapp.getChildrenVms().get(0);
    NetworkConnectionSectionType nics = vm.getNetworkConnectionSection();
    int nicIndex = nics.getPrimaryNetworkConnectionIndex();
    for (NetworkConnectionType nic : nics.getNetworkConnection()) {
    if (nic.getNetworkConnectionIndex() == nicIndex) {
    nic.setNetwork(orgVdcNetwork.getReference().getName());
    nic.setIpAddressAllocationMode(IpAddressAllocationModeType.DHCP
    .value());
    nic.setIsConnected(true);
    }
    vm.updateSection(nics).waitForTask(0);
    }

    Regards,

    Rajesh Kamal.



  • 13.  RE: Get Org Network fails in 5.1

    Posted Dec 05, 2012 11:17 AM

    Hi Rajesh,

    thanks for your response. I could not try your approach, because I tried to create a VappNetwork on the fly first. I switched the API Version to 5.1 an used the same code as before, working in V1.5. I also compared the code the sample files included in the API package.

    The error I get is:

    com.vmware.vcloud.sdk.VCloudException: Unable to create network "Test2". Invalid network parameter: Subnet mask cannot be empty.
    at com.vmware.vcloud.sdk.Task.waitForTaskCompletion(Task.java:326)
    at com.vmware.vcloud.sdk.Task.waitForTask(Task.java:385)

    The funny thing is, if you take a look at the screenshot attached, that subnetMask is NOT empty. Neither it is empty if I set API Version to 1.5. In this case it also works without any problems.



  • 14.  RE: Get Org Network fails in 5.1

    Posted Dec 05, 2012 11:49 AM

    Hi Rajesh,

    I tried your approach, and it seems to work, up until the point where I want to connect the nic to the newly created network. When updating those changes I get the following error:

    com.vmware.vcloud.sdk.VCloudException: Following error(s) occured while updating network connections:   Internal Server Error
    at com.vmware.vcloud.sdk.Task.waitForTaskCompletion(Task.java:326)
    at com.vmware.vcloud.sdk.Task.waitForTask(Task.java:385)

    V5_1. The vCD shows the connection and I am able to power on the machine. Screenshot attached.

    P.S. The subnet mask error still resides.



  • 15.  RE: Get Org Network fails in 5.1

    Posted Dec 07, 2012 07:48 AM

    Hi Rajesh,

    any update on this? It is really urgent, as many provider are going to migrate to 5.1 soon, and an internal server error looks like a bug, as well as the subnetmask property problem.



  • 16.  RE: Get Org Network fails in 5.1

    Posted Dec 07, 2012 07:58 AM

    Hi,

    With the above code which I shared, I was able to map the VM's nic to the orgvdcnetwork(via vapp network).

    I am not sure what your issue is. If it is an API bug with ISO, then I would suggest following up with the GSS and provide more information to them.

    Regards,

    Rajesh Kamal.



  • 17.  RE: Get Org Network fails in 5.1

    Posted Dec 07, 2012 08:01 AM

    Hi Rajesh,

    all right, I will try a different vCD. What is about network creation with the subnet mask error?



  • 18.  RE: Get Org Network fails in 5.1

    Posted Dec 07, 2012 10:54 AM

    Hi Rajesh,

    we are using a vCloud Appliance from VMware for testing. The Build-Number is 5.1.1 868405, the most basic configuration you can imagine. And the internal server error still exists.

    Dez 07, 2012 11:50:45 AM com.vmware.vcloud.sdk.Task getTaskByReference
    Dez 07, 2012 11:50:45 AM com.vmware.vcloud.sdk.VcloudResource getResourceByReference
    Dez 07, 2012 11:50:45 AM com.vmware.vcloud.sdk.RestUtil get
    Dez 07, 2012 11:50:45 AM com.vmware.vcloud.sdk.RestUtil get
    Dez 07, 2012 11:50:45 AM com.vmware.vcloud.sdk.RestUtil get
    INFO: Status Code - 200
    Dez 07, 2012 11:50:45 AM com.vmware.vcloud.sdk.RestUtil get
    INFO: Status - OK
    Dez 07, 2012 11:50:45 AM com.vmware.vcloud.sdk.RestUtil get
    INFO: Response - <?xml version="1.0" encoding="UTF-8"?>
    <Task xmlns="http://www.vmware.com/vcloud/v1.5" status="running" startTime="2012-12-07T05:51:04.419-05:00" serviceNamespace="com.vmware.vcloud" operationName="vappUpdateVm" operation="Updating Virtual Machine vmTest(13972ca2-c853-42f2-b168-b88cc753f80e)" expiryTime="2013-03-07T05:51:04.419-05:00" cancelRequested="false" name="task" id="urn:vcloud:task:25e06710-4f32-479a-908e-b2246c345ee0" type="application/vnd.vmware.vcloud.task+xml" href="https://192.168.1.93/api/task/25e06710-4f32-479a-908e-b2246c345ee0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://192.168.1.93/api/v1.5/schema/master.xsd">
        <Owner type="application/vnd.vmware.vcloud.vm+xml" name="vmTest" href="https://192.168.1.93/api/vApp/vm-13972ca2-c853-42f2-b168-b88cc753f80e"/>
        <User type="application/vnd.vmware.admin.user+xml" name="scriptuser" href="https://192.168.1.93/api/admin/user/2ee6a01b-52f4-4914-9a03-89017f49084e"/>
        <Organization type="application/vnd.vmware.vcloud.org+xml" name="Demo51" href="https://192.168.1.93/api/org/4b5c3bc9-7de5-4412-8d71-8166d0b198ee"/>
        <Progress>0</Progress>
        <Details/>
    </Task>
    Dez 07, 2012 11:50:45 AM com.vmware.vcloud.sdk.Task getTaskByReference
    Dez 07, 2012 11:50:45 AM com.vmware.vcloud.sdk.VcloudResource getResourceByReference
    Dez 07, 2012 11:50:45 AM com.vmware.vcloud.sdk.RestUtil get
    Dez 07, 2012 11:50:45 AM com.vmware.vcloud.sdk.RestUtil get
    Dez 07, 2012 11:50:45 AM com.vmware.vcloud.sdk.RestUtil get
    INFO: Status Code - 200
    Dez 07, 2012 11:50:45 AM com.vmware.vcloud.sdk.RestUtil get
    INFO: Status - OK
    Dez 07, 2012 11:50:45 AM com.vmware.vcloud.sdk.RestUtil get
    INFO: Response - <?xml version="1.0" encoding="UTF-8"?>
    <Task xmlns="http://www.vmware.com/vcloud/v1.5" status="error" startTime="2012-12-07T05:51:04.419-05:00" serviceNamespace="com.vmware.vcloud" operationName="vappUpdateVm" operation="Updated Virtual Machine vmTest(13972ca2-c853-42f2-b168-b88cc753f80e)" expiryTime="2013-03-07T05:51:04.419-05:00" endTime="2012-12-07T05:51:08.228-05:00" cancelRequested="false" name="task" id="urn:vcloud:task:25e06710-4f32-479a-908e-b2246c345ee0" type="application/vnd.vmware.vcloud.task+xml" href="https://192.168.1.93/api/task/25e06710-4f32-479a-908e-b2246c345ee0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://192.168.1.93/api/v1.5/schema/master.xsd">
        <Owner type="application/vnd.vmware.vcloud.vm+xml" name="vmTest" href="https://192.168.1.93/api/vApp/vm-13972ca2-c853-42f2-b168-b88cc753f80e"/>
        <Error minorErrorCode="INTERNAL_SERVER_ERROR" message="Following error(s) occured while updating network connections:
    Internal Server Error" majorErrorCode="500"/>
        <User type="application/vnd.vmware.admin.user+xml" name="scriptuser" href="https://192.168.1.93/api/admin/user/2ee6a01b-52f4-4914-9a03-89017f49084e"/>
        <Organization type="application/vnd.vmware.vcloud.org+xml" name="Demo51" href="https://192.168.1.93/api/org/4b5c3bc9-7de5-4412-8d71-8166d0b198ee"/>
        <Progress>0</Progress>
        <Details>  Following error(s) occured while updating network connections: </Details>
    </Task>
    Dez 07, 2012 11:50:45 AM com.vmware.vcloud.sdk.Task waitForTaskCompletion
    INFO: Task Errored - Following error(s) occured while updating network connections:   Internal Server Error
    com.vmware.vcloud.sdk.VCloudException: Following error(s) occured while updating network connections:   Internal Server Error
    at com.vmware.vcloud.sdk.Task.waitForTaskCompletion(Task.java:326)
    at com.vmware.vcloud.sdk.Task.waitForTask(Task.java:385)
    at de.evoila.provisioning.vcd.VCDHost.VMConnectToNetwork(VCDHost.java:1065)
    at de.evoila.provisioning.vcd.VCDHost.VMConnectToExternalNetwork(VCDHost.java:1002)
    at de.evoila.provisioning.test.vcd.VCDBaseTest.test(VCDBaseTest.java:47)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

    Could you tell us, in which log to look or something else? These network-issues are driving me nutzs, honestly.



  • 19.  RE: Get Org Network fails in 5.1

    Posted Dec 07, 2012 08:42 AM

    Hi,

    Can you post the code, XML payload request for the subnet mask empty error.

    But the error clearly says subnet mask cannot be empty.

    Regards,

    Rajesh Kamal.



  • 20.  RE: Get Org Network fails in 5.1

    Posted Dec 07, 2012 09:28 AM

    Hi Rajesh,

    XML here we go:

    INFO: PUT Request Body - <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <ns2:Info>The configuration parameters for logical networks</ns2:Info>
        <ns6:Link rel="edit" href="https://192.168.1.93/api/vApp/vapp-c587fd57-b821-49b8-a8cf-f10926902fc1/networkConfigSection/" type="application/vnd.vmware.vcloud.networkConfigSection+xml"/>
        <ns6:NetworkConfig networkName="none">
            <ns6:Description>This is a special place-holder used for disconnected network interfaces.</ns6:Description>
            <ns6:Configuration>
                <ns6:IpScopes>
                    <ns6:IpScope>
                        <ns6:IsInherited>false</ns6:IsInherited>
                        <ns6:Gateway>196.254.254.254</ns6:Gateway>
                        <ns6:Netmask>255.255.0.0</ns6:Netmask>
                        <ns6:Dns1>196.254.254.254</ns6:Dns1>
                    </ns6:IpScope>
                </ns6:IpScopes>
                <ns6:FenceMode>isolated</ns6:FenceMode>
            </ns6:Configuration>
            <ns6:IsDeployed>false</ns6:IsDeployed>
        </ns6:NetworkConfig>
        <ns6:NetworkConfig networkName="Test2">
            <ns6:Configuration>
                <ns6:IpScope>
                    <ns6:IsInherited>false</ns6:IsInherited>
                    <ns6:Gateway>192.168.1.1</ns6:Gateway>
                    <ns6:Netmask>255.255.255.0</ns6:Netmask>
                    <ns6:Dns1>192.168.1.1</ns6:Dns1>
                    <ns6:Dns2>192.168.1.2</ns6:Dns2>
                    <ns6:IpRanges>
                        <ns6:IpRange>
                            <ns6:StartAddress>192.168.1.12</ns6:StartAddress>
                            <ns6:EndAddress>192.168.1.240</ns6:EndAddress>
                        </ns6:IpRange>
                    </ns6:IpRanges>
                </ns6:IpScope>
                <ns6:FenceMode>isolated</ns6:FenceMode>
            </ns6:Configuration>
        </ns6:NetworkConfig>
    </ns6:NetworkConfigSection>
    Dez 07, 2012 10:13:59 AM com.vmware.vcloud.sdk.RestUtil put
    INFO: PUT Request Content Type - application/vnd.vmware.vcloud.networkConfigSection+xml
    Dez 07, 2012 10:13:59 AM com.vmware.vcloud.sdk.RestUtil put
    INFO: Status Code - 202
    Dez 07, 2012 10:13:59 AM com.vmware.vcloud.sdk.RestUtil put
    INFO: Status - Accepted
    Dez 07, 2012 10:13:59 AM com.vmware.vcloud.sdk.RestUtil put
    INFO: Response - <?xml version="1.0" encoding="UTF-8"?>
    <Task xmlns="http://www.vmware.com/vcloud/v1.5" status="running" startTime="2012-12-07T04:14:22.135-05:00" serviceNamespace="com.vmware.vcloud" operationName="vdcUpdateVappNetworkSection" operation="Updating Virtual Application vappTest-5(c587fd57-b821-49b8-a8cf-f10926902fc1)" expiryTime="2013-03-07T04:14:22.135-05:00" cancelRequested="false" name="task" id="urn:vcloud:task:411c8000-70de-496f-af34-c824cc40d8e8" type="application/vnd.vmware.vcloud.task+xml" href="https://192.168.1.93/api/task/411c8000-70de-496f-af34-c824cc40d8e8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://192.168.1.93/api/v1.5/schema/master.xsd">
        <Owner type="application/vnd.vmware.vcloud.vApp+xml" name="vappTest-5" href="https://192.168.1.93/api/vApp/vapp-c587fd57-b821-49b8-a8cf-f10926902fc1"/>
        <User type="application/vnd.vmware.admin.user+xml" name="scriptuser" href="https://192.168.1.93/api/admin/user/2ee6a01b-52f4-4914-9a03-89017f49084e"/>
        <Organization type="application/vnd.vmware.vcloud.org+xml" name="Demo51" href="https://192.168.1.93/api/org/4b5c3bc9-7de5-4412-8d71-8166d0b198ee"/>
        <Progress>0</Progress>
        <Details/>
    </Task>
    Dez 07, 2012 10:14:32 AM com.vmware.vcloud.sdk.Task getTaskByReference
    Dez 07, 2012 10:14:32 AM com.vmware.vcloud.sdk.VcloudResource getResourceByReference
    Dez 07, 2012 10:14:32 AM com.vmware.vcloud.sdk.RestUtil get
    Dez 07, 2012 10:14:32 AM com.vmware.vcloud.sdk.RestUtil get
    Dez 07, 2012 10:14:36 AM com.vmware.vcloud.sdk.RestUtil get
    INFO: Status Code - 200
    Dez 07, 2012 10:14:36 AM com.vmware.vcloud.sdk.RestUtil get
    INFO: Status - OK
    Dez 07, 2012 10:14:36 AM com.vmware.vcloud.sdk.RestUtil get
    INFO: Response - <?xml version="1.0" encoding="UTF-8"?>
    <Task xmlns="http://www.vmware.com/vcloud/v1.5" status="error" startTime="2012-12-07T04:14:22.135-05:00" serviceNamespace="com.vmware.vcloud" operationName="vdcUpdateVappNetworkSection" operation="Updated Virtual Application vappTest-5(c587fd57-b821-49b8-a8cf-f10926902fc1)" expiryTime="2013-03-07T04:14:22.135-05:00" endTime="2012-12-07T04:14:22.203-05:00" cancelRequested="false" name="task" id="urn:vcloud:task:411c8000-70de-496f-af34-c824cc40d8e8" type="application/vnd.vmware.vcloud.task+xml" href="https://192.168.1.93/api/task/411c8000-70de-496f-af34-c824cc40d8e8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://192.168.1.93/api/v1.5/schema/master.xsd">
        <Owner type="application/vnd.vmware.vcloud.vApp+xml" name="vappTest-5" href="https://192.168.1.93/api/vApp/vapp-c587fd57-b821-49b8-a8cf-f10926902fc1"/>
        <Error minorErrorCode="NETWORK_INTERNAL_SERVER" message="Unable to create network &quot;Test2&quot;.
    Invalid network parameter: Subnet mask cannot be empty." majorErrorCode="500"/>
        <User type="application/vnd.vmware.admin.user+xml" name="scriptuser" href="https://192.168.1.93/api/admin/user/2ee6a01b-52f4-4914-9a03-89017f49084e"/>
        <Organization type="application/vnd.vmware.vcloud.org+xml" name="Demo51" href="https://192.168.1.93/api/org/4b5c3bc9-7de5-4412-8d71-8166d0b198ee"/>
        <Progress>0</Progress>
        <Details>  Unable to create network "Test2".</Details>
    </Task>
    Dez 07, 2012 10:14:36 AM com.vmware.vcloud.sdk.Task waitForTaskCompletion
    INFO: Task Errored - Unable to create network "Test2". Invalid network parameter: Subnet mask cannot be empty.
    com.vmware.vcloud.sdk.VCloudException: Unable to create network "Test2". Invalid network parameter: Subnet mask cannot be empty.
    at com.vmware.vcloud.sdk.Task.waitForTaskCompletion(Task.java:326)
    at com.vmware.vcloud.sdk.Task.waitForTask(Task.java:385)

    As you can see, netMask has a property set.

    Regards,

    Johannes



  • 21.  RE: Get Org Network fails in 5.1

    Posted Dec 07, 2012 10:20 AM

    Hi,

    I tried the below XML and it worked.

    <?xml version="1.0" encoding="UTF-8"?>

    <NetworkConfigSection xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" type="application/vnd.vmware.vcloud.networkConfigSection+xml" href="https://10.147.50.34/api/vApp/vapp-2858e687-1818-4a06-a383-f1543425ad06/networkConfigSection/" ovf:required="false" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.dmtf.org/ovf/envelope/1 http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd http://www.vmware.com/vcloud/v1.5 http://10.147.50.34/api/v1.5/schema/master.xsd">

        <ovf:Info>The configuration parameters for logical networks</ovf:Info>

        <Link rel="edit" type="application/vnd.vmware.vcloud.networkConfigSection+xml" href="https://10.147.50.34/api/vApp/vapp-2858e687-1818-4a06-a383-f1543425ad06/networkConfigSection/"/>

        <NetworkConfig networkName="Delete">

            <Link rel="repair" href="https://10.147.50.34/api/admin/network/c2f26eb3-ee36-44b4-913b-5a09d118b8bd/action/reset"/>

            <Description/>

            <Configuration>

                <IpScopes>

                    <IpScope>

                        <IsInherited>false</IsInherited>

                        <Gateway>192.168.2.1</Gateway>

                        <Netmask>255.255.255.0</Netmask>

                        <Dns1>192.168.1.1</Dns1>

                        <Dns2>192.168.1.2</Dns2>

                        <IsEnabled>true</IsEnabled>

                        <IpRanges>

                            <IpRange>

                                <StartAddress>192.168.2.100</StartAddress>

                                <EndAddress>192.168.2.199</EndAddress>

                            </IpRange>

                        </IpRanges>

                    </IpScope>

                </IpScopes>

                <FenceMode>isolated</FenceMode>

                <RetainNetInfoAcrossDeployments>false</RetainNetInfoAcrossDeployments>

            </Configuration>

            <IsDeployed>false</IsDeployed>

        </NetworkConfig>

    </NetworkConfigSection>



  • 22.  RE: Get Org Network fails in 5.1

    Posted Dec 07, 2012 06:07 PM

    Hi Rajesh,

    I tested the third vCloud Director installation, and the error a still there. I can't neither connect to the VM to the bridged network, nor am I able to create the network.

    I am using Java SDK, with v5.1

    Do I need to open a ticket through a our cloud provider to get a valid help?

    Best regards,

    Johannes



  • 23.  RE: Get Org Network fails in 5.1

    Posted Dec 07, 2012 06:25 PM

    Hi,

    Try with the your cloud provider. Also in the meantime can you also post the XML which causes the ISO 500 error. I am not sure if you have already posted this. I just remember seeing you task object erroring out. I dint see the XML request which triggered the task.

    Regards,
    Rajesh Kamal.



  • 24.  RE: Get Org Network fails in 5.1

    Posted Dec 07, 2012 06:29 PM

    Hi Rajesh,

    take a look here: http://communities.vmware.com/message/2160124#2160124

    There is the complete XML request, also including network.

    In your code sample you are retrieving your network, did you try creating it on the fly and then connecting the VM?



  • 25.  RE: Get Org Network fails in 5.1

    Posted Dec 07, 2012 06:34 PM

    Hi,

    The sample code posted here - http://communities.vmware.com/message/2158210#2158210

    1. Gets the Org Vdc Network.

    2. Gets the Vapp and creates a Vapp Network using the Network Config Section. The created Vapp Network points to the Org Vdc Network as its parent. Vapp Network is bridged to the Org Vdc Network.

    3. Get the VM from the Vapp and the change the nic settings using the Network Connecion Section and point to the created Vapp Network in the above step.

    Regards,

    Rajesh Kamal



  • 26.  RE: Get Org Network fails in 5.1

    Broadcom Employee
    Posted Dec 12, 2012 04:39 AM

    Hi Johannes,

    Seems the XML for Test2 network does not have IpScopes tag in the NetworkConfig section. Can you please modify your XML and try using this sample for Test2 network-


    <NetworkConfig networkName="Test2">
            <Configuration>
            <IpScopes>
                <IpScope>
                    <IsInherited>false</IsInherited>
                    <Gateway>192.168.1.1</Gateway>
                    <Netmask>255.255.255.0</Netmask>
                    <Dns1>192.168.1.1</Dns1>
                    <Dns2>192.168.1.2</Dns2>
                    <IpRanges>
                        <IpRange>
                            <StartAddress>192.168.1.12</StartAddress>
                            <EndAddress>192.168.1.240</EndAddress>
                        </IpRange>
                    </IpRanges>
                </IpScope>
            </IpScopes>
                <FenceMode>isolated</FenceMode>
            </Configuration>
        </NetworkConfig>


    Let me know if this works.

    -Aditya