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

Reply via email to