Hi, Please find the below stacktrace,
java.util.NoSuchElementException: no nodes matched filter: inGroup(jcloud1) at org.jclouds.compute.internal.BaseComputeService.nodesMatchingFilterAndNotTerminatedExceptionIfNotFound(BaseComputeService.java:325) at org.jclouds.compute.internal.BaseComputeService.runScriptOnNodesMatching(BaseComputeService.java:579) at org.jclouds.examples.compute.basics.MainApp.main(MainApp.java:187) error: no nodes matched filter: inGroup(jcloud1) Also let me know how keypair and groupname is related in jcloud. If i dont use existing key pair i dont find the above issue. ``` Template template = templateBuilder.build(); template.getOptions().as(AWSEC2TemplateOptions.class).subnetId("subnet-a1e1d08b"). keyPair("jclouds#jcloud").overrideLoginPrivateKey(login.credential); ``` Thanks & Regards, Poornima.BS On Wed, Dec 7, 2016 at 10:40 PM, Ignasi Barrera <n...@apache.org> wrote: > Could you please paste the complete stacktrace for the failure? > > On 7 December 2016 at 15:34, Poornima BS <poornimabs.g...@gmail.com> > wrote: > > Hi, > > > > Since i was using AdminAccess.standard() it was copying my local .pub > > content into authorization keys. > > > > Also i changed the user name to "ubuntu" it started working. Thank u > > > > > > Can u please let me know how jcloud works wrt groupName and keypair > > > > 1. Suppose my groupName and key pair is as below > > > > String groupName = "jcloud"; > > > > keyPair("jclouds#jcloud") > > > > Then execution of script works fine i.e runScriptOnNodesMatching > > > > 2. if i give a different groupName say, > > > > String groupName = "jcloudTest"; > > > > keyPair("jclouds#jcloud") > > > > Then runScriptOnNodesMatching gives error: no nodes matched filter: > > inGroup(jcloudTest) > > > > Please let me know how groupName and keypair work together > > > > 3. Also keypair is expected to be appended with jclouds# > > > > > > Thank u so much for the previous solution. > > > > Thanks & regards, > > Poornima.BS > > > > > > On Wed, Dec 7, 2016 at 6:17 PM, Valentin Aitken < > > valentin.ait...@cloudsoftcorp.com> wrote: > > > >> Hi Poornima, > >> > >> Is it giving you an authentication error with no keyPair setting? > >> > >> Did you obtained computeService with proper identity and credential? > >> > >> Valentin. > >> > >> > >> > >> On 07/12/16 14:18, Poornima BS wrote: > >> > >>> Hi, > >>> > >>> I have started using jclouds from past few days. I have some doubts. > >>> > >>> After some googling i came to how we use an existing key pair as below, > >>> > >>> Template template = templateBuilder.build(); > >>> template.getOptions().as(AWSEC2TemplateOptions.class). > >>> subnetId("subnet-a1e1d08b"). > >>> keyPair("jclouds#jcloud").overrideLoginPrivateKey(login. > >>> credential); > >>> > >>> The above code uses the existing keypair. > >>> > >>> But when i try to run script on nodes, it fails giving error > Authetication > >>> Exception, > >>> > >>> Map<? extends NodeMetadata, ExecResponse> responses = compute. > >>> runScriptOnNodesMatching(// > >>> inGroup(groupName), // predicate used to select > nodes > >>> exec(command), // what you actually intend to run > >>> overrideLoginCredentials(login) // use my local > user & > >>> // ssh key > >>> .runAsRoot(false) // don't attempt to run as > root > >>> (sudo) > >>> .wrapInInitScript(false));// run command > directly > >>> > >>> Please do the needful and let me know if i am doing correct. > >>> > >>> Thanks and Regards, > >>> Poornima.BS > >>> > >>> > >> >