Re: How to properly turn off guest VM on server shutdown?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxx>) 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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux