[ 
https://issues.apache.org/jira/browse/JCLOUDS-704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14129006#comment-14129006
 ] 

Jaiganesh Mathaiyan commented on JCLOUDS-704:
---------------------------------------------

Hi Andrea,

   I believe I got the correct repository now. When I run the test I get
the following error.

FAILED: testLaunchClusterWithMinDisk
java.lang.NullPointerException: id
    at
com.google.common.base.Preconditions.checkNotNull(Preconditions.java:226)
    at
org.jclouds.softlayer.domain.OperatingSystem.<init>(OperatingSystem.java:107)
    at
org.jclouds.softlayer.domain.OperatingSystem$Builder.build(OperatingSystem.java:88)
    at
org.jclouds.softlayer.compute.strategy.SoftLayerComputeServiceAdapter.getOperatingSystem(SoftLayerComputeServiceAdapter.java:344)
    at
org.jclouds.softlayer.compute.strategy.SoftLayerComputeServiceAdapter.listImages(SoftLayerComputeServiceAdapter.java:321)
    at
org.jclouds.softlayer.compute.strategy.SoftLayerComputeServiceAdapter.listImages(SoftLayerComputeServiceAdapter.java:92)
    at
org.jclouds.compute.config.ComputeServiceAdapterContextModule$2.get(ComputeServiceAdapterContextModule.java:121)
    at
org.jclouds.compute.config.ComputeServiceAdapterContextModule$2.get(ComputeServiceAdapterContextModule.java:118)
    at
org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:73)
    at
org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier$SetAndThrowAuthorizationExceptionSupplierBackedLoader.load(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:57)
    at
com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)
    at
com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)
    at
com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197)
    at com.google.common.cache.LocalCache.get(LocalCache.java:3937)
    at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941)
    at
com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824)
    at
org.jclouds.rest.suppliers.MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.get(MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier.java:119)
    at
org.jclouds.compute.suppliers.ImageCacheSupplier.get(ImageCacheSupplier.java:64)
    at
org.jclouds.compute.domain.internal.TemplateBuilderImpl.getImages(TemplateBuilderImpl.java:881)
    at
org.jclouds.compute.domain.internal.TemplateBuilderImpl.build(TemplateBuilderImpl.java:681)
    at
org.jclouds.softlayer.compute.SoftLayerComputeServiceContextLiveTest.testLaunchClusterWithMinDisk(SoftLayerComputeServiceContextLiveTest.java:76)
    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:606)
    at
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
    at
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
    at org.testng.TestRunner.privateRun(TestRunner.java:767)
    at org.testng.TestRunner.run(TestRunner.java:617)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
    at org.testng.SuiteRunner.run(SuiteRunner.java:240)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
    at org.testng.TestNG.run(TestNG.java:1057)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)


===============================================
    Default test
    Tests run: 1, Failures: 1, Skips: 0
===============================================
The code is using globalIdentifier while parsing the Image to create the
OperatingSystem object in SoftLayerComputeServiceAdapter.java.
As soon as I replace line 356 with
//final String globalIdentifier = image.getGlobalIdentifier();
final String globalIdentifier = "" + image.getId();

the junit  passes.
For your reference the Image object value at this point is shown below (I
captured this with a break-point in the code. You can see the global
Identifier being null)

VirtualGuestBlockDeviceTemplateGroup{id=220834, name=Disk image child group
created from 'node1521994033.me.org'., globalIdentifier=null, statusId=1,
accountId=123456, parentId=456789, summary=null, children=[],
blockDevices=[VirtualGuestBlockDeviceTemplate{id=288576, device=0,
diskImageId=4941216, diskSpace=1.24184832E9, groupId=220834, units=B,
diskImage=VirtualDiskImage{id=4941216,
uuid=f99b205d-3deb-424f-ac0a-c899efb6a425, capacity=4.0, units=GB,
typeId=249, description=Volume 0, name=Volume 0,
storageRepositoryId=1727456,
softwareReferences=[VirtualDiskImageSoftware{id=3041096,
softwareDescriptionId=1247,
softwareDescription=SoftwareDescription{id=1247, longDescription=Redhat /
EL / 6.5-64, manufacturer=Redhat, name=EL, operatingSystem=1,
referenceCode=REDHAT_6_64, requiredUser=root, version=6.5-64,
controlPanel=0, upgradeSoftwareDescriptionId=null, upgradeSwDescId=null,
virtualLicense=0, virtualizationPlatform=0}}]}}]}


However the original JIRA is for a different issue. Pls let me know how you
want me to to proceed now ?

Rgds
Jai




> Unable to create Virtual guest in SoftLayer
> -------------------------------------------
>
>                 Key: JCLOUDS-704
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-704
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-compute
>    Affects Versions: 1.8.1
>         Environment: provider: Softlayer
> JDK:  1.7
> provider/softlayer code deployed from github branch master.
>            Reporter: Jaiganesh Mathaiyan
>            Assignee: Andrea Turli
>            Priority: Blocker
>         Attachments: [TestNG] Running_SLComputeServiceLiveTest.log
>
>
> Error while creating a virtual guest in softlayer
> 2014-09-04 15:29:45,812 [main] DEBUG SLF4JLogger Sending request -1350657235: 
> POST 
> https://api.softlayer.com/rest/v3/SoftLayer_Product_Order/placeOrder.json 
> HTTP/1.1
> 2014-09-04 15:29:48,963 [main] DEBUG SLF4JLogger Receiving response 
> -1350657235: HTTP/1.1 200 OK
> java.lang.IndexOutOfBoundsException: position (0) must be less than the 
> number of elements that remained (0)
>     at com.google.common.collect.Iterators.get(Iterators.java:813)
>     at com.google.common.collect.Iterables.get(Iterables.java:728)
>     at 
> org.jclouds.softlayer.compute.strategy.SoftLayerComputeServiceAdapter.createNodeWithGroupEncodedIntoName(SoftLayerComputeServiceAdapter.java:129)
>   
> Code snippet
> //inst is a local object to contain the template information
>         inst.setArchitecture(ArchitectureEnum.BIT64.getNumber());
>         inst.setVcpus(1);
>         inst.setMemory(512);
>         inst.setZone("138124");
>         inst.setName("abcd");
>         inst.setOsFamily("RHEL");
> .
> .
> .
> templateBuilder = templateBuilder.from("minRam="
>                               + (int) inst.getMemory()
>                               + ",os64Bit="
>                               + inst.getArchitecture().equals(
>                                               
> ArchitectureEnum.BIT64.getNumber()) + ",minCores="
>                               + inst.getVcpus() + ",osFamily=" + 
> inst.getOsFamily()
>                               + ",locationId=" + location);
>               templateBuilder = templateBuilder.smallest();
> .
> .
> .
> template.getOptions().as(SoftLayerTemplateOptions.class).domainName("me.org");
>         
> template.getOptions().as(SoftLayerTemplateOptions.class).networks("253152","260523");
> NodeAndInitialCredentials<VirtualGuest> guest = 
> adapter.createNodeWithGroupEncodedIntoName(group, name, template);



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

Reply via email to