how can i proof if oneadmin can use libvirt?

i created my hosts with sunstone... like host1... is there a need to add them to the hostsfile?

can you tell me how to set up the passwordless ssh access?

Thanks a lot for your help.

My internet is restriced in cuba i am not able to search it of my own...
sorry

Am 2013-02-06 14:51, schrieb Hector Sanjuan:
From the logs there are at least two problems:

Wed Feb  6 10:03:09 2013 [InM][I]: error: Failed to connect socket to
'/var/run/libvirt/libvirt-sock': No such file or directory

Is libvirt correctly installed? Can oneadmin use it?

Wed Feb  6 10:03:10 2013 [InM][I]: ssh: Could not resolve hostname
oneadmin: Name or service not known

It seems you added the host with name oneadmin, but you dont have any
host  named oneadmin or it cannot be resolved. If you are adding the
frontend  has host, add 'localhost'.

You DO need passwordless ssh access to all hosts, regardless of using
shared storage etc. because SSH is how opennebula copies the
necessary  scripts, and monitors hosts and vms. You also need to be
able to ssh  localhost passwordless if you are adding it as a node.

Hector



On Wed, 06 Feb 2013 16:29:10 +0100, Johannes Thome
<johannes.th...@electrica.cujae.edu.cu> wrote:

I put my logfiles in this Email, and the log-files complete in the
attachment.

i have only the front end on one computer, so i dont need really a ssh
how can i use shared?
all my hosts are added to the hosts file... but i created them with
sunstone

i got errors in my logfiles but i dont know how to fix them

I tried to configrate the ssh-server like this:

apt-get install openssh-server

You can configure any password you like (even blank) because we are
going to set up a
passwordless login from the frontend:
oneadmin@front-end $ ssh-copy-id oneadmin@host1
Now if you connect from the oneadmin account on the frontend to the
oneadminaccount of the
host, you should get the shell prompt without entering any password by
using the following
command:
oneadmin@front-end $ ssh oneadmin@front-end


a part of the 1.log file:

Tue Feb  5 17:51:28 2013 [DiM][I]: New VM state is PENDING
Tue Feb  5 17:51:35 2013 [DiM][I]: New VM state is ACTIVE.
Tue Feb  5 17:51:36 2013 [LCM][I]: New VM state is PROLOG.
Tue Feb  5 17:51:36 2013 [VM][I]: Virtual Machine has no context
Tue Feb  5 17:51:36 2013 [TM][I]: Command execution fail:
/var/lib/one/remotes/tm/shared/clone

chivas-Aspire-5755G:/var/lib/one/datastores/1/f9ba5ca69d58eb7f6b6e495c66a0d101
oneadmin:/var/lib/one//datastores/0/1/disk.0 1 1
Tue Feb  5 17:51:36 2013 [TM][I]: clone: Cloning
/var/lib/one/datastores/1/f9ba5ca69d58eb7f6b6e495c66a0d101 in
oneadmin:/var/lib/one//datastores/0/1/disk.0
Tue Feb  5 17:51:36 2013 [TM][E]: clone: Command "cd
/var/lib/one/datastores/0/1; cp -r
/var/lib/one/datastores/1/f9ba5ca69d58eb7f6b6e495c66a0d101
/var/lib/one/datastores/0/1/disk.0" failed: ssh: Could not resolve
hostname oneadmin: Name or service not known
Tue Feb  5 17:51:36 2013 [TM][E]: Error copying

chivas-Aspire-5755G:/var/lib/one/datastores/1/f9ba5ca69d58eb7f6b6e495c66a0d101
to oneadmin:/var/lib/one//datastores/0/1/disk.0
Tue Feb  5 17:51:36 2013 [TM][I]: ExitCode: 255
Tue Feb  5 17:51:36 2013 [TM][E]: Error executing image transfer
script: Error copying

chivas-Aspire-5755G:/var/lib/one/datastores/1/f9ba5ca69d58eb7f6b6e495c66a0d101
to oneadmin:/var/lib/one//datastores/0/1/disk.0
Tue Feb  5 17:51:37 2013 [DiM][I]: New VM state is FAILED

a part of oned.log

Wed Feb  6 10:02:54 2013 [ONE][I]: Starting OpenNebula 3.8.3
----------------------------------------
      OpenNebula Configuration File
----------------------------------------

AUTH_MAD=AUTHN=ssh,x509,ldap,server_cipher,server_x509,EXECUTABLE=one_auth_mad
DATASTORE_LOCATION=/var/lib/one//datastores
DATASTORE_MAD=ARGUMENTS=-t 15 -d
fs,vmware,vmfs,iscsi,lvm,EXECUTABLE=one_datastore
DB=BACKEND=sqlite
DEBUG_LEVEL=3
DEFAULT_DEVICE_PREFIX=hd
DEFAULT_IMAGE_TYPE=OS
ENABLE_OTHER_PERMISSIONS=YES
HM_MAD=EXECUTABLE=one_hm
HOST_MONITORING_EXPIRATION_TIME=86400
HOST_MONITORING_INTERVAL=600
HOST_PER_INTERVAL=15
IMAGE_RESTRICTED_ATTR=SOURCE
IM_MAD=ARGUMENTS=-r 0 -t 15 kvm,EXECUTABLE=one_im_ssh,NAME=im_kvm
MAC_PREFIX=02:00
MANAGER_TIMER=15
NETWORK_SIZE=254
PORT=2633
SCRIPTS_REMOTE_DIR=/var/tmp/one
SESSION_EXPIRATION_TIME=900
TM_MAD=ARGUMENTS=-t 15 -d
dummy,lvm,shared,qcow2,ssh,vmfs,iscsi,EXECUTABLE=one_tm
VM_MAD=ARGUMENTS=-t 15 -r 0

kvm,DEFAULT=vmm_exec/vmm_exec_kvm.conf,EXECUTABLE=one_vmm_exec,NAME=vmm_kvm,TYPE=kvm
VM_MONITORING_EXPIRATION_TIME=86400
VM_PER_INTERVAL=5
VM_POLLING_INTERVAL=600
VM_RESTRICTED_ATTR=CONTEXT/FILES
VM_RESTRICTED_ATTR=NIC/MAC
VM_RESTRICTED_ATTR=NIC/VLAN_ID
VM_RESTRICTED_ATTR=RANK
VNC_BASE_PORT=5900
----------------------------------------
Wed Feb  6 10:02:54 2013 [ONE][I]: Log level:3
[0=ERROR,1=WARNING,2=INFO,3=DEBUG]
Wed Feb  6 10:02:54 2013 [ONE][I]: Checking database version.
Wed Feb 6 10:02:54 2013 [VMM][I]: Starting Virtual Machine Manager...
Wed Feb  6 10:02:54 2013 [LCM][I]: Starting Life-cycle Manager...
Wed Feb  6 10:02:54 2013 [VMM][I]: Virtual Machine Manager started.
Wed Feb  6 10:02:54 2013 [LCM][I]: Life-cycle Manager started.
Wed Feb  6 10:02:54 2013 [InM][I]: Starting Information Manager...
Wed Feb  6 10:02:54 2013 [InM][I]: Information Manager started.
Wed Feb  6 10:02:54 2013 [TrM][I]: Starting Transfer Manager...
Wed Feb  6 10:02:54 2013 [TrM][I]: Transfer Manager started.
Wed Feb  6 10:02:54 2013 [DiM][I]: Starting Dispatch Manager...
Wed Feb  6 10:02:54 2013 [DiM][I]: Dispatch Manager started.
Wed Feb  6 10:02:54 2013 [HKM][I]: Starting Hook Manager...
Wed Feb  6 10:02:54 2013 [AuM][I]: Starting Auth Manager...
Wed Feb  6 10:02:54 2013 [HKM][I]: Hook Manager started.
Wed Feb  6 10:02:54 2013 [AuM][I]: Authorization Manager started.
Wed Feb  6 10:02:54 2013 [ImM][I]: Starting Image Manager...
Wed Feb  6 10:02:54 2013 [ImM][I]: Image Manager started.
Wed Feb  6 10:02:54 2013 [ReM][I]: Starting Request Manager...
Wed Feb 6 10:02:54 2013 [ReM][I]: Starting XML-RPC server, port 2633
...
Wed Feb  6 10:02:54 2013 [ReM][I]: Request Manager started.
Wed Feb  6 10:02:56 2013 [VMM][I]: Loading Virtual Machine Manager
drivers.
Wed Feb  6 10:02:56 2013 [VMM][I]:      Loading driver: vmm_kvm (KVM)
Wed Feb  6 10:02:58 2013 [VMM][I]:      Driver vmm_kvm loaded.
Wed Feb 6 10:02:58 2013 [InM][I]: Loading Information Manager drivers.
Wed Feb  6 10:02:58 2013 [InM][I]:      Loading driver: im_kvm
Wed Feb  6 10:02:59 2013 [InM][I]:      Driver im_kvm loaded
Wed Feb  6 10:02:59 2013 [TM][I]: Loading Transfer Manager driver.
Wed Feb  6 10:02:59 2013 [TM][I]:       Transfer manager driver loaded
Wed Feb  6 10:02:59 2013 [HKM][I]: Loading Hook Manager driver.
Wed Feb  6 10:03:00 2013 [HKM][I]:      Hook Manager loaded
Wed Feb  6 10:03:00 2013 [ImM][I]: Loading Image Manager driver.
Wed Feb  6 10:03:00 2013 [ImM][I]:      Image Manager loaded
Wed Feb  6 10:03:00 2013 [AuM][I]: Loading Auth. Manager driver.
Wed Feb  6 10:03:00 2013 [AuM][I]:      Auth Manager loaded
Wed Feb 6 10:03:01 2013 [AuM][D]: Message received: LOG I 0 ExitCode:
0

Wed Feb  6 10:03:01 2013 [AuM][I]: ExitCode: 0
Wed Feb  6 10:03:01 2013 [AuM][D]: Message received: AUTHENTICATE
SUCCESS 0 -

Wed Feb 6 10:03:01 2013 [ReM][D]: Req:1920 UID:1 UserPoolInfo invoked Wed Feb 6 10:03:01 2013 [ReM][D]: Req:1920 UID:1 UserPoolInfo result
SUCCESS, "<USER_POOL><USER><ID..."
Wed Feb  6 10:03:08 2013 [InM][I]: Monitoring host host1 (2)
Wed Feb  6 10:03:09 2013 [InM][I]: Monitoring host host2 (3)
Wed Feb  6 10:03:09 2013 [InM][I]: Monitoring host oneadmin (4)
Wed Feb  6 10:03:09 2013 [InM][I]: Command execution fail: 'if [ -x
"/var/tmp/one/im/run_probes" ]; then /var/tmp/one/im/run_probes kvm 2
host1; else                              exit 42; fi'
Wed Feb  6 10:03:09 2013 [InM][I]: Command execution fail: 'if [ -x
"/var/tmp/one/im/run_probes" ]; then /var/tmp/one/im/run_probes kvm 3
host2; else                              exit 42; fi'
Wed Feb 6 10:03:09 2013 [InM][I]: error: Failed to connect socket to
'/var/run/libvirt/libvirt-sock': No such file or directory
Wed Feb 6 10:03:09 2013 [InM][I]: error: Failed to connect socket to
'/var/run/libvirt/libvirt-sock': No such file or directory
Wed Feb  6 10:03:09 2013 [InM][I]: error: failed to connect to the
hypervisor
Wed Feb  6 10:03:09 2013 [InM][I]: error: failed to connect to the
hypervisor
Wed Feb  6 10:03:09 2013 [InM][E]: Error executing kvm.rb
Wed Feb  6 10:03:09 2013 [InM][E]: Error executing kvm.rb
Wed Feb  6 10:03:09 2013 [InM][I]: ExitCode: 255
Wed Feb  6 10:03:09 2013 [InM][I]: ExitCode: 255
Wed Feb  6 10:03:09 2013 [InM][E]: Error monitoring host 2 : MONITOR
FAILURE 2 Error executing kvm.rb

Wed Feb  6 10:03:10 2013 [InM][E]: Error monitoring host 3 : MONITOR
FAILURE 3 Error executing kvm.rb

Wed Feb  6 10:03:10 2013 [InM][I]: Command execution fail: 'if [ -x
"/var/tmp/one/im/run_probes" ]; then /var/tmp/one/im/run_probes kvm 4
oneadmin; else                              exit 42; fi'
Wed Feb  6 10:03:10 2013 [InM][I]: ssh: Could not resolve hostname
oneadmin: Name or service not known
Wed Feb  6 10:03:10 2013 [InM][I]: ExitCode: 255
Wed Feb  6 10:03:10 2013 [InM][E]: Error monitoring host 4 : MONITOR
FAILURE 4 -

a part of sunstone.log

--------------------------------------
          Server configuration
--------------------------------------
{:vnc_proxy_support_wss=>false,
  :vnc_proxy_key=>nil,
  :core_auth=>"cipher",
  :host=>"127.0.0.1",
  :tmpdir=>"/var/tmp",
  :marketplace_url=>"https://marketplace.c12g.com/appliance";,
  :debug_level=>3,
  :port=>9869,
  :lang=>"en_US",
  :vnc_proxy_port=>29876,
  :vnc_proxy_cert=>nil,
  :auth=>"sunstone",
  :vnc_proxy_path=>nil,
  :one_xmlrpc=>"http://localhost:2633/RPC2"}
Wed Feb 06 10:03:01 2013 [E]: Cannot create token folder
Wed Feb 06 10:03:01 2013 [E]: File exists -
/var/lib/one/sunstone_vnc_tokens
Wed Feb 06 10:03:01 2013 [I]: VNC proxy not configured

Am 2013-02-06 05:31, schrieb Carlos Martín Sánchez:
Hi,

You will probably find more useful messages in the log file,
/var/log/one/oned.log.

It looks like the host is in error state, so OpenNebula can't monitor
it properly. Did you configure the passwordless ssh access (for the
oneadmin user) to Host01?

Regards
--
Carlos Martín, MSc
Project Engineer
OpenNebula - The Open-source Solution for Data Center Virtualization
www.OpenNebula.org [5] | cmar...@opennebula.org | @OpenNebula [6]

On Mon, Feb 4, 2013 at 5:30 PM, Johannes Thome
<johannes.th...@electrica.cujae.edu.cu> wrote:

Hello, I installed Opennebula 3.8.3 with sunstone on a 64 bit
computer with ubuntu 12.04
i have only one pc so i have only the front-end. Hopefully it works
if i try to run the VM's on my computer.

Please check somebody if i missed something in my installation or
configuration and why i got this error in Sunstone:

MESSAGE Error executing image transfer script: Error copying

chivas-Aspire-5755G:/var/lib/one/datastores/1/e709ae07335f01fdb1d23730860d07d6
to Host01:/var/lib/one//datastores/0/0/disk.0



----------------------------------------------------------------------------------

How I installed Opennebula 3.8.3 with KVM:

Programs which are useful for the installation process:

Mc

# apt-get install mc

Synaptic:

# apt-get install synaptic

Download open nebula version 3.8.3 Tarbell for Ubuntu 12.04 from the
internet:
http://downloads.opennebula.org/ [1]
or use the downloaded file you should receive with this
Documentation.
Also you receive some Gems you have to use them because the normal
installation of the gems fails.
I am going to explain later how to install a Gem manually.

Unzip with mc „Ubuntu-12.04-opennebula-3.8.3.tar.gz“ to:
/home/user/Desktop/install

Change the permissions of all files:

# cd /home/user/Desktop/install

# chmod -R 755 * (to chance the permission of all files in that
folder)

The order of packages installation:

opennebula-common: provides the user and common files
libopennebula-ruby: all ruby libraries
opennebula-node: prepares a node as an opennebula-node
opennebula-sunstone: OpenNebula Sunstone Web Interface
opennebula-tools: Command Line interface
opennebula: OpenNebula Daemon

If any of this packages gives you an error use the following command
to fix the issue:

# apt-get install -f

opennebula-common: provides the user and common files

# dpkg -i opennebula-common_3.8.3-1_all.deb
libopennebula-ruby: all ruby libraries

# dpkg -i ruby-opennebula_3.8.3-1_all.deb
opennebula-node: prepares a node as an opennebula-node

# dpkg -i opennebula-node_3.8.3-1_all.deb
opennebula-sunstone: OpenNebula Sunstone Web Interface

# dpkg -i opennebula-sunstone_3.8.3-1_all.deb

opennebula-tools: Command Line interface

# dpkg -i opennebula-tools_3.8.3-1_all.deb
opennebula: OpenNebula Daemon

# dpkg -i opennebula_3.8.3-1_amd64.deb

After the basic installation it is necessary to install the Gems for
ruby.
There for open mc in the terminal and go to the folder
/usr/share/opennebula/ and run the install_gems script.

It will fail in the second part of the script but it is necessary to
run it because the first part of the skript is also important.

Start mc from the console to install the gems manually.

# mc

unzip the gems and copy the content of each of them to
/var/lib/gems/1.8/gems/:

amazon-ec2-0.9.17.gem
curb-0.8.3.gem
daemons-1.1.9.gem
eventmachine-1.0.0.gem
json-1.7.6.gem
mysql-2.9.0.gem
net-ldap-0.3.1.gem
nokogiri-1.5.6.gem
rack-1.5.0.gem
rack-protection-1.3.2.gem
rake-10.0.3.gem
rubygems-update-1.8.24.gem
sequel-3.43.0.gem
sinatra-1.3.4.gem
sqlite3-1.3.7.gem
thin-1.5.0.gem
tilt-1.3.3.gem
uuidtools-2.1.3.gem
xml-simple-1.1.2.gem

and chance their permissions.



----------------------------------------------------------------------------------------------

after that i configured Open nebula for KVM like this:

# apt-get install qemu-utils qemu-kvm

KVM Configuration

Modify /etc/libvirt/qemu.conf

Qemu should be configured to not change file ownership. Modify
/etc/libvirt/qemu.conf to

include dynamic_ownership = 0. To be able to use the images copied
by OpenNebula, change also

the user and group under which the libvirtd is run to ”oneadmin”:

# grep -vE ’^($|#)’ /etc/libvirt/qemu.conf

user = "oneadmin"

group = "cloud" (because i don't have a group named oneadmin)

dynamic_ownership = 0

The user with access to these remotes hosts on behalf of OpenNebula
(typically <oneadmin>) has

to pertain to the <libvirtd> and <kvm> groups in order to use the
deaemon and be able to launch

Vms.

If apparmor is active (by default in Ubuntu it is), you should add
/var/lib/one to the end of

/etc/apparmor.d/libvirt-qemu
 (if not exits create this file)

owner /var/lib/one/** rw,

/etc/libvirt/libvirtd.conf : Uncomment ”listen tcp = 1”. Security
configuration is left to the

admin’s choice, file is full of useful comments to achieve a correct
configuration. As a tip, if you

don’t want to use TLS for connections set listen_tls = 0.

/etc/default/libvirt-bin : add -l option to libvirtd_opts

check because set is by default:

OpenNebula needs to know if it is going to use the KVM Driver. To
achieve this, uncomment these

drivers in /etc/one/oned.conf (they were like in the description)



-------------------------------------------------------------------------------------------------

I restarted opennebula and sunstone and started to try out if it is
working or not

i created a host:

Host information - Host01
id      0
Name    Host01
Cluster         -
State   ERROR
IM MAD  im_kvm
VM MAD  vmm_kvm
VN MAD  dummy
Host shares
Total Mem       0K
Used Mem (real)         0K
Used Mem (allocated)    0K
Total CPU       0
Used CPU (real)         0
Used CPU (allocated)    0
Running VMs     0

Host template
ERROR

MESSAGE         Error monitoring host 0 : MONITOR FAILURE 0 -
TIMESTAMP       Wed Jan 30 14:32:48 2013


------------------------------------------------------------------------
a fixed network:

Virtual Network 0 information
ID      0
Name    Network
Cluster         -
Owner   oneadmin
Group   oneadmin
Bridge  vbr1
VLAN    no
Physical device         --
VLAN ID         --
Permissions
     Owner      um-
     Group      ---
     Other      ---
-----------------------------------------------------------------
a ttylinux image:

Image "ttylinux - kvm" information
ID      0
Name    ttylinux - kvm
Datastore       default
Owner   oneadmin
Group   oneadmin
Type    OS
Register time   10:57:57 01/30/2013
Persistent      no
Source  /var/lib/one/datastores/1/e709ae07335f01fdb1d23730860d07d6
Path    /home/chivas/Desktop/ttylinux.img
Filesystem type         --
Size (Mb)       40
State   USED
Running #VMS    1
Permissions
     Owner      um-
     Group      ---
     Other      ---

Image template
DEV_PREFIX      hd
DRIVER  raw


----------------------------------------------------------------------------------
and a template for the virtual machine:

Template
NAME    Template01
OS

BOOT    hd
ARCH    x86_64

DISK

IMAGE_UNAME     oneadmin
IMAGE   ttylinux - kvm

VCPU    1
CPU     0.5
RAW

TYPE    kvm

NIC

NETWORK_UNAME   oneadmin
NETWORK         Network

MEMORY  2048
GRAPHICS

TYPE    vnc
LISTEN  0.0.0.0

INPUT

TYPE    mouse
BUS     usb

TEMPLATE_ID     0


---------------------------------------------------------------------------
i built my VM and tryed to deploy the host... he was on error first
i enabled him again.

Virtual Machine information - one-0
ID      0
Name    one-0
Owner   oneadmin
Group   oneadmin
State   FAILED
LCM State       LCM_INIT
Host    --
Start time      11:05:07 01/30/2013
Deploy ID       -
Permissions
     Owner      um-
     Group      ---
     Other      ---
**********************************************
VM template
NAME    one-0
OS

BOOT    hd
ARCH    x86_64

ERROR

MESSAGE Error executing image transfer script: Error copying

chivas-Aspire-5755G:/var/lib/one/datastores/1/e709ae07335f01fdb1d23730860d07d6
to Host01:/var/lib/one//datastores/0/0/disk.0
TIMESTAMP       Wed Jan 30 12:35:11 2013

DISK

READONLY        NO
TARGET  hda
IMAGE_ID        0
DEV_PREFIX      hd
DATASTORE       default
TM_MAD  shared
TYPE    FILE
SOURCE  /var/lib/one/datastores/1/e709ae07335f01fdb1d23730860d07d6
IMAGE_UNAME     oneadmin
DRIVER  raw
DISK_ID         0
SAVE    NO
IMAGE   ttylinux - kvm
DATASTORE_ID    1
CLONE   YES

VMID    0
VCPU    1
CPU     0.5
RAW

TYPE    kvm

NIC

NETWORK_ID      0
NETWORK_UNAME   oneadmin
BRIDGE  vbr1
NETWORK         Network
IP      192.168.2.100
VLAN    NO
MAC     02:00:c0:a8:02:64

MEMORY  2048
GRAPHICS

PORT    5900
TYPE    vnc
LISTEN  0.0.0.0

INPUT

TYPE    mouse
BUS     usb

TEMPLATE_ID     0

so the error is:

MESSAGE Error executing image transfer script: Error copying

chivas-Aspire-5755G:/var/lib/one/datastores/1/e709ae07335f01fdb1d23730860d07d6
to Host01:/var/lib/one//datastores/0/0/disk.0

what can i do to fix it?

Thanks for the help and greetings

Johannes Thomé

48 Aniversario del Instituto Superior Politecnico Jose Antonio
Echeverria, Cujae
Una obra de la Revolucion Cubana | 2 de diciembre de 1964 |
http://cujae.edu.cu [2]

Consulte la enciclopedia colaborativa cubana. http://www.ecured.cu
[3]
_______________________________________________
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org [4]



Links:
------
[1] http://downloads.opennebula.org/
[2] http://cujae.edu.cu
[3] http://www.ecured.cu
[4] http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
[5] http://www.OpenNebula.org
[6] http://twitter.com/opennebula


--
Follow me on Flickr: http://www.flickr.com/photos/johannesgoestocuba/


48 Aniversario del Instituto Superior Politecnico Jose Antonio Echeverria, Cujae
Una obra de la Revolucion Cubana | 2 de diciembre de 1964 | http://cujae.edu.cu



Consulte la enciclopedia colaborativa cubana. http://www.ecured.cu
_______________________________________________
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org

Reply via email to