[CentOS-virt] Virsh shutdown all command?

Wed Nov 25 21:24:39 UTC 2009
Ed Heron <Ed at Heron-ent.com>

From: "Torkil Zachariassen", Monday, November 23, 2009 5:35 AM

> On Fri, 2009-11-13 at 10:47 -0700, Ed Heron wrote:
>> From: "Neil Aggarwal", Thursday, November 12, 2009 5:34 PM
>>
>> > Is there a command in virsh to shutdown all domains?
>
>> I'm sure my script isn't very efficient and I'd
>> appreciate any polite, constructive suggestions.  Also, since I've pulled 
>> it
>> out of a script and modified it on the fly for virsh, there might be 
>> bugs.
>
> Fixed a bug or two and made some hoovering.
> All the best.
> ...torkil...

  Shall I assume it is useful?

  I was expecting someone to ask why I was getting a list of VM's separately 
from the section that did the shutdown...  I did that because my script does 
an action on either a default list of VM's (stop/shutdown uses list of 
active VM's, start uses list in /etc/xen/auto, reboot uses list in 
/etc/xen/reboot) or the list from the command line.  I link vm-stop and 
vm-start to vm-reboot and check $0 when it runs.

  Should we expand the script and include the other options?  Maybe rename 
it to virt-start, virt-stop, virt-reboot?  (to complement virt-install)  Or, 
call it virt-cntl and have options like --reboot, --stop & --start?