Hi<div><br></div><div>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.</div>

<div><br></div><div>You are interested in /var/lib/one/remotes/vmm/kvm/poll (replace kvm, by xen or vmware to fit your deployment)</div><div><br></div><div>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:</div>

<div>   - 'a' for active, VM will return to RUNNING, </div><div>   - 'p' for paused, VM will be moved to SUSPENDED, </div><div>   - 'e' for error, VM will be moved to FAILED</div><div>   - 'd' for deleted, VM is not found VM will be in UNKNOWN</div>

<div><br></div><div>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. </div><div><br></div><div>You should see the VM back... Is there any relevant information in vm.log?</div>

<div><br></div><div>Cheers</div><div><br></div><div>Ruben</div><div><br></div><div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 13, 2012 at 7:40 AM, Valentin Bud <span dir="ltr"><<a href="mailto:valentin.bud@gmail.com" target="_blank">valentin.bud@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Dylan,<br>
<div><div class="h5"><br>
On Tue, Nov 13, 2012 at 01:26:14PM +0800, cmcc.dylan wrote:<br>
> Hi, everyone!<br>
>     As we know, opennebula defines vm's life-cycle state, for example: RUNNING,UNKNOWN. I have some questions about vm's life-cycle state.<br>
> 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.<br>
> 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.<br>
<br>
</div></div>The Information Manager [1], is in charge of monitoring. Start your way<br>
from `/etc/one/oned.conf`, the IM_MAD section. I use KVM, your mileage<br>
may vary.<br>
<br>
```<br>
IM_MAD = [<br>
      name       = "im_kvm",<br>
      executable = "one_im_ssh",<br>
      arguments  = "-r 0 -t 15 kvm" ]<br>
```<br>
<br>
The executable can be found in `/usr/lib/one/mads/one_im_ssh`. You can<br>
track from there which programs get executed and see the functions you<br>
are interested in.<br>
<br>
I have followed the scripts path a couple of days ago. I can tell you that<br>
there are some shell scripts involved and quite a lot of Ruby code. Goodluck.<br>
<div class="im"><br>
><br>
><br>
> look forward to some helps!<br>
<br>
</div>Cheers and Goodwill,<br>
v<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org">Users@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Ruben S. Montero, PhD<br>Project co-Lead and Chief Architect<br>OpenNebula - The Open Source Solution for Data Center Virtualization<br><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:rsmontero@opennebula.org" target="_blank">rsmontero@opennebula.org</a> | @OpenNebula<br>


</div>