To check on the systemd case I picked a rather slow system and spawned 30 guests.
I set all those to autostart and then shut them down.
Starting them sequentially as well as concurrently takes about ~20 seconds.
/var/run/libvirt/libvirt-sock is gone after the service is stopped.
With the following script this can be tested:
$ cat test-restart.sh
#!/bin/bash
set -uxe
date
sudo systemctl start libvirtd
date
# right after start (1-2 seconds usually) check status of sockets and guests
while /bin/true; do
ls -laF /var/run/libvirt/libvirt-sock
virsh list
sudo systemctl status libvirtd --no-pager
date
sleep 2s
done
You will see that the "virsh list" is kind of blocking until other internal tasks are done.
That pretty much ends up after the ~20 seconds that I counted until it goes on.
All guests are started then and things are good.
But the socket is available right after start, yet if you do a request you are enqueued and have to wait - which is fine.
That said artful is good, I have to check former versions if that was an upstream change in the daemons behavior to only return once the socket is avail.
To check on the systemd case I picked a rather slow system and spawned 30 guests.
I set all those to autostart and then shut them down.
Starting them sequentially as well as concurrently takes about ~20 seconds.
/var/run/ libvirt/ libvirt- sock is gone after the service is stopped.
With the following script this can be tested: libvirt/ libvirt- sock
$ cat test-restart.sh
#!/bin/bash
set -uxe
date
sudo systemctl start libvirtd
date
# right after start (1-2 seconds usually) check status of sockets and guests
while /bin/true; do
ls -laF /var/run/
virsh list
sudo systemctl status libvirtd --no-pager
date
sleep 2s
done
You will see that the "virsh list" is kind of blocking until other internal tasks are done.
That pretty much ends up after the ~20 seconds that I counted until it goes on.
All guests are started then and things are good.
But the socket is available right after start, yet if you do a request you are enqueued and have to wait - which is fine.
Output: libvirt/ libvirt- sock libvirt/ libvirt- sock= ------- ------- ------- ------- ------- ------- ---
$ ./test-restart.sh
+ date
Mi 6. Sep 04:40:34 EDT 2017
+ sudo systemctl start libvirtd
+ date
Mi 6. Sep 04:40:34 EDT 2017
+ /bin/true
+ ls -laF /var/run/
srwxrwx--- 1 root libvirtd 0 Sep 6 04:40 /var/run/
+ virsh list
Id Name State
-------
1 artful-test30 running
2 artful-test9 running
3 artful-test8 running
4 artful-test23 running
5 artful-test13 running
6 artful-test19 running
7 artful-test11 running
8 artful-test15 running
9 artful-test10 running
10 artful-test17 running
11 artful-test5 running
12 artful-test24 running
13 artful-test26 running
14 artful-test20 running
15 artful-test2 running
16 artful-test29 running
17 artful-test22 running
18 artful-test27 running
19 artful-test14 running
20 artful-test6 running
21 artful-test25 running
22 artful-test12 running
23 artful-test3 running
24 artful-test21 running
25 artful-test7 running
26 artful-test16 running
27 artful-test28 running
28 artful-test18 running
29 artful-test1 running
30 artful-test4 running
+ sudo systemctl status libvirtd --no-pager system/ libvirtd. service; enabled; vendor preset: enabled) libvirt. org slice/libvirtd. service file=/var/ lib/libvirt/ dnsmasq/ default. conf --leasefile-ro --dhcp- script= /usr/lib/ libvirt/ libvirt_ …er file=/var/ lib/libvirt/ dnsmasq/ default. conf --leasefile-ro --dhcp- script= /usr/lib/ libvirt/ libvirt_ …er test30, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test9,debug- threads= on -S -object secret, id=masterKey0, format= raw,file= /v…on test8,debug- threads= on -S -object secret, id=masterKey0, format= raw,file= /v…on test23, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test13, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test19, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test11, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test15, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test10, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test17, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test5,debug- threads= on -S -object secret, id=masterKey0, format= raw,file= /v…on test24, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test26, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test20, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test2,debug- threads= on -S -object secret, id=masterKey0, format= raw,file= /v…on test29, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test22, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test27, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test14, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test6,debug- threads= on -S -object secret, id=masterKey0, format= raw,file= /v…on test25, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test12, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test3,debug- threads= on -S -object secret, id=masterKey0, format= raw,file= /v…on test21, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test7,debug- threads= on -S -object secret, id=masterKey0, format= raw,file= /v…on test16, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test28, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test18, debug-threads= on -S -object secret, id=masterKey0, format= raw,file= /…on test1,debug- threads= on -S -object secret, id=masterKey0, format= raw,file= /v…on test4,debug- threads= on -S -object secret, id=masterKey0, format= raw,file= /v…on
● libvirtd.service - Virtualization daemon
Loaded: loaded (/lib/systemd/
Active: active (running) since Wed 2017-09-06 04:40:34 EDT; 23s ago
Docs: man:libvirtd(8)
http://
Main PID: 171137 (libvirtd)
Tasks: 303 (limit: 32768)
Memory: 93.7M
CPU: 15.383s
CGroup: /system.
├─ 3848 /usr/sbin/dnsmasq --conf-
├─ 3849 /usr/sbin/dnsmasq --conf-
├─171137 /usr/sbin/libvirtd
├─171530 qemu-system-s390x -enable-kvm -name guest=artful-
├─171640 qemu-system-s390x -enable-kvm -name guest=artful-
├─171789 qemu-system-s390x -enable-kvm -name guest=artful-
├─171897 qemu-system-s390x -enable-kvm -name guest=artful-
├─171970 qemu-system-s390x -enable-kvm -name guest=artful-
├─172041 qemu-system-s390x -enable-kvm -name guest=artful-
├─172116 qemu-system-s390x -enable-kvm -name guest=artful-
├─172196 qemu-system-s390x -enable-kvm -name guest=artful-
├─172273 qemu-system-s390x -enable-kvm -name guest=artful-
├─172348 qemu-system-s390x -enable-kvm -name guest=artful-
├─172429 qemu-system-s390x -enable-kvm -name guest=artful-
├─172506 qemu-system-s390x -enable-kvm -name guest=artful-
├─172588 qemu-system-s390x -enable-kvm -name guest=artful-
├─172671 qemu-system-s390x -enable-kvm -name guest=artful-
├─172748 qemu-system-s390x -enable-kvm -name guest=artful-
├─172827 qemu-system-s390x -enable-kvm -name guest=artful-
├─172899 qemu-system-s390x -enable-kvm -name guest=artful-
├─172977 qemu-system-s390x -enable-kvm -name guest=artful-
├─173175 qemu-system-s390x -enable-kvm -name guest=artful-
├─173318 qemu-system-s390x -enable-kvm -name guest=artful-
├─173404 qemu-system-s390x -enable-kvm -name guest=artful-
├─173477 qemu-system-s390x -enable-kvm -name guest=artful-
├─173554 qemu-system-s390x -enable-kvm -name guest=artful-
├─173629 qemu-system-s390x -enable-kvm -name guest=artful-
├─173706 qemu-system-s390x -enable-kvm -name guest=artful-
├─173784 qemu-system-s390x -enable-kvm -name guest=artful-
├─173878 qemu-system-s390x -enable-kvm -name guest=artful-
├─173954 qemu-system-s390x -enable-kvm -name guest=artful-
├─174190 qemu-system-s390x -enable-kvm -name guest=artful-
└─174303 qemu-system-s390x -enable-kvm -name guest=artful-
Sep 06 04:40:55 s1lp5 dnsmasq-dhcp[3848]: DHCPDISCOVER( virbr0) 192.168.122.48 52:54:00:52:27:0d
Sep 06 04:40:55 s1lp5 dnsmasq-dhcp[3848]: DHCPOFFER(virbr0) 192.168.122.48 52:54:00:52:27:0d
Sep 06 04:40:55 s1lp5 dnsmasq-dhcp[3848]: DHCPREQUEST(virbr0) 192.168.122.225 52:54:00:bf:24:14
Sep 06 04:40:55 s1lp5 dnsmasq-dhcp[3848]: DHCPACK(virbr0) 192.168.122.225 52:54:00:bf:24:14 artful-test17
Sep 06 04:40:55 s1lp5 dnsmasq-dhcp[3848]: DHCPREQUEST(virbr0) 192.168.122.115 52:54:00:d7:97:d4
Sep 06 04:40:55 s1lp5 dnsmasq-dhcp[3848]: DHCPACK(virbr0) 192.168.122.115 52:54:00:d7:97:d4 artful-test24
Sep 06 04:40:55 s1lp5 dnsmasq-dhcp[3848]: DHCPREQUEST(virbr0) 192.168.122.18 52:54:00:75:b1:b2
Sep 06 04:40:55 s1lp5 dnsmasq-dhcp[3848]: DHCPACK(virbr0) 192.168.122.18 52:54:00:75:b1:b2 artful-test26
Sep 06 04:40:55 s1lp5 dnsmasq-dhcp[3848]: DHCPREQUEST(virbr0) 192.168.122.172 52:54:00:99:82:92
Sep 06 04:40:55 s1lp5 dnsmasq-dhcp[3848]: DHCPACK(virbr0) 192.168.122.172 52:54:00:99:82:92 artful-test15
+ date
Mi 6. Sep 04:40:57 EDT 2017
+ sleep 2s
That said artful is good, I have to check former versions if that was an upstream change in the daemons behavior to only return once the socket is avail.