]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
windows: restart libvirtd.socket if the socket is missing 2198/head
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 14 Feb 2024 10:38:50 +0000 (12:38 +0200)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 14 Feb 2024 10:39:55 +0000 (12:39 +0200)
The Windows job is failing because of libvirt failures, specifically
the libvirt unix socket is missing.

After some trial and error, looks like the libvirtd.socket service
needs to be restarted.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
scripts/ceph-windows/setup_libvirt

index f589a7544c712d7bc4d85e4969bac6ecc2df1f43..2b1bb76577d604f8f2c743b54382956ddcbd5ada 100644 (file)
@@ -77,8 +77,15 @@ function get_libvirt_vm_ssh_address() {
 sudo apt-get update
 sudo apt-get install -y libvirt-daemon-system virtinst cloud-image-utils qemu-kvm
 
-sudo systemctl start libvirtd
-sudo systemctl status libvirtd
+# Ensure that the libvirt socket is available, otherwise virsh commands will fail.
+# If missing, we'll restart the appropriate services.
+if [[ ! -S /var/run/libvirt/libvirt-sock ]]; then
+    sudo systemctl stop libvirtd.socket
+    sudo systemctl restart libvirtd
+
+    sudo systemctl status libvirtd.socket
+    sudo systemctl status libvirtd
+fi
 
 if ! sudo virsh net-info default &>/dev/null; then
     cat << EOF > $LIBVIRT_DIR/default-net.xml