Managing Hosts 3.4

In order to use your existing physical nodes, you have to add them to the system as OpenNebula hosts. You need the following information:

:!: Before adding a host check that you can ssh to it without being prompt for a password

Scheduler Policies

You can define global Scheduler Policies for all VMs in the sched.conf file, follow the Scheduler Guide for more information. Additionally, users can require their virtual machines to be deployed in a host that meets certain constrains. These constrains can be defined using any attribute reported by onehost show, like the architecture (ARCH).

The attributes and values for a host are inserted by the monitoring probes that run from time to time on the nodes to get information. The administrator can add custom attributes either creating a probe in the host, or updating the host information with: onehost update <HOST_ID>. Calling this command will fire up an editor (the one specified in the EDITOR environment variable) and you will be able to add, delete or modify some of those values.

<xterm> $ onehost show 3 […] MONITORING INFORMATION CPUSPEED=2.2GHz FREECPU=800 FREEMEMORY=16777216 HOSTNAME=ursa06 HYPERVISOR=dummy TOTALCPU=800 TOTALMEMORY=16777216 USEDCPU=0 USEDMEMORY=0

$ onehost update 3

[in editor, add CUSTOM_ATTRIBUTE=VALUE]

$onehost show 3 […] MONITORING INFORMATION CPUSPEED=2.2GHz FREECPU=800 FREEMEMORY=16777216 HOSTNAME=ursa06 HYPERVISOR=dummy TOTALCPU=800 TOTALMEMORY=16777216 USEDCPU=0 USEDMEMORY=0 CUSTOM_ATTRIBUTE=VALUE </xterm>

This feature is useful when we want to separate a series of hosts or marking some special features of different hosts. These values can then be used for scheduling the same as the ones added by the monitoring probes, as a placement requirement:

REQUIREMENTS = "CUSTOM_ATTRIBUTE = \"SOME_VALUE\""

A Sample Session

Hosts can be added to the system anytime with the onehost command. You can add the hosts to be used by OpenNebula like this:

<xterm> $ onehost create host01 –im im_kvm –vm vmm_kvm –net dummy $ onehost create host02 –im im_kvm –vm vmm_kvm –net dummy </xterm>

The status of the hosts can be checked with the onehost list command:

<xterm> $ onehost list

ID NAME         CLUSTER     RVM   TCPU   FCPU   ACPU   TMEM   FMEM   AMEM STAT
 0 host01       -             7    400    290    400   3.7G   2.2G   3.7G   on
 1 host02       -             2    400    294    400   3.7G   2.2G   3.7G   on
 2 host03       -             0    400    312    400   3.7G   2.2G   3.7G  off

</xterm>

And specific information about a host with show:

<xterm> $ onehost show host01 HOST 0 INFORMATION ID : 0 NAME : host01 CLUSTER : - STATE : MONITORED IM_MAD : im_kvm VM_MAD : vmm_kvm VN_MAD : dummy LAST MONITORING TIME : 1332756227

HOST SHARES MAX MEM : 3921416 USED MEM (REAL) : 1596540 USED MEM (ALLOCATED) : 0 MAX CPU : 400 USED CPU (REAL) : 74 USED CPU (ALLOCATED) : 0 RUNNING VMS : 7

MONITORING INFORMATION ARCH=x86_64 CPUSPEED=2393 FREECPU=326.0 FREEMEMORY=2324876 HOSTNAME=rama HYPERVISOR=kvm MODELNAME=“Intel(R) Core(TM) i5 CPU M 450 @ 2.40GHz” NETRX=0 NETTX=0 TOTALCPU=400 TOTALMEMORY=3921416 USEDCPU=74.0 USEDMEMORY=1596540 </xterm>

If you want not to use a given host you can temporarily disable it:

<xterm> $ onehost disable host01 </xterm>

A disabled host should be listed with STAT off by onehost list. You can also remove a host permanently with:

<xterm> $ onehost delete host01 </xterm>

:!: Detailed information of the onehost utility can be found in the Command Line Reference

Using Sunstone to Manage Hosts

You can also manage your hosts using Sunstone. Select the Host tab, and there, you will be able to create, enable, disable, delete and see information about your hosts in a user friendly way.