From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Markus_Breitl=E4nder?= Subject: Re: How to properly turn off guest VM on server shutdown? Date: Tue, 26 Jan 2010 15:01:18 +0100 Message-ID: <4B5EF5AE.2070405@stud.fh-dortmund.de> References: <4B5C5A31.7060807@web.de> <20100124170015.GD24932@defiant.freesoftware> <4B5C8057.4010405@stud.fh-dortmund.de> <201001261446.45608.glennie@glennie.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org To: unlisted-recipients:; (no To-header on input) Return-path: Received: from betty.stud.FH-Dortmund.DE ([193.25.19.66]:57945 "EHLO mail.stud.fh-dortmund.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752366Ab0AZOBM (ORCPT ); Tue, 26 Jan 2010 09:01:12 -0500 Received: from [192.168.0.17] (i538768D4.versanet.de [83.135.104.212]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.stud.fh-dortmund.de (Postfix) with ESMTP id 839E0118F9D9 for ; Tue, 26 Jan 2010 15:01:10 +0100 (CET) In-Reply-To: <201001261446.45608.glennie@glennie.fr> Sender: kvm-owner@vger.kernel.org List-ID: Hello Glennie, Am 26.01.2010 14:46, schrieb Glennie Vignarajah: > Le 24/01/2010 vers 18:16, dans le message intitul=E9 "Re: How to prop= erly turn=20 > off guest VM on server shutdown?", Markus Breitl=E4nder(Markus Breitl= =E4nder=20 > ) a =E9crit: >=20 >> Hi! >=20 > Hello; >=20 >> Does anyone have sample scripts for this job? >=20 > #!/bin/bash > CONNECT_STRING=3D"qemu:///system" > for MACHINE in $(virsh -c "$CONNECT_STRING" list | awk '/running$/ {p= rint=20 > $2}') ; do > virsh -c "$CONNECT_STRING" shutdown $MACHINE > done > sleep 600 >=20 > This code will shutdown all runnning hosts with acpi en enabled. > I haven't tested it under windows Seven, but under win 2003, you have= modify: >=20 > * Using regedit the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows=20 > NT\CurrentVersion\Windows and set the value "ShutdownWarningDialogTim= eout" to=20 > dword:00000001 (this will force shutdown even if users are connected) >=20 >=20 > AND >=20 > * Goto Control Pannel, admin tools and double-click "Local security = settings" > * Expand "Local policies" and click on "Security Options" (left wind= ow pan) > * On the right side, locate "Shutdown: Allow system to be shutdown..= =2E" and=20 > enable the option(this allows to powerdown on ctr-alt-del screen". >=20 > HTH I was thinking about a script that doesn't use virsh. I would be intrested in what commands virsh uses in it's 'shutdown' command... I haven't been working on my own script yet. Up to know i have in mind to use qemu monitor command 'system_powerdown' and maybe ssh into linux boxes to get em down (but the latter is not really nice). By the way when testing manually, i experianced you might want to use the 'system_powerdown' command twice / execute it two times shortly after another to get windows machines down. Greets, Markus