All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Markus Breitländer" <breitlaender@stud.fh-dortmund.de>
To: unlisted-recipients:; (no To-header on input)
Cc: kvm@vger.kernel.org
Subject: Re: How to properly turn off guest VM on server shutdown?
Date: Tue, 26 Jan 2010 15:01:18 +0100	[thread overview]
Message-ID: <4B5EF5AE.2070405@stud.fh-dortmund.de> (raw)
In-Reply-To: <201001261446.45608.glennie@glennie.fr>

Hello Glennie,

Am 26.01.2010 14:46, schrieb Glennie Vignarajah:
> Le 24/01/2010 vers 18:16, dans le message intitulé "Re: How to properly turn 
> off guest VM on server shutdown?", Markus Breitländer(Markus Breitländer 
> <breitlaender@stud.fh-dortmund.de>) a écrit:
> 
>> Hi!
> 
> Hello;
> 
>> Does anyone have sample scripts for this job?
> 
> #!/bin/bash
> CONNECT_STRING="qemu:///system"
> for MACHINE in $(virsh -c "$CONNECT_STRING" list | awk '/running$/ {print 
> $2}') ; do
>   virsh -c "$CONNECT_STRING" shutdown $MACHINE
> done
> sleep 600
> 
> 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:
> 
>  * Using regedit the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows 
> NT\CurrentVersion\Windows and set the value "ShutdownWarningDialogTimeout" to 
> dword:00000001 (this will force shutdown even if users are connected)
> 
> 
> AND
> 
>  * Goto Control Pannel, admin tools and double-click "Local security settings"
>  * Expand "Local policies" and click on "Security Options" (left window pan)
>  * On the right side, locate "Shutdown: Allow system to be shutdown..." and 
> enable the option(this allows to powerdown on ctr-alt-del screen".
> 
> 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


  reply	other threads:[~2010-01-26 14:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-24 14:33 How to properly turn off guest VM on server shutdown? André Weidemann
2010-01-24 15:11 ` Daniel Bareiro
2010-01-24 15:15   ` Avi Kivity
2010-01-24 15:29     ` Anthony Liguori
2010-01-24 17:00       ` Daniel Bareiro
2010-01-24 17:16         ` Markus Breitländer
2010-01-26 13:46           ` Glennie Vignarajah
2010-01-26 14:01             ` Markus Breitländer [this message]
2010-01-26 15:55               ` Kenni Lund
2010-01-24 17:41       ` Avishay Traeger
2010-01-24 18:27         ` Daniel Bareiro
2010-01-24 18:45           ` Daniel Bareiro
2010-01-24 18:28         ` Jean-Philippe Menil
2010-01-24 20:07           ` Jernej Simončič
2010-01-25 18:46             ` Michael Tokarev
2010-01-25 19:09               ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B5EF5AE.2070405@stud.fh-dortmund.de \
    --to=breitlaender@stud.fh-dortmund.de \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.