Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-607

ComputeService.createNodesInGroup throws NPE on FloatingAPI.create()

    XMLWordPrintableJSON

    Details

      Description

      When calling 'ComputeService.createNodesInGroup' an NPE is thrown on the 'FloatingAPI.create()' call here (line 81):

      https://github.com/jclouds/jclouds/blob/4c74b497547e42b8bdc94dbae3d4cd94ff3945d6/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/compute/functions/AllocateAndAddFloatingIpToNode.java

      Code snippet to reproduce here:

      NovaTemplateOptions options = NovaTemplateOptions.Builder.
      autoAssignFloatingIp(true).
      blockUntilRunning(true).
      securityGroupNames(securityGroups);

      Template template = computeServiceContext.getComputeService().templateBuilder().
      imageId(imageID).
      hardwareId(hardwareID).
      options(options).
      build();

      Set<NodeMetadata> groupNodes = (Set<NodeMetadata>)computeServiceContext.getComputeService().createNodesInGroup(groupName, count, template);

      There does not seem to be a way, at least that I'm aware of, to pass in the floating-ip-pool-name for the 'createNodesInGroup' call. I would assume that an option inside TemplateOptions, something like 'TemplateOptions.autoAssignFloatingIpPoolName(String)', would be available but I can't find anything. I've posted the stacktrace below attempting to create 2 nodes. Not sure if this is a bug or feature-request (seems like bug to me).

      Exception in thread "main" org.jclouds.compute.RunNodesException: error running 2 nodes group(dancc-testing) location(RegionOne) image(f436ed68-722d-4918-bb34-5c0e5e7523b8) size(3) options(

      {securityGroupNames=[test_allow_all], configDrive=false}

      )
      Execution failures:
      1) ExecutionException on dancc-testing-305:
      java.util.concurrent.ExecutionException: java.lang.NullPointerException
      at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:299)
      at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:286)
      at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)
      at org.jclouds.concurrent.FutureIterables$1.run(FutureIterables.java:125)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
      at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.NullPointerException
      at org.jclouds.openstack.nova.v2_0.compute.functions.AllocateAndAddFloatingIpToNode.apply(AllocateAndAddFloatingIpToNode.java:98)
      at org.jclouds.openstack.nova.v2_0.compute.functions.AllocateAndAddFloatingIpToNode.apply(AllocateAndAddFloatingIpToNode.java:1)
      at com.google.common.util.concurrent.Futures$1.apply(Futures.java:711)
      at com.google.common.util.concurrent.Futures$ChainingListenableFuture.run(Futures.java:849)
      ... 3 more
      2) ExecutionException on dancc-testing-94b:
      java.util.concurrent.ExecutionException: java.lang.NullPointerException
      at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:299)
      at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:286)
      at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)
      at org.jclouds.concurrent.FutureIterables$1.run(FutureIterables.java:125)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
      at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.NullPointerException
      at org.jclouds.openstack.nova.v2_0.compute.functions.AllocateAndAddFloatingIpToNode.apply(AllocateAndAddFloatingIpToNode.java:98)
      at org.jclouds.openstack.nova.v2_0.compute.functions.AllocateAndAddFloatingIpToNode.apply(AllocateAndAddFloatingIpToNode.java:1)
      at com.google.common.util.concurrent.Futures$1.apply(Futures.java:711)
      at com.google.common.util.concurrent.Futures$ChainingListenableFuture.run(Futures.java:849)
      ... 3 more
      2 error[s]
      Node failures:
      0 error[s]
      at org.jclouds.compute.internal.BaseComputeService.createNodesInGroup(BaseComputeService.java:227)
      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)
      at com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:37)
      at com.sun.proxy.$Proxy58.createNodesInGroup(Unknown Source)
      at com.pega.vm.client.VMAdministratorImpl.provisionVirtualMachines(VMAdministratorImpl.java:196)
      at com.pega.vm.client.Testing.main(Testing.java:29)

        Attachments

        1. JCLOUDS-607.patch
          27 kB
          Andrew Phillips

          Issue Links

            Activity

              People

              • Assignee:
                andrewp Andrew Phillips
                Reporter:
                dancc@pega.com Christopher Dancy
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: