[one-users] How does opennebula monitor the vm's state?

Ruben S. Montero rsmontero at opennebula.org
Tue Nov 13 02:19:19 PST 2012


Hi

Yes OpenNebula uses two different monitoring processes one for the hosts
(IM's) and other for VMs (VMM). The later is the one used to query the VM
state as it is the same module used to boot, save, migrate... the VM.

You are interested in /var/lib/one/remotes/vmm/kvm/poll (replace kvm, by
xen or vmware to fit your deployment)

This script is Ruby,you have to look to the state part. Basically , the VM
info is obtained from the hypervisor (e.g. virsh dominfo for KVM), and then
KVM::get_state translate the status to an OpenNebula specific one:
   - 'a' for active, VM will return to RUNNING,
   - 'p' for paused, VM will be moved to SUSPENDED,
   - 'e' for error, VM will be moved to FAILED
   - 'd' for deleted, VM is not found VM will be in UNKNOWN

Note that the VM name should be the same (if you restarted it manually),
and that you should wait for the monitoring. The result of the monitoring
is in vm.log file.

You should see the VM back... Is there any relevant information in vm.log?

Cheers

Ruben




On Tue, Nov 13, 2012 at 7:40 AM, Valentin Bud <valentin.bud at gmail.com>wrote:

> Hello Dylan,
>
> On Tue, Nov 13, 2012 at 01:26:14PM +0800, cmcc.dylan wrote:
> > Hi, everyone!
> >     As we know, opennebula defines vm's life-cycle state, for example:
> RUNNING,UNKNOWN. I have some questions about vm's life-cycle state.
> > 1. I find a problem that when vm's state becomes unknown , after that,
> even though the vm becomes right, the vm's state will keep unknown all the
> time.
> > 2. opennebula uses what way to judge the vm's state when it executes
> monitoring action. for example, which funtions used in opennebula source
> code.
>
> The Information Manager [1], is in charge of monitoring. Start your way
> from `/etc/one/oned.conf`, the IM_MAD section. I use KVM, your mileage
> may vary.
>
> ```
> IM_MAD = [
>       name       = "im_kvm",
>       executable = "one_im_ssh",
>       arguments  = "-r 0 -t 15 kvm" ]
> ```
>
> The executable can be found in `/usr/lib/one/mads/one_im_ssh`. You can
> track from there which programs get executed and see the functions you
> are interested in.
>
> I have followed the scripts path a couple of days ago. I can tell you that
> there are some shell scripts involved and quite a lot of Ruby code.
> Goodluck.
>
> >
> >
> > look forward to some helps!
>
> Cheers and Goodwill,
> v
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>



-- 
Ruben S. Montero, PhD
Project co-Lead and Chief Architect
OpenNebula - The Open Source Solution for Data Center Virtualization
www.OpenNebula.org | rsmontero at opennebula.org | @OpenNebula
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20121113/82601536/attachment-0002.htm>


More information about the Users mailing list