Managing Hosts 3.0
In order to use your existing physical nodes, you have to add them to the system as OpenNebula hosts. You need the following information:
im_kvm
. These should match the Virtualization Drivers installed and more info about them can be found at the Virtualization Subsystem guide.vmm_kvm
. Information about these drivers can be found in its guide.tm_shared
. Information about these drivers can be found in its guide.
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). A very convenient use of this feature is to divide the hosts using user-defined attributes, like 'CLUSTER'. To do so you can either create a probe in the host, or update the host information with: onehost update <HOST_ID>
, adding a line containing CLUSTER=<CLUSTER_NAME>
.
From this point, the newly created machines can use this cluster names as a placement requirement:
<xterm> REQUIREMENTS = “CLUSTER = \”testing\“” </xterm>
Hosts can be added to the system anytime with the onehost
command. You can add the cluster nodes to be used by OpenNebula, like this:
<xterm> $ onehost create host01 im_kvm vmm_kvm tm_shared $ onehost create host02 im_kvm vmm_kvm tm_shared </xterm>
The status of the hosts can be checked with the onehost list
command:
<xterm> $ onehost list
ID NAME 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 STATE : MONITORED IM_MAD : im_kvm VM_MAD : vmm_kvm TM_MAD : tm_shared
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>
onehost
utility can be found in the Command Line Reference
Values for a host are inserted by the monitoring probes that run from time to time on the nodes to get information but there are times that we want to manually set a special value for a host. To be able to do this there is a onehost
command called update
. Calling this command with a host id as a parameter will fire up an editor (the one specified in EDITOR
environment variable) and you will be able to add, delete or modify some of its 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 VARIABLE=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 VARIABLE=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.
You can also manage your hosts using Sunstone. Select the Host tab, and there, you will be able to create, enable, disable, delete your hosts in a user friendly way.