Hi Sean,<div><br></div><div>I'm intrigued why the default shutdown script didn't work out for you. Did you figure it out?</div><div><br></div><div>However, thanks a lot for contributing an alternative script to the list!</div>
<div><br></div><div>Cheers,</div><div>Jaime<br><div><div><br><div class="gmail_quote">On Fri, May 18, 2012 at 4:15 PM, Sean Abbott <span dir="ltr"><<a href="mailto:seabbott@akamai.com" target="_blank">seabbott@akamai.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<small>Here, this is slightly less ugly and still works:<div class="im"><br>
<br>
deploy_name=$(virsh --connect $LIBVIRT_URI --readonly dominfo
$deploy_id \<br>
| grep "Name:" | nawk '{print $2}')<br>
<br>
count=0<br></div>
while [ "$(virsh --connect $LIBVIRT_URI --readonly domstate
$deploy_name)" != "shut off" ]<div class="im"><br>
do <br>
sleep $POLL_INTERVAL<br>
if [ "$count" -gt "$TIMEOUT" ]<br>
then<br>
error_message "Timeout reached and VM $deploy_id is still
alive"<br>
echo "Timeout reached" >&2<br>
exit 1<br>
fi<br>
let count=count+$POLL_INTERVAL<br></div>
done<br>
</small><div class="im"><br>
<br>
On 05/18/2012 04:56 AM, Jaime Melis wrote:
</div><blockquote type="cite">
<pre><div class="im">Hello Sean,
The shutdown script includes a timeout, when it's reached it assumes the VM is
still running. However it looks like the VM is indeed shutting down after that
timeout. I think that's why your vm is in such an ugly state.
Possible fixes:
* Disable the acpi popup in your VM [1][2]
* Install the *server* distribution, not the desktop.
* Try with the appliance we created [3]
* Increase the timeout in the shutdown script [4] (not recommended!!)
[1]
<a href="http://askubuntu.com/questions/66723/how-do-i-modify-the-power-options-in-ubuntu-11-10" target="_blank">http://askubuntu.com/questions/66723/how-do-i-modify-the-power-options-in-ubuntu-11-10</a>
[2]
<a href="http://www.liberiangeek.net/2012/04/disable-shutdown-restart-logout-prompts-in-ubuntu-12-04-precise-pangolin/" target="_blank">http://www.liberiangeek.net/2012/04/disable-shutdown-restart-logout-prompts-in-ubuntu-12-04-precise-pangolin/</a>
[3] <a href="http://appliances.c12g.com/Ubuntu-Server-12.04/" target="_blank">http://appliances.c12g.com/Ubuntu-Server-12.04/</a>
[4]
<a href="https://github.com/OpenNebula/one/blob/one-3.4/src/vmm_mad/remotes/kvm/shutdown#L27" target="_blank">https://github.com/OpenNebula/one/blob/one-3.4/src/vmm_mad/remotes/kvm/shutdown#L27</a>
</div><a href="https://github.com/OpenNebula/one/blob/one-3.4/src/vmm_mad/remotes/kvm/shutdown" target="_blank"><https://github.com/OpenNebula/one/blob/one-3.4/src/vmm_mad/remotes/kvm/shutdown></a><div class="im">
Regards,
Jaime
On Thu, May 17, 2012 at 6:43 PM, Sean Abbott <<a href="mailto:seabbott@akamai.com" target="_blank">seabbott@akamai.com</a>
</div><div><div class="h5"><a href="mailto:seabbott@akamai.com" target="_blank"><mailto:seabbott@akamai.com></a>> wrote:
So, I'm attempting to create a master linux client image from which I
can deploy new clients easily. I know that I'll eventually need to get
master contextualization. However, before I get there, I'm having problems.
I created a template that used a raw hard disk and an ubuntu boot cd to
create a working ubuntu 12.04 VM. Done, worked.
I used onevm saveas <vm-name> <disk-id> "ubuntu-base-image" to set up a
save.
I used onevm shutdown <vm-id> to shut it down.
At first, it appeared to work. I was watching the vm from VNC and it
popped up a window asking if I wanted to shut it down (I need to
research how to make that window not happen in ubuntu).
However. The VM transitioned to "unknown" state about 5 minutes later
(initially it was "shutdown"), and the log says that it didn't properly
finish shutdown:
Thu May 17 16:19:33 2012 [LCM][I]: New VM state is SHUTDOWN
Thu May 17 16:24:38 2012 [VMM][I]: Command execution fail:
/var/tmp/one/vmm/kvm/shutdown one-7 172.26.210.149 7 172.26.210.149
Thu May 17 16:24:38 2012 [VMM][E]: Timeout reached and VM one-7 is still alive
Thu May 17 16:24:38 2012 [VMM][I]: Timeout reached
Thu May 17 16:24:38 2012 [VMM][I]: ExitCode: 1
Thu May 17 16:24:38 2012 [VMM][I]: Failed to execute virtualization driver
operation: shutdown.
Thu May 17 16:24:38 2012 [VMM][E]: Error shuting down VM: Timeout reached
and VM one-7 is still alive
Thu May 17 16:24:38 2012 [LCM][I]: Fail to shutdown VM. Assuming that the VM
is still RUNNING (will poll VM).
Thu May 17 16:24:38 2012 [VMM][I]: ExitCode: 0
Thu May 17 16:24:38 2012 [VMM][I]: VM not found, setting to UNKNOWN
And, presumably because of this, my image status "locked" and there is
no data that has made it into the image.
Is the answer that I need to figure out how to make ubuntu do a
clean/fast ACPI shutdown before I can make this work, or is something
else afoot. Corollary question: has anyone managed to make ubuntu do a
clean ACPI shutdown with no intervention?
Thanks!
sean
______________________________</div></div>_________________
Users mailing list
<a href="mailto:Users@lists.opennebula.org" target="_blank">Users@lists.opennebula.org</a> <a href="mailto:Users@lists.opennebula.org" target="_blank"><mailto:Users@lists.opennebula.org></a><div class="im">
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a>
--
Jaime Melis
Project Engineer
OpenNebula - The Open Source Toolkit for Cloud Computing
</div><div class="im"><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> <a href="http://www.OpenNebula.org" target="_blank"><http://www.OpenNebula.org></a> | <a href="mailto:jmelis@opennebula.org" target="_blank">jmelis@opennebula.org</a>
<a href="mailto:jmelis@opennebula.org" target="_blank"><mailto:jmelis@opennebula.org></a>
</div></pre>
</blockquote>
</div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Jaime Melis<br>Project Engineer<br>OpenNebula - The Open Source Toolkit for Cloud Computing<br><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:jmelis@opennebula.org" target="_blank">jmelis@opennebula.org</a><br>
</div></div></div>