Hi,<div><br></div><div>Maybe you can try the following code, it's a simple request to check if the code can request the user's info, the equivalent of 'onevm show'.</div><div><br></div><div>What OpenNebula version are you using? Did you make sure you downloaded the java bindings for the same version?</div>
<div><br></div><div><br></div><div>Regards</div><div><br></div><div><br></div><div><div>import org.opennebula.client.*;</div><div>import org.opennebula.client.user.*;</div><div><br></div><div>public class SessionInit {</div>
<div><br></div><div> public static void main(String[] args)</div><div> {</div><div> try</div><div> {</div><div>// Client client = new Client();</div><div>// Client client = new Client("oneadmin:onead", null);</div>
<div> Client client = new Client("oneadmin:onead", "<a href="http://localhost:2633/RPC2">http://localhost:2633/RPC2</a>");</div><div><br></div><div> User user = new User(-1, client);</div>
<div> OneResponse res = <a href="http://user.info">user.info</a>();</div><div> </div><div> if( res.isError() )</div><div> {</div><div> System.out.println( res.getErrorMessage() );</div>
<div> }</div><div> else</div><div> {</div><div> System.out.println( "User name: " + user.getName() );</div><div> }</div><div> }</div><div> catch (Exception e)</div>
<div> {</div><div> System.out.println(e.getMessage());</div><div> }</div><div> }</div><div>}</div></div><div><br></div><div><br></div><div><br clear="all">--<br>Carlos Martín, MSc<br>Project Engineer<br>
OpenNebula - The Open-source Solution for Data Center Virtualization<div><span style="border-collapse:collapse;color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px"><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:cmartin@opennebula.org" target="_blank">cmartin@opennebula.org</a> | <a href="http://twitter.com/opennebula" target="_blank">@OpenNebula</a></span><span style="border-collapse:collapse;color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px"><a href="mailto:cmartin@opennebula.org" style="color:rgb(42,93,176)" target="_blank"></a></span></div>
<br>
<br><br><div class="gmail_quote">On Wed, Oct 31, 2012 at 1:00 PM, rajesh kannan <span dir="ltr"><<a href="mailto:asrajeshkannan@gmail.com" target="_blank">asrajeshkannan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Really happy to see u reply sir ........thank u sir<div><br></div><div><div>oneadmin@SONY-VAIO:~/lib/java$ oneuser show</div><div>USER 0 INFORMATION </div><div>
ID : 0 </div>
<div>NAME : oneadmin </div><div>GROUP : oneadmin </div><div>PASSWORD : cb01da439fe2ec212349424491de000f26809212</div><div>AUTH_DRIVER : core </div><div>ENABLED : Yes </div>
<div><br></div><div>USER TEMPLATE </div><div><br></div><div><br></div><div>RESOURCE USAGE & QUOTAS </div>
<div><br></div><div>oneadmin@SONY-VAIO:~/lib/java$ onevm list</div><div> ID USER GROUP NAME STAT UCPU UMEM HOST TIME</div><div> 0 oneadmin oneadmin ttylinux fail 0 0K 0d 00h17</div>
<div> 1 oneadmin oneadmin ttylinux stop 99 512M 1d 19h24</div><div>oneadmin@SONY-VAIO:~/lib/java$ onevm resubmit 1</div><div>oneadmin@SONY-VAIO:~/lib/java$ onevm list</div><div> ID USER GROUP NAME STAT UCPU UMEM HOST TIME</div>
<div> 0 oneadmin oneadmin ttylinux fail 0 0K 0d 00h17</div><div> 1 oneadmin oneadmin ttylinux pend 99 512M 1d 19h24</div></div><div><br></div><div><br></div><div>
Here CLI commands working but when am going to use Java program its not working </div><div><br></div><div>i dont know what was problem </div><div class="HOEnZb"><div class="h5"><div><br></div><div class="gmail_extra"><br>
<br><div class="gmail_quote">On 31 October 2012 16:29, Carlos Martín Sánchez <span dir="ltr"><<a href="mailto:cmartin@opennebula.org" target="_blank">cmartin@opennebula.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div><br></div><div><div style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">Can you execute CLI commands with those "oneadmin:onead" credentials? Try any command, like 'oneuser show' or 'onevm list'</div>
--<br>Carlos Martín, MSc<br>Project Engineer<br>OpenNebula - The Open-source Solution for Data Center Virtualization<div><span style="border-collapse:collapse;color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px"><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:cmartin@opennebula.org" target="_blank">cmartin@opennebula.org</a> | <a href="http://twitter.com/opennebula" target="_blank">@OpenNebula</a></span><span style="border-collapse:collapse;color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px"><a href="mailto:cmartin@opennebula.org" style="color:rgb(42,93,176)" target="_blank"></a></span></div>
<br>
<br><br><div class="gmail_quote"><div><div>On Wed, Oct 31, 2012 at 5:28 AM, rajesh kannan <span dir="ltr"><<a href="mailto:asrajeshkannan@gmail.com" target="_blank">asrajeshkannan@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
sorry for asking once again because i dont have choice to ask any one so pls help me ....i had this problem past one month.... i try out all possibility ....i refer all your passed question on [one_users] ...they are said about only ONE_AUTH file but am specified correctly .....<div>
<br></div><div>i dont know what was the problem pls help..............</div><div><br></div><div>//this java program given in opennebula websites<br></div><div><br></div><div>// i made only changes on this only </div><div>
<br></div><div>//passing the parameter username:password and XML-RPC</div><div><br></div><div>//then change the vmTemplate Variable </div><div><br></div><div><br></div><div><div>Client oneClient = new Client("oneadmin:onead","<a href="http://localhost:2633/RPC2" target="_blank">http://localhost:2633/RPC2</a>");</div>
<div> </div><div> String vmTemplate =</div><div> "NAME = vm_from_java CPU = 0.1 MEMORY = 64\n"</div><div> + "DISK = [\n"</div><div> + "\tsource = \"/var/lib/images/ttylinux.img\",\n"</div>
<div> + "\ttarget = \"hda\",\n"</div><div> +"\thostname = \"$NAME\",\n"</div><div> +"\tip_public = \"PUBLIC_IP\",\n"</div><div> +"\t root_pubkey = \"id_rsa\",\n"</div>
<div> +"\tfiles = \"/var/lib/one/init.sh ~/.ssh/id_rsa\",\n"</div><div> +"\tusername = \"opennebula\",\n"</div><div> +"\tuser_pubkey = \"id_rsa\",\n"</div>
<div> + "\treadonly = \"no\" ]\n"</div><div> + "FEATURES = [ acpi=\"no\" ]";</div><div><br></div><div>oneadmin@SONY-VAIO:~/lib/java$ javac vmcre.java <br></div><div> </div>
</div><div><div>oneadmin@SONY-VAIO:~/lib/java$ java vmcre </div></div><div><br></div><div>ERRR</div><div><div>[VirtualMachineAllocate] User couldn't be authenticated, aborting call.</div></div><div><br></div><div><br>
</div><div>when i try to install opennebula i did this kind of ssh operation </div><div><div><br></div><div><br></div><div>su -l oneadmin</div><div>ssh-keygen</div><div>{Note - all defaults, and no passphrase.}</div><div>
cat ~/.ssh/id_rsa.pub > ~/.ssh/authorized_keys</div><div>nano ~/.ssh/config</div><div>[add below two lines to SSH config file]</div><div>Host *</div></div><div><div>StrictHostKeyCheckingno</div></div><div><br></div><div>
<br></div><div>Is there any problem on this????????</div><div><br></div><div><br></div><div>Env variable </div><div><br></div><div><div>oneadmin@SONY-VAIO:~/lib/java$ cat ~/.bash_profile </div><div><br></div><div><br></div>
<div>export ONE_LOCATION=/var/lib/one</div><div>export ONE_AUTH=$ONE_LOCATION/.one/one_auth</div><div>export ONE_XMLRPC=<a href="http://localhost:2633/RPC2" target="_blank">http://localhost:2633/RPC2</a></div><div>export PATH=$ONE_LOCATION/bin:/usr/local/bin:/var/lib/gems/1.8/bin/:/var/lib/gems/1.8/:$PATH</div>
<div><br></div></div><div><br></div><div>Username:password ONE_AUTH file</div><div><br></div><div><div>oneadmin@SONY-VAIO:~/lib/java$ cat ~/.one/one_auth </div><div><br></div><div>oneadmin:onead </div><div><br></div>
<div>//(Username:password)</div></div><div><br></div><div><br></div><div><div>oneadmin@SONY-VAIO:~/lib/java$ cat ~/etc/oned.conf </div></div><div><br></div><div><div>AUTH_MAD = [</div><div> executable = "one_auth_mad",</div>
<div>arguments = "--authn ssh,x509,ldap,server_cipher,server_x509" ]<br></div><div><br></div></div><div>uncomment this line also <br></div><div><br></div><div><br></div><div><br></div><div>i dont know what else suppose to do to recover this problem </div>
<div><br></div><div>sorry for distrub </div><div><br></div><div>i need to finish the project on this month pls help me</div><div><br></div><div>if u know something else do on this pls mail me</div><div><br></div><div>................if know please help...................</div>
<br></div></div>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org" target="_blank">Users@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>