<div dir="ltr">Hi Simon + Nistor,<div><br></div><div>We've done some tests in the stock drivers when the VM is shutdown (from inside) the VM disappears from the list, show we cannot get the state (not even with --all). How do you get the paused state?</div>
<div><br></div><div>On the other hand, the libvirt hook seems a good approach, since we could create a file in the VM directory (e.g. .shutdown-inside) and report the state accordingly. However we made some tests and there is no difference between the two. </div>
<div><br></div><div>This hook:</div><div><div><br></div><div>#!/bin/bash</div><div><br></div><div>echo "`date`: $*" >> /tmp/hook</div></div><div><br></div><div>Gives the same in both cases:</div><div><br>
</div>
<div><div>Thu Oct 10 11:27:56 CEST 2013: one-17 stopped end - <---- shutdown inside</div><div>Thu Oct 10 11:27:56 CEST 2013: one-17 release end -</div><div>Thu Oct 10 11:33:07 CEST 2013: one-17 prepare begin -</div><div>
Thu Oct 10 11:33:07 CEST 2013: one-17 start begin - <---- boot</div><div>Thu Oct 10 11:33:07 CEST 2013: one-17 started begin -</div><div>Thu Oct 10 11:34:02 CEST 2013: one-17 stopped end - <---- shutdown via libvirt</div>
<div>Thu Oct 10 11:34:02 CEST 2013: one-17 release end -</div></div><div><br></div><div>So, the real problem is how to determine if the VM has been shutdown from inside or not....</div><div><br></div><div>Cheers</div><div>
<br></div><div>Ruben</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Oct 7, 2013 at 12:37 PM, Nistor Andrei <span dir="ltr"><<a href="mailto:coder.tux@gmail.com" target="_blank">coder.tux@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi,<br><br></div>Maybe you can use libvirt hooks[1] to notify oned via the xmlrpc that the VMs have shut down?</div>
<div><br>[1] <a href="http://libvirt.org/hooks.html" target="_blank">http://libvirt.org/hooks.html</a><span class="HOEnZb"><font color="#888888"><br>
<br></font></span></div><span class="HOEnZb"><font color="#888888">Andrei<br></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Oct 4, 2013 at 6:45 PM, Simon Boulet <span dir="ltr"><<a href="mailto:simon@nostalgeek.com" target="_blank">simon@nostalgeek.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Here our driver reports the state as returned by Libvirt [1], which<br>
reports VM terminated from the inside (shutdown) as Paused. When the<br>
OpenNebula driver sees a VM as being reported as paused [2], it<br>
switches the VM to SUSPENDED state in OpenNebula. Then you can restart<br>
the VM by issuing the resume action [3].<br>
<br>
So, I think OpenNebula has the building blocks for that, but I'm just<br>
unsure how it is implemented in the different OpenNebula drivers.<br>
<br>
[1] <a href="http://wiki.libvirt.org/page/VM_lifecycle#States_that_a_guest_domain_can_be_in" target="_blank">http://wiki.libvirt.org/page/VM_lifecycle#States_that_a_guest_domain_can_be_in</a><br>
[2] <a href="http://opennebula.org/documentation:rel4.2:devel-vmm#poll_information" target="_blank">http://opennebula.org/documentation:rel4.2:devel-vmm#poll_information</a><br>
[3] <a href="http://opennebula.org/documentation:rel4.2:api#onevmaction" target="_blank">http://opennebula.org/documentation:rel4.2:api#onevmaction</a><br>
<span><font color="#888888"><br>
Simon<br>
</font></span><div><div><br>
On Fri, Oct 4, 2013 at 9:43 AM, Parag Mhashilkar <<a href="mailto:parag@fnal.gov" target="_blank">parag@fnal.gov</a>> wrote:<br>
> Hi Sharuzzaman,<br>
><br>
> Thanks for your response. I am aware of the fact that OpenNebula requires human intervention when shutdown is issued from inside the VM. We can write scripts to do lot of things, but when in the business of resource provisioning, the resource provider does not necessarily control what runs in the VM, application that launches them and for obvious reasons I am not giving any access to ONE's database to the users. So these alternatives seem merely hacks rather than a much cleaner solution from the service.<br>
><br>
> Such a feature is useful from a infrastructure provider's point of view. If AWS has done it (and Openstack I think) then there be a way out.<br>
><br>
> -Parag<br>
><br>
><br>
> On Oct 3, 2013, at 9:27 PM, Sharuzzaman Ahmat Raslan wrote:<br>
><br>
>> Hi Parag,<br>
>><br>
>> I believe OpenNebula need to have human intervention to really determine whether to remove or not the VM that it has deployed.<br>
>><br>
>> I also think that you can write a script that signal or call OpenNebula command as soon as the task finish, to shutdown the VM. Or if direct calling command not possible, maybe your application can write some status in a database, and a script in OpenNebula read that status and make decision from it.<br>
>><br>
>> Thanks.<br>
>><br>
>><br>
>> On Thu, Oct 3, 2013 at 11:38 PM, Parag Mhashilkar <<a href="mailto:parag@fnal.gov" target="_blank">parag@fnal.gov</a>> wrote:<br>
>> Hi,<br>
>><br>
>> Does OpenNebula EC2 interface support shutting down a VM from with in the VM itself and have the scheduler recognize that VM has been stopped/shutdown? How do we enable this feature? At Fermi, we have OpenNebula v3.2 and when the VM is shutdown it stays in the UNKNOWN state. Can OpenNebula get this ACPI shutdown info from virsh and handle the situation more gracefully rather than putting the VM in UKNOWN state?<br>
>><br>
>> Here is an example why I think something like this is useful:<br>
>><br>
>> When VMs are launched to perform certain tasks (classical equivalent of batch nodes), only the processes running in the VM know when the task is done and can shutdown the VM freeing up the resources. Running VM past the task life is wasted resources and controlling the lifetime of VM from outside is not always possible.<br>
>><br>
>> In case of AWS, it supports following which is very good feature to have when controlling the VMs in above scenario.<br>
>> ec2-run-instaces --instance-initiated-shutdown-behavior <stop|terminate><br>
>><br>
>> How do we achieve this with Opennebula?<br>
>><br>
>> Thanks & Regards<br>
>> +==========================================================<br>
>> | Parag Mhashilkar<br>
>> | Fermi National Accelerator Laboratory, MS 120<br>
>> | Wilson & Kirk Road, Batavia, IL - 60510<br>
>> |----------------------------------------------------------<br>
>> | Phone: <a href="tel:1%20%28630%29%20840-6530" value="+16308406530" target="_blank">1 (630) 840-6530</a> Fax: <a href="tel:1%20%28630%29%20840-2783" value="+16308402783" target="_blank">1 (630) 840-2783</a><br>
>> |----------------------------------------------------------<br>
>> | Wilson Hall, 806E (Nov 8, 2012 - To date)<br>
>> | Wilson Hall, 867E (Nov 17, 2010 - Nov 7, 2012)<br>
>> | Wilson Hall, 863E (Apr 24, 2007 - Nov 16, 2010)<br>
>> | Wilson Hall, 856E (Mar 21, 2005 - Apr 23, 2007)<br>
>> +==========================================================<br>
>><br>
>><br>
>> _______________________________________________<br>
>> Users mailing list<br>
>> <a href="mailto:Users@lists.opennebula.org" target="_blank">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>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> Sharuzzaman Ahmat Raslan<br>
><br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.opennebula.org" target="_blank">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>
><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org" target="_blank">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>
</div></div></blockquote></div><br></div>
</div></div><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>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div><div>-- <br></div></div>Ruben S. Montero, PhD<br>Project co-Lead and Chief Architect<div>OpenNebula - Flexible Enterprise Cloud Made Simple<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</div></div>
</div>