qemu-discuss
[Top][All Lists]
Advanced

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

Re: shutdown all VM's command?


From: gunnar.wagner
Subject: Re: shutdown all VM's command?
Date: Fri, 2 Aug 2024 15:44:09 +0200
User-agent: Mozilla Thunderbird

sorry, that was a little too quick. Actually you need to filter that virsh list command a bit in order to only display vm names

   virsh list | tail -n +3 | awk {'print $2}'


... leading to:

   for vm in $(virsh list | tail -n +3 | awk {'print $2}') ; do echo ${vm} ; done


... leading to:

   for vm in $(virsh list | tail -n +3 | awk {'print $2}') ; do virsh shutdown ${vm} ; done




On 8/2/24 12:24 PM, gunnar.wagner wrote:
virt-manager gui I am not certain, but I guess you can easily create some cli command with a loop

start with

   for vm in $(virsh list) ; do echo ${vm} ; done

that lists all running machines and nothing else. If that output looks legit to you, go to actually shutting down those vm's

   for vm in $(virsh list) ; do virsh shutdown ${vm} ; done

this will iterate through all the vm names you saw in the 1st command and execute the virsh shutdown [vm] for each member of that list.




On 8/1/24 6:54 PM, Sbob wrote:
All;

I am using KVM/Quemu and virt-manager

Is there an easy way to shutdown all VM's with a single command or option in the virt-manager gui?





--

Gunnar Wagner | Jahnstr. 5, 19386 Lübz | mob +49.176.7080.9090

reply via email to

[Prev in Thread] Current Thread [Next in Thread]