Josef Cacek created JCLOUDS-1198:
------------------------------------

             Summary: Azurecompute doesn't support multiple addressPrefix in 
AddressSpace element
                 Key: JCLOUDS-1198
                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1198
             Project: jclouds
          Issue Type: Bug
          Components: jclouds-labs
    Affects Versions: 2.0.0
            Reporter: Josef Cacek
            Priority: Critical


The {{VirtualNetworkApiLiveTest}} is failing in my Azure environment.

The {{addressPrefix}} field in 
{{org.jclouds.azurecompute.domain.NetworkConfiguration.AddressSpace}} has to be 
of type list or similar, as there can be more prefixes present for the virtual 
network.

Test log:
{code}
-  >> GET 
https://management.core.windows.net/xxxxxxxx-xxxxx-xxxxx-xxxxx-xxxxxxxxx/services/networking/media
 HTTP/1.1
-  >> x-ms-version: 2014-10-01
-  >> Accept: application/xml
-  << HTTP/1.1 200 OK
-  << Server: 1.0.6198.442 (rd_rdfe_stable.161012-2349) Microsoft-HTTPAPI/2.0
-  << x-ms-servedbyregion: ussouth3
-  << x-ms-request-id: 4fca82ff7ae435189f9f3d093461e5f3
-  << Date: Wed, 09 Nov 2016 11:27:58 GMT
-  << Cache-Control: no-cache
-  << Content-Type: text/plain
-  << Content-Length: 19547
-  << "[0xef][0xbb][0xbf]<?xml version="1.0" encoding="utf-8"?>[\r][\n]"
-  << "<NetworkConfiguration xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration";>[\r][\n]"
-  << "  <VirtualNetworkConfiguration>[\r][\n]"
...
-  << "    <VirtualNetworkSites>[\r][\n]"
...
-  << "      <VirtualNetworkSite name="walavnettest1" Location="East 
US">[\r][\n]"
-  << "        <AddressSpace>[\r][\n]"
-  << "          <AddressPrefix>10.0.1.0/24</AddressPrefix>[\r][\n]"
-  << "          <AddressPrefix>10.0.2.0/24</AddressPrefix>[\r][\n]"
-  << "        </AddressSpace>[\r][\n]"
-  << "        <Subnets>[\r][\n]"
-  << "          <Subnet name="Subnet-1">[\r][\n]"
-  << "            <AddressPrefix>10.0.1.0/29</AddressPrefix>[\r][\n]"
-  << "          </Subnet>[\r][\n]"
-  << "          <Subnet name="Subnet-2">[\r][\n]"
-  << "            <AddressPrefix>10.0.1.8/29</AddressPrefix>[\r][\n]"
-  << "          </Subnet>[\r][\n]"
-  << "          <Subnet name="Subnet-3">[\r][\n]"
-  << "            <AddressPrefix>10.0.2.0/29</AddressPrefix>[\r][\n]"
-  << "          </Subnet>[\r][\n]"
-  << "          <Subnet name="Subnet-4">[\r][\n]"
-  << "            <AddressPrefix>10.0.2.8/29</AddressPrefix>[\r][\n]"
-  << "          </Subnet>[\r][\n]"
-  << "        </Subnets>[\r][\n]"
-  << "      </VirtualNetworkSite>[\r][\n]"
...
-  << "    </VirtualNetworkSites>[\r][\n]"
-  << "  </VirtualNetworkConfiguration>[\r][\n]"
-  << "</NetworkConfiguration>"
{code}

When the provider tries to update configuration it puts only one prefix into 
the request:

{code:xml}
<VirtualNetworkSite Location="East US" name="walavnettest1">
  <AddressSpace>
    <AddressPrefix>10.0.2.0/24</AddressPrefix>
  </AddressSpace>
  <Subnets>
    <Subnet name="Subnet-1">
      <AddressPrefix>10.0.1.0/29</AddressPrefix>
    </Subnet>
    <Subnet name="Subnet-2">
      <AddressPrefix>10.0.1.8/29</AddressPrefix>
    </Subnet>
    <Subnet name="Subnet-3">
      <AddressPrefix>10.0.2.0/29</AddressPrefix>
    </Subnet>
    <Subnet name="Subnet-4">
      <AddressPrefix>10.0.2.8/29</AddressPrefix>
    </Subnet>
  </Subnets>
</VirtualNetworkSite>
{code}

And finally the test fails with
{code}
Tests run: 4, Failures: 1, Errors: 0, Skipped: 3, Time elapsed: 36.25 sec <<< 
FAILURE! - in org.jclouds.azurecompute.features.VirtualNetworkApiLiveTest
setup(org.jclouds.azurecompute.features.VirtualNetworkApiLiveTest)  Time 
elapsed: 36.178 sec  <<< FAILURE!
org.jclouds.http.HttpResponseException: command: PUT 
https://management.core.windows.net/xxxxxxxx-xxxxx-xxxxx-xxxxx-xxxxxxxxx/services/networking/media
 HTTP/1.1 failed with response: HTTP/1.1 400 Bad Request; content: [<Error 
xmlns="http://schemas.microsoft.com/windowsazure"; 
xmlns:i="http://www.w3.org/2001/XMLSchema-instance";><Code>BadRequest</Code><Message>Subnet
 'Subnet-1' is not valid in virtual network 'walavnettest1'.</Message></Error>]
        at 
org.jclouds.azurecompute.handlers.AzureComputeErrorHandler.handleError(AzureComputeErrorHandler.java:44)
        at 
org.jclouds.http.handlers.DelegatingErrorHandler.handleError(DelegatingErrorHandler.java:65)
        at 
org.jclouds.http.internal.BaseHttpCommandExecutorService.shouldContinue(BaseHttpCommandExecutorService.java:140)
        at 
org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:109)
        at 
org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90)
        at 
org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73)
        at 
org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44)
        at 
org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117)
        at 
com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87)
        at com.sun.proxy.$Proxy68.set(Unknown Source)
        at 
org.jclouds.azurecompute.internal.BaseAzureComputeApiLiveTest$3.operation(BaseAzureComputeApiLiveTest.java:190)
        at 
org.jclouds.azurecompute.util.ConflictManagementPredicate.apply(ConflictManagementPredicate.java:120)
        at 
org.jclouds.azurecompute.internal.BaseAzureComputeApiLiveTest.getOrCreateVirtualNetworkSite(BaseAzureComputeApiLiveTest.java:192)
        at 
org.jclouds.azurecompute.features.VirtualNetworkApiLiveTest.setup(VirtualNetworkApiLiveTest.java:51)
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to