Re: [one-users] Xen driver and automatic VNC port generation

2010-10-08 Thread Tiago Batista
It does work as long as it is opennebula generating the port numbers
(with 5900 as the base) and it does work for static port assignments:

the template

GRAPHICS =[type=vnc, passwd=qwerty, port=5900]

translates to vncdisplay=0 that is translated by xen back to 5900...

and the template

GRAPHICS =[type=vnc, passwd=qwerty]

translates to vncdisplay=vmId that is translated by xen back to
5900+vmid as intended

The current code translates port 5900 to vncdisplay 5900, xen then
adds another 5900, ending up listening on port 11800 while openebula
claims the port to be 5900! So, I am just offsetting the 5900 that is
going to be added by xen on the next step!

What is the situation where opennebula is not the generator of the
port number? I have tested it successfully with and without port
numbers on the template, and I think of no usecase where this fails as
long as VNC_BASE_PORT=5900...

Tiago




On Thu, Oct 7, 2010 at 10:51 PM, Ruben S. Montero rube...@dacya.ucm.es wrote:

 Hi
 Yes this is a Xen specific bug. vncdisplay sets the port by adding 5900. That 
 is already done by OpenNebula (e.g. to use it with KVM).
 So your solution seems fine for the port generation but, if the port is not 
 generated by OpenNebula we will be substracting 5900...
 Thanks for the feedback!
 Ruben
 On Wed, Oct 6, 2010 at 5:17 PM, Tiago Batista tiagosbati...@gmail.com wrote:

 Hello all

 I am using Centos, and to be honnest I am not sure if this is platform 
 specific, but the standard port generation code for xen does not work here 
 (both 2.0 beta 1 and rc1)

 The following patch solves it but forces the base port in oned.conf to be 
 set to 5900 if using the xen driver.

 I rememmber reading somewhere that the port number is 5900 + vnc  display 
 number... In this case I used the generated port number to calculate the 
 display number, but given that the port number is calculated from the VM id, 
 I expect that there should be a cleaner way to do this!

 Anyway This solves my problem!


 --- one-2.0-beta1/src/vmm/XenDriver.cc    2010-07-27 15:34:04.0 +0100
 +++ one-2.0-beta1_mod/src/vmm/XenDriver.cc    2010-09-21 10:07:32.0 
 +0100
 @@ -364,12 +364,10 @@
  {
  file  ,vnclisten=  listen;
  }
 -
  if ( !port.empty() )
  {
 -    file  ,vncdisplay=  port;
 +    file  ,vncdisplay=  (atoi(port.c_str())-5900);
  }
 -
  if ( !passwd.empty() )
  {
  file  ,vncpasswd=  passwd;




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




 --
 Dr. Ruben Santiago Montero
 Associate Professor (Profesor Titular), Complutense University of Madrid

 URL: http://dsa-research.org/doku.php?id=people:ruben
 Weblog: http://blog.dsa-research.org/?author=7
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


Re: [one-users] Alternative java bindings

2010-10-08 Thread Tiago Batista
Thanks,

This is my first JAXB experience, so looking at someone else's code
actually helped a lot on what I am doing...

I am mostly writing stylesheets for the rpc responses, so I am still
not at the point where I want to be, my current purpose with this is
to expose most or all of the functionality to a java experienced
programmer, removing as much of the opennebula specific parlance as
possible (notice that *Pool becomes a list() as an example).

As a test application, I am exposing the methods as a web service
(opennebula specific), something like a soap interface for the rpc...
If there is interest, I think I can release the full app (have to ask
my superiors)...

As for the rpc responses, I have found a few inconsistencies, mostly
between the *.info and the *pool.info methods that are slowing me down
a bit as I have to account for them... Is this expected behavior or a
bug?

As an example note the USERNAME:

xs:complexType name=vmType
xs:sequence
xs:element name=ID type=xs:int /
xs:element name=UID type=xs:int /
xs:element name=USERNAME type=xs:string minOccurs=0
/ !-- only on the pool --
xs:element name=NAME type=xs:string /
xs:element name=LAST_POLL type=xs:unsignedLong /
xs:element name=STATE type=xs:string /
xs:element name=LCM_STATE type=xs:string /
xs:element name=STIME type=xs:unsignedLong /
xs:element name=ETIME type=xs:unsignedLong /
xs:element name=DEPLOY_ID type=xs:string /
xs:element name=MEMORY type=xs:unsignedLong /
xs:element name=CPU type=xs:unsignedLong /
xs:element name=NET_TX type=xs:unsignedLong /
xs:element name=NET_RX type=xs:unsignedLong /
xs:element name=LAST_SEQ type=xs:unsignedLong /

xs:element name=TEMPLATE type=vmTemplateType minOccurs=0/
xs:element name=HISTORY type=vmHistoryType minOccurs=0/
/xs:sequence
/xs:complexType


The username appears only in the pool method, but not on the info
method... The same is valid for vnet methods if I recall.

Again, thanks for your input!

Tiago

On Thu, Oct 7, 2010 at 11:46 PM,  carsten.friedr...@csiro.au wrote:
 Hi Tiago,



 I did something similar some time ago (attached for your perusal, you need
 to add the JAXB libraries yourself). The binding of returned templates is a
 bit patchy, but it works well enough for me here. It supports most 2.0
 features.



 Carsten



 From: users-boun...@lists.opennebula.org
 [mailto:users-boun...@lists.opennebula.org] On Behalf Of Tiago Batista
 Sent: Thursday, 7 October 2010 21:06
 To: Users@lists.opennebula.org
 Subject: [one-users] Alternative java bindings



 I am in the process of creating alternative java bindings for OpenNebula.
 (Dont ask and I wont tell why!)

 They are now at a very embrionary state, and I would like to expose them a
 little. There are some parts that are specific to my setup, and a lot of
 refactoring is required but most of the code is automatically generated.

 I use JAXB to bind the xmlrpc responses to POJOs, and I use a catchall class
 to perform the required operations on the server. A usage example:

 Client client = new Client(username, password,
 http://hostname:2633/RPC2;);
 VMOperations vmOps = new VMOperations(client);
 VmType vm = vmOps.info(id);

 This way, adding features is as simple as editing the apropriate xsd. By the
 way, extensions to the existing xsd, or new xsd files are welcome! With a
 little refactoring I think I can wrap the VmType that is read only on a
 class that allows some operations to be performed over it...

 Also, this is better for environments where the data must be used across a
 network, as the classes (although not marked as such) should face no
 serialization problems. Even is none of the code seems useful, you should
 really consider replacing the standard Client class with a serializable one!

 What do you think of this?
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org


[one-users] C12G Delivers Enterprise Extensions to OpenNebula

2010-10-08 Thread Ignacio M. Llorente
Dear users,

We are extremely happy to announce that C12G has just delivered its
Enterprise Extensions to OpenNebula.

More details at http://blog.opennebula.org/?p=817

Cheers,

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


Re: [one-users] econe setup

2010-10-08 Thread Andrea Turli

Tino,

thanks for your suggestion. To be honest we didin't manage to upload any 
image cause of Invalid credentials exception. In particular I've tried 
my oneadmin creds but with no luck.


Anyway I'll try to first upload an image to see if the 
econe-describe-images still failed.


You mentioned latest OpenNebula version: I think you mean 2.0, right? 
When will it be released? At the moment I can find only rc1.


Thank you again,
Andrea

On 10/08/2010 12:53 PM, Tino Vazquez wrote:

Dear Andrea,

The configuration looks fine to me.

My guess is that the  bug is showing because econe-describe-images
doesn't find any image. This is a known issue and it is solved in the
latest OpenNebula version.

Did you upload and register an image with econe-upload and econe-register?

Best regards,

-Tino

--
Constantino Vázquez Blanco | dsa-research.org/tinova
Virtualization Technology Engineer / Researcher
OpenNebula Toolkit | opennebula.org



On Thu, Oct 7, 2010 at 4:29 PM, Andrea Turliandrea.tu...@eng.it  wrote:
   

Hi Tino,

here my config files:

$cat $ONE_LOCATION/etc/econe.conf

# OpenNebula administrator user
USER=oneadmin
PASSWORD=mypassword

# OpenNebula sever contact information
ONE_XMLRPC=http://localhost:2633/RPC2

# Host and port where econe server will run
SERVER=myserver.domain.it
PORT=4567

# SSL proxy that serves the API (set if is being used)
#SSL_SERVER=fqdm.of.the.server

# Configuration for the image repository
DATABASE=/srv/cloud/one/var/ec2.db
IMAGE_DIR=/srv/cloud/images

# VM types allowed and its template file (inside templates directory)
VM_TYPE=[NAME=m1.small, TEMPLATE=m1.small.erb]

and the default template m1.small.erb

$ cat /srv/cloud/one/etc/ec2query_templates/m1.small.erb

NAME   = eco-vm

CPU= 0.2
MEMORY = 256

OS = [ kernel = /vmlinuz,
   initrd = /initrd.img,
   root   = sda1,
   kernel_cmd = ro xencons=tty console=tty1]

DISK = [ source   =%= erb_vm_info[:img_path] %,
 clone= no,
 target   = sda1,
 readonly = no]


NIC=[NETWORK=Public EC2]


IMAGE_ID =%= erb_vm_info[:img_id] %
INSTANCE_TYPE =%= erb_vm_info[:instance_type ]%


thank you for any help,
Andrea


On 10/07/2010 02:53 PM, Tino Vazquez wrote:
 

Hi Andrea,

Have you got any images defined? Maybe it's failing because of that,
with a nasty error that should be more explicit (this can be
considered a bug actually).

We are in the process of releasing the 2.0 version of OpenNebula,
which much better error support.

Best,

-Tino

--
Constantino Vázquez Blanco | dsa-research.org/tinova
Virtualization Technology Engineer / Researcher
OpenNebula Toolkit | opennebula.org



On Wed, Oct 6, 2010 at 11:24 AM, Andrea Turliandrea.tu...@eng.itwrote:

   

Dear all,

I've a running OpenNebula 1.4 cluster configured with opennebula_express.
I'm trying to follow you guide to configure OpenNebula to expose a public
cloud interface, in particular EC2-Query API Cloud service

After the configuration step, I'm trying to invoke the econe commands but
I've some exceptions:
unfortunately I'm not a ruby expert.

Here the exception:

$ ruby -dw /srv/cloud/one/bin/econe-describe-images -H
/srv/cloud/one/bin/econe-describe-images:95: warning: ambiguous first
argument; put parentheses or even spaces
/srv/cloud/one/bin/econe-describe-images:104: warning: ambiguous first
argument; put parentheses or even spaces
/srv/cloud/one/bin/econe-describe-images:111: warning: ambiguous first
argument; put parentheses or even spaces
Exception `LoadError' at /usr/lib/ruby/1.8/rubygems.rb:1113 - no such
file
to load -- rubygems/defaults/operating_system
Exception `NoMethodError' at /usr/lib/ruby/1.8/rational.rb:78 - undefined
method `gcd' for Rational(1, 2):Rational
Exception `LoadError' at /usr/lib/ruby/1.8/rubygems/config_file.rb:34 -
no
such file to load -- Win32API
Exception `LoadError' at /usr/lib/ruby/1.8/rubygems/custom_require.rb:31
-
no such file to load -- curb
Exception `LoadError' at /usr/lib/ruby/1.8/rubygems/custom_require.rb:31
-
no such file to load -- net/http/post/multipart
Exception `LoadError' at /usr/lib/ruby/1.8/rubygems/custom_require.rb:31
-
no such file to load -- AWS
/var/lib/gems/1.8/gems/amazon-ec2-0.9.15/lib/AWS/EC2/products.rb:11:
warning: method redefined; discarding old confirm_product_instance
Exception `NoMethodError' at
/var/lib/gems/1.8/gems/amazon-ec2-0.9.15/lib/AWS.rb:304 - undefined
method
`elements' for nil:NilClass
econe-describe-images: undefined method `elements' for nil:NilClass

and this is my gem env:
$ gem env
RubyGems Environment:
   - RUBYGEMS VERSION: 1.3.5
   - RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux]
   - INSTALLATION DIRECTORY: /var/lib/gems/1.8
   - RUBY EXECUTABLE: /usr/bin/ruby1.8
   - EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
   - RUBYGEMS PLATFORMS:
 - ruby
 - x86_64-linux
   - GEM PATHS:
  - /var/lib/gems/1.8
  - /srv/cloud/one/.gem/ruby/1.8
   - GEM CONFIGURATION:
  - :update_sources =true
   

Re: [one-users] Xen driver and automatic VNC port generation

2010-10-08 Thread Tiago Batista
allow me to re submit the previous patch, now in a safer version! This
one checks for a valid port number and fails the vm launch if an
invalid number is specified... I tested it with a base port of 700 and
the correct ports are automatically generated, and in the case of a
static port specification, it also listens on the correct port!

On Fri, Oct 8, 2010 at 2:56 PM, Tiago Batista tiagosbati...@gmail.com wrote:
 In the case of VNC_BASE_PORT=6000 and VM_ID=0

 The opennebula core in both cases generates a port value of 6000
 (BASE+ VM_ID), now with my proposal the vncdisplay gets calculated
 like this:

 port-5900, meaning that the result is 10, wich gets booted back to
 6000 by xen when it adds 5900 to the vncdisplay value.

 If I am getting what you want correctly, you want the vncdisplay value
 to be calculated like this:

 port-VNC_BASE_PORT, meaning a result of 0 (VM_ID) that xen will
 translate to 5900 which is not the intended result. In fact if this
 code were to be in place, the equivalent vncdisplay=VM_ID could be
 used and the server would always be listening on 5900+VM_ID,
 completely ignoring VNC_BASE_PORT.

 Your proposal is a valid way of calculating a port number, yet the
 calculated port will be different than the one calculated for KVM
 using the same values as base.

 Tiago

 On Fri, Oct 8, 2010 at 2:35 PM, Ruben S. Montero rube...@dacya.ucm.es wrote:

 Meaning that the port if not specifed on the template takes the value
 of VNC_BASE_PORT + VM_ID. This generates a valid port number for KVM.
 In the case of Xen however, it would result on a vnc server listening
 on port+5900. So, the opennebula xen driver should subtract that 5900
 that will be added by xen on the next step.

 Yes, that the reason to subtract VNC_BASE_PORT. Note that you could
 use any port number there not only 5900

 Cheers

 Ruben




one_xen_vnc.patch
Description: Binary data
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org