--- opennebula-1.2.orig/SConstruct +++ opennebula-1.2/SConstruct @@ -86,23 +86,24 @@ else: main_env.Append(parsers='no') -try: - main_env.ParseConfig('share/scons/get_xmlrpc_config server') - main_env.ParseConfig('share/scons/get_xmlrpc_config client') -except Exception, e: - print "" - print "Error searching for xmlrpc-c libraries. Please check this things:" - print "" - print " * You have installed development libraries for xmlrpc-c. One way to check" - print " this is calling xmlrpc-c-config that is provided with the development" - print " package." - print " * Check that the version of xmlrpc-c is at least 1.06. You can do this also" - print " calling:" - print " $ xmlrpc-c-config --version" - print " * If all this requirements are already met please send log files located in" - print " .xmlrpc_test to the mailing list." - print "" - exit(-1) +if not main_env.GetOption('clean'): + try: + main_env.ParseConfig('share/scons/get_xmlrpc_config server') + main_env.ParseConfig('share/scons/get_xmlrpc_config client') + except Exception, e: + print "" + print "Error searching for xmlrpc-c libraries. Please check this things:" + print "" + print " * You have installed development libraries for xmlrpc-c. One way to check" + print " this is calling xmlrpc-c-config that is provided with the development" + print " package." + print " * Check that the version of xmlrpc-c is at least 1.06. You can do this also" + print " calling:" + print " $ xmlrpc-c-config --version" + print " * If all this requirements are already met please send log files located in" + print " .xmlrpc_test to the mailing list." + print "" + exit(-1) # SCONS scripts to build build_scripts=[ --- opennebula-1.2.orig/src/nebula/SConstruct +++ opennebula-1.2/src/nebula/SConstruct @@ -108,6 +108,7 @@ ]) -env.ParseConfig('../../share/scons/get_xmlrpc_config server') +if not env.GetOption('clean'): + env.ParseConfig('../../share/scons/get_xmlrpc_config server') env.Program('oned.cc') --- opennebula-1.2.orig/src/scheduler/SConstruct +++ opennebula-1.2/src/scheduler/SConstruct @@ -96,7 +96,8 @@ ]) -env.ParseConfig('../../share/scons/get_xmlrpc_config client') +if not env.GetOption('clean'): + env.ParseConfig('../../share/scons/get_xmlrpc_config client') # Build tests --- opennebula-1.2.orig/debian/compat +++ opennebula-1.2/debian/compat @@ -0,0 +1 @@ +5 --- opennebula-1.2.orig/debian/copyright +++ opennebula-1.2/debian/copyright @@ -0,0 +1,12 @@ +This package was debianized by Soren Hansen on +Wed, 17 Dec 2008 15:49:44 +0100 + +Copyright: + + OpenNebula is distributed and licensed for use under the terms of + the Apache License, Version 2.0. Copyright 2002-2008, Distributed + Systems Architecture Group, Universidad Complutense de Madrid + (dsa-research.org). + +On an Ubuntu system, the license can be found at +/usr/share/common-licenses/Apache-2.0 . --- opennebula-1.2.orig/debian/opennebula-common.postrm +++ opennebula-1.2/debian/opennebula-common.postrm @@ -0,0 +1,14 @@ +#!/bin/sh + +set -e + +if [ "$1" = "purge" ] +then + if getent passwd oneadmin > /dev/null 2>&1 + then + deluser oneadmin + fi + rm -rf /var/lib/one +fi + +#DEBHELPER# --- opennebula-1.2.orig/debian/opennebula.init +++ opennebula-1.2/debian/opennebula.init @@ -0,0 +1,95 @@ +#! /bin/sh +### BEGIN INIT INFO +# Provides: opennebula +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: OpenNebula init script +# Description: OpenNebula cloud initialisation script +### END INIT INFO + +# Author: Soren Hansen + +PATH=/sbin:/usr/sbin:/bin:/usr/bin +DESC="OpenNebula cloud" +NAME=one +DAEMON=/usr/bin/$NAME +DAEMON_ARGS="" +PIDFILE=/var/run/$NAME.pid +SCRIPTNAME=/etc/init.d/$NAME + +# Exit if the package is not installed +[ -x "$DAEMON" ] || exit 0 + +# Load the VERBOSE setting and other rcS variables +. /lib/init/vars.sh + +# Define LSB log_* functions. +# Depend on lsb-base (>= 3.0-6) to ensure that this file is present. +. /lib/lsb/init-functions + +# +# Function that starts the daemon/service +# +do_start() +{ + mkdir -p /var/run/one + chown oneadmin /var/run/one + su oneadmin -s /bin/sh -c 'one start' +} + +# +# Function that stops the daemon/service +# +do_stop() +{ + su oneadmin -s /bin/sh -c 'one stop' +} + +case "$1" in + start) + [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + do_start + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + stop) + [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + do_stop + case "$?" in + 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; + 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + esac + ;; + restart|force-reload) + # + # If the "reload" option is implemented then remove the + # 'force-reload' alias + # + log_daemon_msg "Restarting $DESC" "$NAME" + do_stop + case "$?" in + 0|1) + do_start + case "$?" in + 0) log_end_msg 0 ;; + 1) log_end_msg 1 ;; # Old process is still running + *) log_end_msg 1 ;; # Failed to start + esac + ;; + *) + # Failed to stop + log_end_msg 1 + ;; + esac + ;; + *) + echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac + +: --- opennebula-1.2.orig/debian/opennebula-common.postinst +++ opennebula-1.2/debian/opennebula-common.postinst @@ -0,0 +1,33 @@ +#!/bin/sh + +set -e + +if [ "$1" = "configure" ] +then + if ! getent passwd oneadmin > /dev/null 2>&1; + then + ONEHOME=/var/lib/one + adduser --system --home $ONEHOME --shell /bin/bash oneadmin + else + ONEHOME=`getent passwd oneadmin | cut -f6 -d:` + fi + if ! [ -d "$ONEHOME/.ssh" ] + then + mkdir "$ONEHOME/.ssh" + chown oneadmin "$ONEHOME/.ssh" + chmod 755 "$ONEHOME/.ssh" + fi + if ! [ -f "$ONEHOME/.ssh/authorized_keys" ] + then + touch "$ONEHOME/.ssh/authorized_keys" + chown oneadmin "$ONEHOME/.ssh/authorized_keys" + chmod 600 "$ONEHOME/.ssh/authorized_keys" + fi + if ! [ -f "$ONEHOME/.ssh/id_rsa" ] + then + su oneadmin -c "ssh-keygen -N '' -t rsa -f $ONEHOME/.ssh/id_rsa" + fi + chown oneadmin /var/lib/one +fi + +#DEBHELPER# --- opennebula-1.2.orig/debian/opennebula-node.postinst +++ opennebula-1.2/debian/opennebula-node.postinst @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e + +if [ "$1" = "configure" ] +then + if ! getent group libvirtd | cut -f4 -d: | grep -q '\' + then + adduser oneadmin libvirtd + fi +fi + +#DEBHELPER# --- opennebula-1.2.orig/debian/rules +++ opennebula-1.2/debian/rules @@ -0,0 +1,42 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/patchsys-quilt.mk + +build/opennebula:: build-stamp + +build-stamp: + scons + touch $@ + +install/opennebula:: + DESTDIR=debian/opennebula ./install.sh + + +# Will refresh man pages from the local installation. +# Improvements are very welcome. + +manpages: debian/onevm.8 debian/onehost.8 debian/onevnet.8 +debian/%.8: /usr/bin/% + help2man -N -s 8 $< > $@ + +install/opennebula:: + chmod +x debian/opennebula/usr/lib/one/im_probes/ssh_pubkey.sh + +install/libopennebula1:: + mkdir -p debian/libopennebula1/usr/lib/one + mv debian/opennebula/usr/lib/one/*.so.* debian/libopennebula1/usr/lib/one/ + +install/libopennebula-dev:: + mkdir -p debian/libopennebula-dev/usr/include + mkdir -p debian/libopennebula-dev/usr/lib/one + mv debian/opennebula/usr/include/* debian/libopennebula-dev/usr/include + mv debian/opennebula/usr/lib/one/*.a debian/libopennebula-dev/usr/lib/one/ + mv debian/opennebula/usr/lib/one/*.so debian/libopennebula-dev/usr/lib/one + +clean:: + scons -c . + rm -rf install-stamp build-stamp share/scons/lex_bison.pyc \ + src/nebula/.xmlrpc_test/xmlrpc_test.* \ + src/scheduler/.xmlrpc_test/xmlrpc_test.* \ + .xmlrpc_test .sconsign.dblite --- opennebula-1.2.orig/debian/changelog +++ opennebula-1.2/debian/changelog @@ -0,0 +1,83 @@ +opennebula (1.2-0ubuntu3) jaunty; urgency=low + + * Add ruby dependency for opennebula-node. (LP: #329258) + * Always show ssh setup help (LP: #329507) + + -- Soren Hansen Fri, 20 Feb 2009 13:51:51 +0100 + +opennebula (1.2-0ubuntu2) jaunty; urgency=low + + * Also distribute known_hosts through the key distribution mechanism. + (LP: #331838) + + -- Soren Hansen Fri, 20 Feb 2009 10:50:18 +0100 + +opennebula (1.2-0ubuntu1) jaunty; urgency=low + + * Update to new upstream release. + * Add missing debhelper snippet in opennebula's postinst. + + -- Soren Hansen Wed, 11 Feb 2009 13:46:03 +0100 + +opennebula (1.1.85+svn329-0ubuntu5) jaunty; urgency=low + + * Fix broken call to chown in opennebula's postinst. + + -- Soren Hansen Fri, 06 Feb 2009 10:16:27 +0100 + +opennebula (1.1.85+svn329-0ubuntu4) jaunty; urgency=low + + * It turns out that the nodes also benefit from having an SSH key, + so move the key generation code to opennebula-common. + * ssh_pubkey_info.diff: + - Add ssh_pubkey.sh which extracts the remote oneadmin user's ssh + public key, so that it's available in the host info. + - Add ssh_pubkey.sh to list of probes to run for kvm hosts. + * Add an hourly cronjob to the opennebula package that extracts the + public keys for each host, and generates a distribution script for + them, which is then run on each host using the monitoring mechanism. + This way, the oneadmin users on every host can ssh to all others. + * tools_table_output.diff: + - Change the onevm, onehost, and onevnet table output slightly to + make it more easily parsable. + + -- Soren Hansen Fri, 30 Jan 2009 17:04:23 +0100 + +opennebula (1.1.85+svn329-0ubuntu3) jaunty; urgency=low + + * Fix up some missing debhelper bits in maintainer scripts. + + -- Soren Hansen Thu, 29 Jan 2009 00:22:13 +0100 + +opennebula (1.1.85+svn329-0ubuntu2) jaunty; urgency=low + + * freecpu_kvm.diff: + - Return the correct amount of free and used cpu for kvm hosts. + (ie. adjust for number of CPU's). + * libvirt_smp.diff: + - Add an optional VCPU parameter to the VM definitions, letting the + user specify the number of virtual CPU's to give to the VM. + If not given, round up the CPU setting to the nearest integer, and + use that instead. + * shlib_links.diff: + - Make liboneapi.so.1.2 the real file and the .so.1 and .so the + symlinks. + * Fix speling mistaek in node_creation_help.diff. (LP: #322211) + + -- Soren Hansen Wed, 28 Jan 2009 23:49:40 +0100 + +opennebula (1.1.85+svn329-0ubuntu1) jaunty; urgency=low + + * Initial upload. + * Patches included: + - kvm_by_default.diff: + + Changes the shipped configuration file to default to kvm. + - node_creation_help.diff: + + Output some extra information from "onehost create" that + should help the process of adding new nodes. + * Added man pages (generated by help2man). + * Made scons clean targets (and hence debian/rules clean) not fail in the + absence of libxmlrpc. + + -- Soren Hansen Mon, 19 Jan 2009 13:29:05 +0100 + --- opennebula-1.2.orig/debian/opennebula.postrm +++ opennebula-1.2/debian/opennebula.postrm @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" = "purge" ] +then + rm -rf /var/log/one + rm -rf /var/run/one +fi + +#DEBHELPER# --- opennebula-1.2.orig/debian/opennebula.postinst +++ opennebula-1.2/debian/opennebula.postinst @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +if [ "$1" = "configure" ] +then + chown oneadmin /var/log/one +fi + +#DEBHELPER# --- opennebula-1.2.orig/debian/opennebula.cron.hourly +++ opennebula-1.2/debian/opennebula.cron.hourly @@ -0,0 +1,23 @@ +#!/bin/sh + +tmpfile=$(mktemp /var/lib/one/savekeys.sh.XXXXXXXX) +chown oneadmin $tmpfile +chmod +x $tmpfile + +echo '#!/bin/sh' > $tmpfile +echo 'cat << EOK > $HOME/.ssh/authorized_keys.tmp' >> $tmpfile + +onehost -l hid -f state=on list | tail -n +2 | while read hostid +do + onehost show $hostid | grep PUBKEY= | cut -d= -f2- >> $tmpfile +done +cat /var/lib/one/.ssh/id_?sa.pub >> $tmpfile +echo 'EOK' >> $tmpfile +echo 'mv $HOME/.ssh/authorized_keys.tmp $HOME/.ssh/authorized_keys' >> $tmpfile + +echo 'cat << EOK > $HOME/.ssh/known_hosts.tmp' >> $tmpfile +cat /var/lib/one/.ssh/known_hosts >> $tmpfile +echo 'EOK' >> $tmpfile +echo 'mv $HOME/.ssh/known_hosts.tmp $HOME/.ssh/known_hosts' >> $tmpfile + +mv $tmpfile /var/lib/one/savekeys.sh --- opennebula-1.2.orig/debian/control +++ opennebula-1.2/debian/control @@ -0,0 +1,79 @@ +Source: opennebula +Section: utils +Priority: extra +Maintainer: Soren Hansen +Build-Depends: debhelper (>= 7), cdbs, scons, quilt, libxmlrpc-c3-dev, ruby, libsqlite3-dev +Standards-Version: 3.8.0 +Homepage: http://opennebula.org/ + +Package: opennebula +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, ruby, adduser, libsqlite3-ruby, opennebula-common, openssh-client +Description: OpenNebula controller + OpenNebula is an open source virtual infrastructure engine that enables the + dynamic deployment and re-placement of virtual machines on a pool of physical + resources. + . + ONE (OpenNebula) extends the benefits of virtualization platforms from a + single physical resource to a pool of resources, decoupling the server not + only from the physical infrastructure but also from the physical location. + . + This package contains the cloud controller. + +Package: opennebula-common +Architecture: all +Depends: ${misc:Depends}, adduser +Description: OpenNebula common files + OpenNebula is an open source virtual infrastructure engine that enables the + dynamic deployment and re-placement of virtual machines on a pool of physical + resources. + . + ONE (OpenNebula) extends the benefits of virtualization platforms from a + single physical resource to a pool of resources, decoupling the server not + only from the physical infrastructure but also from the physical location. + . + This package sets up the basic directory structure and users needed to run + an Ubuntu OpenNebula cloud. + +Package: opennebula-node +Architecture: all +Depends: ${misc:Depends}, adduser, libvirt-bin, kvm, opennebula-common, ruby +Description: OpenNebula node + OpenNebula is an open source virtual infrastructure engine that enables the + dynamic deployment and re-placement of virtual machines on a pool of physical + resources. + . + ONE (OpenNebula) extends the benefits of virtualization platforms from a + single physical resource to a pool of resources, decoupling the server not + only from the physical infrastructure but also from the physical location. + . + This package prepares the machine for being a node in an Ubuntu OpenNebula + cloud. + +Package: libopennebula1 +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: OpenNebula client library - Runtime + OpenNebula is an open source virtual infrastructure engine that enables the + dynamic deployment and re-placement of virtual machines on a pool of physical + resources. + . + ONE (OpenNebula) extends the benefits of virtualization platforms from a + single physical resource to a pool of resources, decoupling the server not + only from the physical infrastructure but also from the physical location. + . + This package provides the OpenNebula client library. + +Package: libopennebula-dev +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: OpenNebula client library - Development + OpenNebula is an open source virtual infrastructure engine that enables the + dynamic deployment and re-placement of virtual machines on a pool of physical + resources. + . + ONE (OpenNebula) extends the benefits of virtualization platforms from a + single physical resource to a pool of resources, decoupling the server not + only from the physical infrastructure but also from the physical location. + . + This package provides the OpenNebula client library development files. --- opennebula-1.2.orig/debian/patches/kvm_by_default.diff +++ opennebula-1.2/debian/patches/kvm_by_default.diff @@ -0,0 +1,66 @@ +Index: packaging/share/etc/oned.conf +=================================================================== +--- packaging.orig/share/etc/oned.conf 2009-01-06 17:45:51.327166023 +0100 ++++ packaging/share/etc/oned.conf 2009-01-06 21:37:17.379208461 +0100 +@@ -63,20 +63,20 @@ + # /etc/one/ if OpenNebula was installed in /) + #------------------------------------------------------------------------------- + +-IM_MAD = [ +- name = "im_xen", +- executable = "one_im_ssh", +- arguments = "im_xen/im_xen.conf", +- default = "im_xen/im_xen.conf" ] ++#IM_MAD = [ ++# name = "im_xen", ++# executable = "one_im_ssh", ++# arguments = "im_xen/im_xen.conf", ++# default = "im_xen/im_xen.conf" ] + + #------------------------------------------------------------------------------- + # KVM Information Driver Manager sample configuration + #------------------------------------------------------------------------------- +-# IM_MAD = [ +-# name = "im_kvm", +-# executable = "one_im_ssh", +-# arguments = "im_kvm/im_kvm.conf", +-# default = "im_kvm/im_kvm.conf" ] ++IM_MAD = [ ++ name = "im_kvm", ++ executable = "one_im_ssh", ++ arguments = "im_kvm/im_kvm.conf", ++ default = "im_kvm/im_kvm.conf" ] + #------------------------------------------------------------------------------- + + #------------------------------------------------------------------------------- +@@ -110,20 +110,20 @@ + # type : driver type, supported drivers: xen, kvm, ec2 + #------------------------------------------------------------------------------- + +-VM_MAD = [ +- name = "vmm_xen", +- executable = "one_vmm_xen", +- default = "vmm_xen/vmm_xen.conf", +- type = "xen" ] ++#VM_MAD = [ ++# name = "vmm_xen", ++# executable = "one_vmm_xen", ++# default = "vmm_xen/vmm_xen.conf", ++# type = "xen" ] + + #------------------------------------------------------------------------------- + # KVM Virtualization Driver Manager sample configuration + #------------------------------------------------------------------------------- +-# VM_MAD = [ +-# name = "vmm_kvm", +-# executable = "one_vmm_kvm", +-# default = "vmm_kvm/vmm_kvm.conf", +-# type = "kvm" ] ++VM_MAD = [ ++ name = "vmm_kvm", ++ executable = "one_vmm_kvm", ++ default = "vmm_kvm/vmm_kvm.conf", ++ type = "kvm" ] + #------------------------------------------------------------------------------- + + #------------------------------------------------------------------------------- --- opennebula-1.2.orig/debian/patches/series +++ opennebula-1.2/debian/patches/series @@ -0,0 +1,7 @@ +freecpu_kvm.diff +libvirt_smp.diff +kvm_by_default.diff +node_creation_help.diff +shlib_links.diff +ssh_pubkey_info.diff +tools_table_output.diff --- opennebula-1.2.orig/debian/patches/freecpu_kvm.diff +++ opennebula-1.2/debian/patches/freecpu_kvm.diff @@ -0,0 +1,17 @@ +Index: opennebula-1.1.85+svn329/src/im_mad/kvm/kvm.rb +=================================================================== +--- opennebula-1.1.85+svn329.orig/src/im_mad/kvm/kvm.rb 2009-01-28 15:26:00.171920628 +0100 ++++ opennebula-1.1.85+svn329/src/im_mad/kvm/kvm.rb 2009-01-28 15:27:07.183943661 +0100 +@@ -56,9 +56,9 @@ + line[7..-1].split(",").each{|elemento| + temp = elemento.strip.split("%") + if temp[1]=="id" +- $free_cpu = temp[0] +- used = temp[0].to_f +- $used_cpu = (((100 - used)*100).round / 100).to_f.to_s ++ idle = temp[0] ++ $free_cpu = idle.to_f * $total_cpu.to_f / 100 ++ $used_cpu = $total_cpu.to_f - $free_cpu + break + end + --- opennebula-1.2.orig/debian/patches/libvirt_smp.diff +++ opennebula-1.2/debian/patches/libvirt_smp.diff @@ -0,0 +1,44 @@ +Index: opennebula-1.1.85+svn329/src/vmm/LibVirtDriver.cc +=================================================================== +--- opennebula-1.1.85+svn329.orig/src/vmm/LibVirtDriver.cc 2009-01-28 18:31:47.332999499 +0100 ++++ opennebula-1.1.85+svn329/src/vmm/LibVirtDriver.cc 2009-01-28 18:49:02.417990117 +0100 +@@ -20,6 +20,8 @@ + #include "Nebula.h" + #include + #include ++#include ++#include + + + int LibVirtDriver::deployment_description( +@@ -100,17 +102,26 @@ + // ------------------------------------------------------------------------ + + +- vm->get_template_attribute("CPU", cpu); ++ vm->get_template_attribute("VCPU", cpu); + + if(cpu.empty()) + { +- get_default("CPU",cpu); ++ get_default("VCPU",cpu); + } + ++ if(cpu.empty()) ++ { ++ vm->get_template_attribute("CPU", cpu); ++ } ++ ++ if(cpu.empty()) ++ { ++ get_default("CPU",cpu); ++ } ++ + if (!cpu.empty()) + { +- //file << "\t" << cpu << "" << endl; +- // TODO decide about the vpcu value ++ file << "\t" << (int) ceil(atof(cpu.c_str())) << "" << endl; + } + else + { --- opennebula-1.2.orig/debian/patches/shlib_links.diff +++ opennebula-1.2/debian/patches/shlib_links.diff @@ -0,0 +1,20 @@ +Index: opennebula-1.1.85+svn329/install.sh +=================================================================== +--- opennebula-1.1.85+svn329.orig/install.sh 2009-01-28 23:24:56.749014801 +0100 ++++ opennebula-1.1.85+svn329/install.sh 2009-01-28 23:46:02.592999789 +0100 +@@ -371,10 +371,12 @@ + /bin/chown -R $ONEADMIN_USER:$ONEADMIN_GROUP $DESTDIR$d + done + # Create library links +- ln -s $DESTDIR$LIB_LOCATION/liboneapi.so \ +- $DESTDIR$LIB_LOCATION/liboneapi.so.1 +- ln -s $DESTDIR$LIB_LOCATION/liboneapi.so.1 \ ++ mv $DESTDIR$LIB_LOCATION/liboneapi.so \ + $DESTDIR$LIB_LOCATION/liboneapi.so.1.2 ++ ln -s liboneapi.so.1.2 \ ++ $DESTDIR$LIB_LOCATION/liboneapi.so ++ ln -s liboneapi.so.1.2 \ ++ $DESTDIR$LIB_LOCATION/liboneapi.so.1 + else + for d in `echo $MAKE_DIRS | awk '{for (i=NF;i>=1;i--) printf $i" "}'`; do + rmdir $d --- opennebula-1.2.orig/debian/patches/ssh_pubkey_info.diff +++ opennebula-1.2/debian/patches/ssh_pubkey_info.diff @@ -0,0 +1,39 @@ +Index: opennebula-1.1.85+svn329/src/im_mad/host_probes/ssh_pubkey.sh +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ opennebula-1.1.85+svn329/src/im_mad/host_probes/ssh_pubkey.sh 2009-01-30 11:01:57.548471086 +0100 +@@ -0,0 +1,11 @@ ++#!/bin/sh ++ ++for type in dsa rsa ++do ++ candidate="$HOME/.ssh/id_${type}.pub" ++ if [ -f "$candidate" ] ++ then ++ echo PUBKEY=\"`cat $candidate`\" ++ exit 0 ++ fi ++done +Index: opennebula-1.1.85+svn329/src/im_mad/kvm/im_kvm.conf +=================================================================== +--- opennebula-1.1.85+svn329.orig/src/im_mad/kvm/im_kvm.conf 2009-01-30 11:00:17.000469731 +0100 ++++ opennebula-1.1.85+svn329/src/im_mad/kvm/im_kvm.conf 2009-01-30 11:32:35.043446486 +0100 +@@ -5,4 +5,6 @@ + cpuarchitecture=architecture.sh + nodename=name.sh + cpu=cpu.sh ++ssh=ssh_pubkey.sh + kvm=kvm.rb ++sshdist=/var/lib/one/savekeys.sh +Index: opennebula-1.1.85+svn329/install.sh +=================================================================== +--- opennebula-1.1.85+svn329.orig/install.sh 2009-01-30 11:05:03.876443759 +0100 ++++ opennebula-1.1.85+svn329/install.sh 2009-01-30 11:06:16.319444611 +0100 +@@ -215,6 +215,7 @@ + IM_PROBES_LIB_FILES="src/im_mad/xen/xen.rb \ + src/im_mad/kvm/kvm.rb \ + src/im_mad/host_probes/architecture.sh \ ++ src/im_mad/host_probes/ssh_pubkey.sh \ + src/im_mad/host_probes/cpu.sh \ + src/im_mad/host_probes/name.sh" + --- opennebula-1.2.orig/debian/patches/tools_table_output.diff +++ opennebula-1.2/debian/patches/tools_table_output.diff @@ -0,0 +1,30 @@ +Index: opennebula-1.1.85+svn329/src/client/ruby/onevm +=================================================================== +--- opennebula-1.1.85+svn329.orig/src/client/ruby/onevm 2009-01-30 11:29:27.176459896 +0100 ++++ opennebula-1.1.85+svn329/src/client/ruby/onevm 2009-01-30 11:45:05.903471292 +0100 +@@ -153,8 +153,9 @@ + def header_vm_small + scr_bold + scr_underline +- puts @table.header_str ++ print @table.header_str + scr_restore ++ print "\n" + end + + def header_history_small +Index: opennebula-1.1.85+svn329/src/client/ruby/onevnet +=================================================================== +--- opennebula-1.1.85+svn329.orig/src/client/ruby/onevnet 2009-01-30 11:29:27.212472362 +0100 ++++ opennebula-1.1.85+svn329/src/client/ruby/onevnet 2009-01-30 11:45:05.903471292 +0100 +@@ -88,8 +88,9 @@ + def header_vn_small + scr_bold + scr_underline +- puts @table.header_str ++ print @table.header_str + scr_restore ++ print "\n" + end + + def list_short(options=nil) --- opennebula-1.2.orig/debian/patches/node_creation_help.diff +++ opennebula-1.2/debian/patches/node_creation_help.diff @@ -0,0 +1,29 @@ +Index: one-1.2.ubuntu/src/client/ruby/onehost +=================================================================== +--- one-1.2.ubuntu.orig/src/client/ruby/onehost 2009-02-20 13:46:48.106645942 +0100 ++++ one-1.2.ubuntu/src/client/ruby/onehost 2009-02-20 13:50:39.374673008 +0100 +@@ -108,8 +108,9 @@ + def header_host_small + scr_bold + scr_underline +- puts @table.header_str ++ print @table.header_str + scr_restore ++ print "\n" + end + + def list_short(options=nil) +@@ -234,6 +235,13 @@ + when "add", "create" + check_parameters("create", 4) + result=host.allocate(*[ARGV[0], ARGV[1], ARGV[2], ARGV[3], "true"]) ++ if result[0] ++ puts "Success!\n\nNote: 'oneadmin' on this host needs to be able to ssh to oneadmin@" + ARGV[0] + ",\nso on this host, run:\n sudo -u oneadmin ssh " + ARGV[0] + "\n\nand verify the host's authenticity.\n\nOn " + ARGV[0] + ", run this:\n sudo apt-get install opennebula-node\n\n sudo tee /var/lib/one/.ssh/authorized_keys << EOT\n" ++ pubkeyfp = File.new('/var/lib/one/.ssh/id_rsa.pub', 'r') ++ pubkeys = pubkeyfp.readlines ++ pubkeys.each{|i| puts i} ++ puts "EOT" ++ end + + when "show" + check_parameters("show", 1)