Re: [one-users] error deploying the guest on VMWARE Host

2011-12-09 Thread Siva Prasad

can Any body give an idea on this?

thanks,
Siva

On 12/8/2011 3:00 PM, Siva Prasad wrote:

Hi All,

I am getting the following error when i deploy the vm (with onedeploy 
1 2) in vm.log after the disk is transffered.


Thu Dec  8 14:39:01 2011 [VMM][E]: Wrong target value in DISK.
Thu Dec  8 14:39:01 2011 [VMM][E]: deploy_action, error generating 
deployment file: /one/var/2/deployment.0


my onehost shows the following:


oneadmin@onserver:~/var/2$ onehost list
  ID NAME   RVM   TCPU   FCPU   ACPU   TMEM   FMEM   
AMEM   STAT

   1 10.2.1.2000200200200   2.9G   2.3G   2.9G on
---


my private.net file.

oneadmin@oneserver:~/var/2$ onevnet show 0
VIRTUAL NETWORK 0 INFORMATION
ID : 0
USER   : oneadmin
GROUP  : oneadmin
PUBLIC : No
USED LEASES: 2

VIRTUAL NETWORK TEMPLATE
BRIDGE=eth0
NAME=Private
NETWORK_ADDRESS=10.2.1.0
NETWORK_SIZE=250
TYPE=RANGED

LEASES INFORMATION
LEASE=[ IP=10.2.1.1, MAC=02:00:c0:a8:08:01, USED=1, VID=1 ]
LEASE=[ IP=10.2.1.2, MAC=02:00:c0:a8:08:02, USED=1, VID=2 ]



my onevm.template file ( this is the file i am using to create onevm )


oneadmin@onserver:~/var/2$ cat ../../config/onevm.template
NAME=VMwareVM
MEMORY=256
CPU=1

NIC=[NETWORK_ID = 0 ]

DISK=[ source=/one/var/images/StaticbaseImg,
   clone=yes,
   save=no]
oneadmin@leopard3:~/var/2$





file  /one/var/2/images/disk.0 gets created, the vm.log show the 
following


Thu Dec  8 14:57:05 2011 [LCM][I]: New VM state is BOOT
Thu Dec  8 14:57:05 2011 [VMM][I]: Generating deployment file: 
/one/var/2/deployment.0

Thu Dec  8 14:57:05 2011 [VMM][E]: Wrong target value in DISK.
Thu Dec  8 14:57:05 2011 [VMM][E]: deploy_action, error generating 
deployment file: /one/var/4/deployment.0

Thu Dec  8 14:57:05 2011 [DiM][I]: New VM state is FAILED.

Please help me

Thanks,
siva






___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


Re: [one-users] xmlrpc client

2011-12-09 Thread Ksenija Poljak
Even when I use that API, I still get Unauthorized exception.
What is the proper way to form a session string that gets user (for start
oneadmin) authenticated and authorized in Java client so that I can test
other methods?
I use client function: Client client = new Client(session_string,
server_url);

public *Client*(java.lang.String secret,
  java.lang.String endpoint)
   throws ClientConfigurationException
http://opennebula.org/doc/3.0/oca/java/org/opennebula/client/ClientConfigurationException.html



On Thu, Dec 8, 2011 at 5:16 PM, Prakhar Srivastava prakhar@gmail.comwrote:

 Hi Ksenija,
 Why don't you simply use the Java OpenNebula Cloud 
 APIhttp://opennebula.org/documentation:rel3.0:java that
 is packaged with opennebula. If there is no specific scenario, its best to
 use them.

 Prakhar

 On Thu, Dec 8, 2011 at 3:23 PM, Ksenija Poljak ksenija.pol...@altus-it.hr
  wrote:

 Hi, I'm using opennebula 3 and I'm trying to write an xmlrpc Java client.
 I'm not able to connect my client to opennebula server.
 I keep getting unauthorized exception:

 org.apache.xmlrpc.client.XmlRpcHttpTransportException: HTTP server
 returned unexpected status: Unauthorized

 My testing program:

 package open.nebula.client;


 import java.net.MalformedURLException;
 import java.net.URL;

 import org.apache.xmlrpc.XmlRpcException;
 import org.apache.xmlrpc.client.XmlRpcClient;
 import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;

 public class OpenNebulaClient{
  private XmlRpcClient client = new XmlRpcClient();;
 private XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
  private String session =
 oneadmin:ffd775fdb8e47ebf5b68513843f31742f74118e8;
  public OpenNebulaClient(String server_url)
 {
 try{
  this.config.setServerURL(new URL(server_url));
 this.client.setConfig(this.config);
  }catch(MalformedURLException e){
 System.err.println(e);
 }
  }
  public void getUserInfo(int id) throws XmlRpcException
  {
 Object[] params = {session,id};
 try {
 Object[] result = (Object[])this.client.execute(
 one.user.info,params);
 if(!result[0].equals(null)) {
 boolean success = (Boolean)result[0];
 String str_res = (String)result[1];
 System.out.println(success=+success);
 System.out.println(result=+str_res);
 }else{
 System.out.println(success=0);
 }
 }catch (XmlRpcException e) {
 System.err.println(e);
  //e.printStackTrace();
 }
 }
  public static void main(String[] args)
 {
 OpenNebulaClient on_client = new

  OpenNebulaClient(http://server_ip:port/RPC2;);
 try{
 on_client.getUserInfo(0);
  }catch(XmlRpcException xmlrpce){
 System.err.println(xmlrpce);
 }
  }
 }


 I'm confused becose when I look at examples on the web, there are methods
 used as one.userinfo, and on opennebula official site they are listed in
 form: one.user.info.
 Session string I used consists of username:password that I get listed
 with command: 'oneuser show 0' on opennebula server.
 Client and opennebula server are on different machines.
 I'm not sure what I do wrong. Any suggestions would be more than
 helpfull. Tnx in advance.

 the full stackTrace of error:

 org.apache.xmlrpc.client.XmlRpcHttpTransportException: HTTP server
 returned unexpected status: Unauthorized
 at
 org.apache.xmlrpc.client.XmlRpcSunHttpTransport.getInputStream(XmlRpcSunHttpTransport.java:94)
  at
 org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:152)
 at
 org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:143)
  at
 org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
 at
 org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
  at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
 at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:137)
  at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:126)
 at
 open.nebula.client.OpenNebulaClient.getUserInfo(OpenNebulaClient.java:30)
  at open.nebula.client.OpenNebulaClient.main(OpenNebulaClient.java:49)

 ___
 Users mailing list
 Users@lists.opennebula.org
 http://lists.opennebula.org/listinfo.cgi/users-opennebula.org



 ___
 Users mailing list
 Users@lists.opennebula.org
 http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


Re: [one-users] xmlrpc client

2011-12-09 Thread Prakhar Srivastava
Hi,
This is how I create a connection to the server
oneClient = new Client(oneadmin:onepass,http://192.168.1.5:2633/RPC2;);

Check that you are using the
import org.opennebula.client.Client;

to make user that you are using the correct client. Also send the
stacktrace if you are still facing problems.

Prakhar

On Fri, Dec 9, 2011 at 5:03 PM, Ksenija Poljak
ksenija.pol...@altus-it.hrwrote:

 Even when I use that API, I still get Unauthorized exception.
 What is the proper way to form a session string that gets user (for start
 oneadmin) authenticated and authorized in Java client so that I can test
 other methods?
 I use client function: Client client = new Client(session_string,
 server_url);

 public *Client*(java.lang.String secret,
   java.lang.String endpoint)
throws ClientConfigurationException 
 http://opennebula.org/doc/3.0/oca/java/org/opennebula/client/ClientConfigurationException.html



 On Thu, Dec 8, 2011 at 5:16 PM, Prakhar Srivastava 
 prakhar@gmail.comwrote:

 Hi Ksenija,
 Why don't you simply use the Java OpenNebula Cloud 
 APIhttp://opennebula.org/documentation:rel3.0:java that
 is packaged with opennebula. If there is no specific scenario, its best to
 use them.

 Prakhar

 On Thu, Dec 8, 2011 at 3:23 PM, Ksenija Poljak 
 ksenija.pol...@altus-it.hr wrote:

 Hi, I'm using opennebula 3 and I'm trying to write an xmlrpc Java client.
 I'm not able to connect my client to opennebula server.
 I keep getting unauthorized exception:

 org.apache.xmlrpc.client.XmlRpcHttpTransportException: HTTP server
 returned unexpected status: Unauthorized

 My testing program:

 package open.nebula.client;


 import java.net.MalformedURLException;
 import java.net.URL;

 import org.apache.xmlrpc.XmlRpcException;
 import org.apache.xmlrpc.client.XmlRpcClient;
 import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;

 public class OpenNebulaClient{
  private XmlRpcClient client = new XmlRpcClient();;
 private XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
  private String session =
 oneadmin:ffd775fdb8e47ebf5b68513843f31742f74118e8;
  public OpenNebulaClient(String server_url)
 {
 try{
  this.config.setServerURL(new URL(server_url));
 this.client.setConfig(this.config);
  }catch(MalformedURLException e){
 System.err.println(e);
 }
  }
  public void getUserInfo(int id) throws XmlRpcException
  {
 Object[] params = {session,id};
 try {
 Object[] result = (Object[])this.client.execute(
 one.user.info,params);
 if(!result[0].equals(null)) {
 boolean success = (Boolean)result[0];
 String str_res = (String)result[1];
 System.out.println(success=+success);
 System.out.println(result=+str_res);
 }else{
 System.out.println(success=0);
 }
 }catch (XmlRpcException e) {
 System.err.println(e);
  //e.printStackTrace();
 }
 }
  public static void main(String[] args)
 {
 OpenNebulaClient on_client = new

  OpenNebulaClient(http://server_ip:port/RPC2;);
 try{
 on_client.getUserInfo(0);
  }catch(XmlRpcException xmlrpce){
 System.err.println(xmlrpce);
 }
  }
 }


 I'm confused becose when I look at examples on the web, there are
 methods used as one.userinfo, and on opennebula official site they are
 listed in form: one.user.info.
 Session string I used consists of username:password that I get listed
 with command: 'oneuser show 0' on opennebula server.
 Client and opennebula server are on different machines.
 I'm not sure what I do wrong. Any suggestions would be more than
 helpfull. Tnx in advance.

 the full stackTrace of error:

 org.apache.xmlrpc.client.XmlRpcHttpTransportException: HTTP server
 returned unexpected status: Unauthorized
 at
 org.apache.xmlrpc.client.XmlRpcSunHttpTransport.getInputStream(XmlRpcSunHttpTransport.java:94)
  at
 org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:152)
 at
 org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:143)
  at
 org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
 at
 org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
  at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
 at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:137)
  at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:126)
 at
 open.nebula.client.OpenNebulaClient.getUserInfo(OpenNebulaClient.java:30)
  at open.nebula.client.OpenNebulaClient.main(OpenNebulaClient.java:49)

 ___
 Users mailing list
 Users@lists.opennebula.org
 http://lists.opennebula.org/listinfo.cgi/users-opennebula.org



 ___
 Users mailing list
 Users@lists.opennebula.org
 http://lists.opennebula.org/listinfo.cgi/users-opennebula.org



 ___
 Users mailing list
 

Re: [one-users] xmlrpc client

2011-12-09 Thread Ksenija Poljak
I do the same thing and is not working. This line alone does not cause any
problems. But when I try to use UserPool.info(client); or any other method,
returned error string is: HTTP server returned unexpected status:
Unauthorized.

On Fri, Dec 9, 2011 at 12:52 PM, Prakhar Srivastava
prakhar@gmail.comwrote:

 Hi,
 This is how I create a connection to the server
 oneClient = new Client(oneadmin:onepass,http://192.168.1.5:2633/RPC2;);

 Check that you are using the
 import org.opennebula.client.Client;

 to make user that you are using the correct client. Also send the
 stacktrace if you are still facing problems.

 Prakhar


 On Fri, Dec 9, 2011 at 5:03 PM, Ksenija Poljak ksenija.pol...@altus-it.hr
  wrote:

 Even when I use that API, I still get Unauthorized exception.
 What is the proper way to form a session string that gets user (for start
 oneadmin) authenticated and authorized in Java client so that I can test
 other methods?
 I use client function: Client client = new Client(session_string,
 server_url);

 public *Client*(java.lang.String secret,
   java.lang.String endpoint)
throws ClientConfigurationException 
 http://opennebula.org/doc/3.0/oca/java/org/opennebula/client/ClientConfigurationException.html



 On Thu, Dec 8, 2011 at 5:16 PM, Prakhar Srivastava prakhar@gmail.com
  wrote:

 Hi Ksenija,
 Why don't you simply use the Java OpenNebula Cloud 
 APIhttp://opennebula.org/documentation:rel3.0:java that
 is packaged with opennebula. If there is no specific scenario, its best to
 use them.

 Prakhar

 On Thu, Dec 8, 2011 at 3:23 PM, Ksenija Poljak 
 ksenija.pol...@altus-it.hr wrote:

 Hi, I'm using opennebula 3 and I'm trying to write an xmlrpc Java
 client.
 I'm not able to connect my client to opennebula server.
 I keep getting unauthorized exception:

 org.apache.xmlrpc.client.XmlRpcHttpTransportException: HTTP server
 returned unexpected status: Unauthorized

 My testing program:

 package open.nebula.client;


 import java.net.MalformedURLException;
 import java.net.URL;

 import org.apache.xmlrpc.XmlRpcException;
 import org.apache.xmlrpc.client.XmlRpcClient;
 import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;

 public class OpenNebulaClient{
  private XmlRpcClient client = new XmlRpcClient();;
 private XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
  private String session =
 oneadmin:ffd775fdb8e47ebf5b68513843f31742f74118e8;
  public OpenNebulaClient(String server_url)
 {
 try{
  this.config.setServerURL(new URL(server_url));
 this.client.setConfig(this.config);
  }catch(MalformedURLException e){
 System.err.println(e);
 }
  }
  public void getUserInfo(int id) throws XmlRpcException
  {
 Object[] params = {session,id};
 try {
 Object[] result = (Object[])this.client.execute(
 one.user.info,params);
 if(!result[0].equals(null)) {
 boolean success = (Boolean)result[0];
 String str_res = (String)result[1];
 System.out.println(success=+success);
 System.out.println(result=+str_res);
 }else{
 System.out.println(success=0);
 }
 }catch (XmlRpcException e) {
 System.err.println(e);
  //e.printStackTrace();
 }
 }
  public static void main(String[] args)
 {
 OpenNebulaClient on_client = new

  OpenNebulaClient(http://server_ip:port/RPC2;);
 try{
 on_client.getUserInfo(0);
  }catch(XmlRpcException xmlrpce){
 System.err.println(xmlrpce);
 }
  }
 }


 I'm confused becose when I look at examples on the web, there are
 methods used as one.userinfo, and on opennebula official site they are
 listed in form: one.user.info.
 Session string I used consists of username:password that I get listed
 with command: 'oneuser show 0' on opennebula server.
 Client and opennebula server are on different machines.
 I'm not sure what I do wrong. Any suggestions would be more than
 helpfull. Tnx in advance.

 the full stackTrace of error:

 org.apache.xmlrpc.client.XmlRpcHttpTransportException: HTTP server
 returned unexpected status: Unauthorized
 at
 org.apache.xmlrpc.client.XmlRpcSunHttpTransport.getInputStream(XmlRpcSunHttpTransport.java:94)
  at
 org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:152)
 at
 org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:143)
  at
 org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
 at
 org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
  at
 org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
 at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:137)
  at
 org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:126)
 at
 open.nebula.client.OpenNebulaClient.getUserInfo(OpenNebulaClient.java:30)
  at open.nebula.client.OpenNebulaClient.main(OpenNebulaClient.java:49)

 ___
 Users mailing list
 

Re: [one-users] xmlrpc client

2011-12-09 Thread Prakhar Srivastava
You appear to use the hashed password and not the password itself. Use the
real password to construct the session string.


On Fri, Dec 9, 2011 at 5:38 PM, Ksenija Poljak
ksenija.pol...@altus-it.hrwrote:

 I do the same thing and is not working. This line alone does not cause any
 problems. But when I try to use UserPool.info(client); or any other method,
 returned error string is: HTTP server returned unexpected status:
 Unauthorized.

 On Fri, Dec 9, 2011 at 12:52 PM, Prakhar Srivastava prakhar@gmail.com
  wrote:

 Hi,
 This is how I create a connection to the server
 oneClient = new Client(oneadmin:onepass,http://192.168.1.5:2633/RPC2
 );

 Check that you are using the
 import org.opennebula.client.Client;

 to make user that you are using the correct client. Also send the
 stacktrace if you are still facing problems.

 Prakhar


 On Fri, Dec 9, 2011 at 5:03 PM, Ksenija Poljak 
 ksenija.pol...@altus-it.hr wrote:

 Even when I use that API, I still get Unauthorized exception.
 What is the proper way to form a session string that gets user (for
 start oneadmin) authenticated and authorized in Java client so that I can
 test other methods?
 I use client function: Client client = new Client(session_string,
 server_url);

 public *Client*(java.lang.String secret,
   java.lang.String endpoint)
throws ClientConfigurationException 
 http://opennebula.org/doc/3.0/oca/java/org/opennebula/client/ClientConfigurationException.html



 On Thu, Dec 8, 2011 at 5:16 PM, Prakhar Srivastava 
 prakhar@gmail.com wrote:

 Hi Ksenija,
 Why don't you simply use the Java OpenNebula Cloud 
 APIhttp://opennebula.org/documentation:rel3.0:java that
 is packaged with opennebula. If there is no specific scenario, its best to
 use them.

 Prakhar

 On Thu, Dec 8, 2011 at 3:23 PM, Ksenija Poljak 
 ksenija.pol...@altus-it.hr wrote:

 Hi, I'm using opennebula 3 and I'm trying to write an xmlrpc Java
 client.
 I'm not able to connect my client to opennebula server.
 I keep getting unauthorized exception:

 org.apache.xmlrpc.client.XmlRpcHttpTransportException: HTTP server
 returned unexpected status: Unauthorized

 My testing program:

 package open.nebula.client;


 import java.net.MalformedURLException;
 import java.net.URL;

 import org.apache.xmlrpc.XmlRpcException;
 import org.apache.xmlrpc.client.XmlRpcClient;
 import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;

 public class OpenNebulaClient{
  private XmlRpcClient client = new XmlRpcClient();;
 private XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
  private String session =
 oneadmin:ffd775fdb8e47ebf5b68513843f31742f74118e8;
  public OpenNebulaClient(String server_url)
 {
 try{
  this.config.setServerURL(new URL(server_url));
 this.client.setConfig(this.config);
  }catch(MalformedURLException e){
 System.err.println(e);
 }
  }
  public void getUserInfo(int id) throws XmlRpcException
  {
 Object[] params = {session,id};
 try {
 Object[] result = (Object[])this.client.execute(
 one.user.info,params);
 if(!result[0].equals(null)) {
 boolean success = (Boolean)result[0];
 String str_res = (String)result[1];
 System.out.println(success=+success);
 System.out.println(result=+str_res);
 }else{
 System.out.println(success=0);
 }
 }catch (XmlRpcException e) {
 System.err.println(e);
  //e.printStackTrace();
 }
 }
  public static void main(String[] args)
 {
 OpenNebulaClient on_client = new

  OpenNebulaClient(http://server_ip:port/RPC2;);
 try{
 on_client.getUserInfo(0);
  }catch(XmlRpcException xmlrpce){
 System.err.println(xmlrpce);
 }
  }
 }


 I'm confused becose when I look at examples on the web, there are
 methods used as one.userinfo, and on opennebula official site they are
 listed in form: one.user.info.
 Session string I used consists of username:password that I get listed
 with command: 'oneuser show 0' on opennebula server.
 Client and opennebula server are on different machines.
 I'm not sure what I do wrong. Any suggestions would be more than
 helpfull. Tnx in advance.

 the full stackTrace of error:

 org.apache.xmlrpc.client.XmlRpcHttpTransportException: HTTP server
 returned unexpected status: Unauthorized
 at
 org.apache.xmlrpc.client.XmlRpcSunHttpTransport.getInputStream(XmlRpcSunHttpTransport.java:94)
  at
 org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:152)
 at
 org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:143)
  at
 org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
 at
 org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
  at
 org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
 at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:137)
  at
 org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:126)
 at
 

Re: [one-users] xmlrpc client

2011-12-09 Thread Ksenija Poljak
Thank you very much for your help.
The problem was actually in xmlrpc port. :)

On Fri, Dec 9, 2011 at 1:36 PM, Ksenija Poljak
ksenija.pol...@altus-it.hrwrote:

 I use the real password.


 On Fri, Dec 9, 2011 at 1:32 PM, Prakhar Srivastava 
 prakhar@gmail.comwrote:

 You appear to use the hashed password and not the password itself. Use
 the real password to construct the session string.


 On Fri, Dec 9, 2011 at 5:38 PM, Ksenija Poljak 
 ksenija.pol...@altus-it.hr wrote:

 I do the same thing and is not working. This line alone does not cause
 any problems. But when I try to use UserPool.info(client); or any other
 method, returned error string is: HTTP server returned unexpected status:
 Unauthorized.

 On Fri, Dec 9, 2011 at 12:52 PM, Prakhar Srivastava 
 prakhar@gmail.com wrote:

 Hi,
 This is how I create a connection to the server
 oneClient = new Client(oneadmin:onepass,http://192.168.1.5:2633/RPC2
 );

 Check that you are using the
 import org.opennebula.client.Client;

 to make user that you are using the correct client. Also send the
 stacktrace if you are still facing problems.

 Prakhar


 On Fri, Dec 9, 2011 at 5:03 PM, Ksenija Poljak 
 ksenija.pol...@altus-it.hr wrote:

 Even when I use that API, I still get Unauthorized exception.
 What is the proper way to form a session string that gets user (for
 start oneadmin) authenticated and authorized in Java client so that I can
 test other methods?
 I use client function: Client client = new Client(session_string,
 server_url);

 public *Client*(java.lang.String secret,
   java.lang.String endpoint)
throws ClientConfigurationException 
 http://opennebula.org/doc/3.0/oca/java/org/opennebula/client/ClientConfigurationException.html



 On Thu, Dec 8, 2011 at 5:16 PM, Prakhar Srivastava 
 prakhar@gmail.com wrote:

 Hi Ksenija,
 Why don't you simply use the Java OpenNebula Cloud 
 APIhttp://opennebula.org/documentation:rel3.0:java that
 is packaged with opennebula. If there is no specific scenario, its best 
 to
 use them.

 Prakhar

 On Thu, Dec 8, 2011 at 3:23 PM, Ksenija Poljak 
 ksenija.pol...@altus-it.hr wrote:

 Hi, I'm using opennebula 3 and I'm trying to write an xmlrpc Java
 client.
 I'm not able to connect my client to opennebula server.
 I keep getting unauthorized exception:

 org.apache.xmlrpc.client.XmlRpcHttpTransportException: HTTP server
 returned unexpected status: Unauthorized

 My testing program:

 package open.nebula.client;


 import java.net.MalformedURLException;
 import java.net.URL;

 import org.apache.xmlrpc.XmlRpcException;
 import org.apache.xmlrpc.client.XmlRpcClient;
 import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;

 public class OpenNebulaClient{
  private XmlRpcClient client = new XmlRpcClient();;
 private XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
  private String session =
 oneadmin:ffd775fdb8e47ebf5b68513843f31742f74118e8;
  public OpenNebulaClient(String server_url)
 {
 try{
  this.config.setServerURL(new URL(server_url));
 this.client.setConfig(this.config);
  }catch(MalformedURLException e){
 System.err.println(e);
 }
  }
  public void getUserInfo(int id) throws XmlRpcException
  {
 Object[] params = {session,id};
 try {
 Object[] result = (Object[])this.client.execute(
 one.user.info,params);
 if(!result[0].equals(null)) {
 boolean success = (Boolean)result[0];
 String str_res = (String)result[1];
 System.out.println(success=+success);
 System.out.println(result=+str_res);
 }else{
 System.out.println(success=0);
 }
 }catch (XmlRpcException e) {
 System.err.println(e);
  //e.printStackTrace();
 }
 }
  public static void main(String[] args)
 {
 OpenNebulaClient on_client = new

  OpenNebulaClient(http://server_ip:port/RPC2;);
 try{
 on_client.getUserInfo(0);
  }catch(XmlRpcException xmlrpce){
 System.err.println(xmlrpce);
 }
  }
 }


 I'm confused becose when I look at examples on the web, there are
 methods used as one.userinfo, and on opennebula official site they are
 listed in form: one.user.info.
 Session string I used consists of username:password that I get
 listed with command: 'oneuser show 0' on opennebula server.
 Client and opennebula server are on different machines.
 I'm not sure what I do wrong. Any suggestions would be more than
 helpfull. Tnx in advance.

 the full stackTrace of error:

 org.apache.xmlrpc.client.XmlRpcHttpTransportException: HTTP server
 returned unexpected status: Unauthorized
 at
 org.apache.xmlrpc.client.XmlRpcSunHttpTransport.getInputStream(XmlRpcSunHttpTransport.java:94)
  at
 org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:152)
 at
 org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:143)
  at
 org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
 at
 

Re: [one-users] Creating virtual machines from scratch

2011-12-09 Thread Fabian Wenk

Hello Richard

On 08.12.2011 17:45, richard -rw- weinberger wrote:

I'm a bit confused how to create a vm from scratch.
Assume I want a vm running with CentOS6 and a new virtual hard disk of 500GiB.

How can I create a new disk using OpenNebula (especially with Sunstone)?


I do not know how to do this steps in Sunstone, I did it with the 
command line tools.


Create the image manually (outside of OpenNebula) with this steps 
(for KVM):


On a system which has KVM available:
qemu-img create -f raw servername.img 10G
qemu-system-x86_64 -hda servername.img -cdrom 
/path/to/install.iso -boot d -m 512
Connect through VNC for installation, the above command will 
report you the used port (default 5900), see blow as 
qemu-system-x86_64 listen only on localhost for VNC

qemu-system-x86_64 servername.img -m 512  # to test after install
Connect through VNC
login and run 'poweroff' as root or with sudo

Now on the front-end:
Create an image template (servername-image.one)
oneimage register servername-image.one
Create an VM template for the host (servername.one)
onevm create servername.one


Connect to VNC on the cluster node:
I do not know about your workstation, but from my Mac client I 
use Chicken [1], which supports connection through ssh. I guess 
there is a VNC client for the OS of your workstation available 
which also can do this. Else you could run it with manual ssh 
forwarding like this:

ssh -L localhost:5900:localhost:5907 server-with-KVM
replace 5907 with the port which qemu-system-x86_64 as reported 
and then use the local VNC client to connect to localhost port 5900.


   [1] http://sourceforge.net/projects/chicken/


In my setup each vm will have it's own disk image, thus no disk image
needs to be copied.
Is there a way to enforce this?


The best is to register each image in the Image Repository with 
'oneimage register ...'



A final question, is it possible to change the boot order of a vm?
Do I really have to delete and recreate it?


You need to shutdown and recreate the VM. Best done with the 
command line tool 'onevm create template' and the template you 
can modify.



bye
Fabian
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


Re: [one-users] Access network by name (custom attributes)

2011-12-09 Thread Fabian Wenk

Hello Tomáš

On 09.12.2011 10:42, Tomáš Nechutný wrote:

possible to define network by name (instead of id)? I tried
NETWORK=local, NETWORK=\local\ and same with NAME instead of
NETWORK_ID=1, but it doesn't work.


As far as I know with OpenNebula 3.0 only IDs can be uses.


bye
Fabian
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


Re: [one-users] [help]Could not create domain

2011-12-09 Thread cat fa
I modified the user and group in /etc/libvirt/qemu.conf , is that correct?

2011/12/10 Fabian Wenk fab...@wenks.ch

 Hello Cat


 On 09.12.2011 14:35, cat fa wrote:

 Fri Dec  9 04:31:57 2011 [VMM][I]: Command execution fail: 'if [ -x
 /var/tmp/one/vmm/kvm/deploy ]; then /var/tmp/one/vmm/kvm/deploy
 /var/lib/one//10/images/**deployment.0 1.185.4.109 10 1.185.4.109; else
 exit 42; fi'
 Fri Dec  9 04:31:57 2011 [VMM][I]: error: Failed to create domain from
 /var/lib/one//10/images/**deployment.0


 Is the configuration for libvirtd correct does is allow to be usesed by
 the oneadmin user or one of his groups it is member of?


 bye
 Fabian
 __**_
 Users mailing list
 Users@lists.opennebula.org
 http://lists.opennebula.org/**listinfo.cgi/users-opennebula.**orghttp://lists.opennebula.org/listinfo.cgi/users-opennebula.org

___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org