W virshjaki sposób mogę sprawdzić, które domeny są oznaczone jako autostart? virsh listnie pokazuje, które domeny są oznaczone jako autostart.
W virshjaki sposób mogę sprawdzić, które domeny są oznaczone jako autostart? virsh listnie pokazuje, które domeny są oznaczone jako autostart.
Odpowiedzi:
Ze strony podręcznika: -
virsh list --autostart
powinien to zrobić.
--allaby uwzględnić również zatrzymane domeny. Np.sudo virsh list --autostart --all
Zdaję sobie sprawę, że jest to bardzo stary wątek - w moim systemie RHEL6.5 działa to, ze zwykłym zastrzeżeniem, że jeśli nie powiesz --all, virsh listwyświetli tylko informacje o uruchamianiu domen.
Więc spróbuj
virsh list --all --autostart
i / lub
virsh list --all --no-autostart
Pracuje dla mnie.
Oto uniwersalny skrypt do pobierania informacji o autostartie. Aby lista domen (VM), które umożliwiają umieszczone w autostart virsh_autostart_info.shi uruchomić:
virsh_autostart_info.sh | grep -i enabled. Możesz oczywiście to wyczyścić, aby wyświetlać tylko nazwy lub cokolwiek chcesz.
##
# Configuration
#
VIRSH=/usr/bin/virsh
##
# Simple list of domains (VMs)
#
list_domains() {
# list, skipping headers, capturing number and domName, and then strip Id and State column
$VIRSH list --all | awk '$1 == "-" || $1+0 > 0 { print $2 }'
}
##
# Processing
#
## full info
#echo ""
#list_domains | while read vmName; do
# $VIRSH dominfo $vmName
#done
# just autostart info
echo ""
list_domains | while read vmName; do
autostartStatus=`$VIRSH dominfo $vmName | grep -i autostart`
echo $vmName $autostartStatus
done
virsh list --autostartnie działa dla mnie w centos 6.5