批量关闭(软关机)
for i in $(virsh list --name --autostart); do virsh shutdown $i; done
批量关闭(硬关机)
for i in $(virsh list --name --autostart); do virsh destroy $i; done
批量开启
for i in $(virsh list --name --autostart); do virsh start $i; done
批量开启关闭状态的虚拟机
for i in $(virsh list --name --inactive); do virsh start $i; done
批量解除挂起KVM虚拟机
for vm in `virsh list | awk '{print $2}'` ; do virsh resume $vm ; done