<div dir="ltr">Yes, you are right.<div>Listen, as the documentation is not very exaustive, can you explain briefly to me how a guest agent works?</div><div>After installing it via the apt-get on the hypervisor (I am using ubuntu as host system) how can I create a script which would do this?</div>
<div>That is waiting for an acpi signal and actually shut down the guest.</div><div><br></div><div>And what other operation can you actually do with a guest agent? I would be interested in getting the current amount of memory the guest is using too...as libvirt apis just tell me the max memory allocated.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-03-29 15:12 GMT+01:00 Eric Blake <span dir="ltr"><<a href="mailto:eblake@redhat.com" target="_blank">eblake@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 03/29/2014 06:21 AM, Pasquale Dir wrote:<br>
> I am looking at the shutdown method, but if the guest system is a desktop<br>
> system, like for example ubuntu, it just has the effect to show a box<br>
> prompting the user for a shutdown/reboot/ and such.<br>
><br>
> I could enter the guest and change this default behaviour and it actually<br>
> works..but I'd like for a way to send a shutdown command without doing so.<br>
><br>
> Is it possible?<br>
<br>
</div></div>Guest shutdown is ALWAYS a cooperative action.  It sounds like your<br>
guest defaults to an interactive shutdown when an ACPI shutdown request<br>
is received.  You can install qemu-guest-agent in your guest and send<br>
shutdown via the agent instead of via ACPI - that may be a bit more<br>
responsive at doing an immediate shutdown.  But beyond that, no, there<br>
is no way to guarantee a graceful guest shutdown without guest<br>
cooperation.  If you must stop a guest, and shutdown is taking too long<br>
because the guest is not cooperating, then use the 'virsh destroy' command.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Eric Blake   eblake redhat com    <a href="tel:%2B1-919-301-3266" value="+19193013266">+1-919-301-3266</a><br>
Libvirt virtualization library <a href="http://libvirt.org" target="_blank">http://libvirt.org</a><br>
<br>
</font></span></blockquote></div><br></div>