Browse code

Test using UCA for libvirt 2.5.0

We have had issues with libvirt 1.3.1 which is stock on Xenial. Try
using 2.5.0 from UCA instead.

Related-Bug: 1643911
Related-Bug: 1646779
Related-Bug: 1638982
Change-Id: Ia4434541c71f050fe1ffb54f4c4c1e302391d00b

Clark Boylan authored on 2017/03/30 02:28:55
Showing 2 changed files
... ...
@@ -599,8 +599,12 @@ VIRT_DRIVER=${VIRT_DRIVER:-$DEFAULT_VIRT_DRIVER}
599 599
 case "$VIRT_DRIVER" in
600 600
     ironic|libvirt)
601 601
         LIBVIRT_TYPE=${LIBVIRT_TYPE:-kvm}
602
-        if [[ "$os_VENDOR" =~ (Debian) ]]; then
603
-            LIBVIRT_GROUP=libvirt
602
+        if [[ "$os_VENDOR" =~ (Debian|Ubuntu) ]]; then
603
+            # The groups change with newer libvirt. Older Ubuntu used
604
+            # 'libvirtd', but now uses libvirt like Debian. Do a quick check
605
+            # to see if libvirtd group already exists to handle grenade's case.
606
+            LIBVIRT_GROUP=$(cut -d ':' -f 1 /etc/group | grep 'libvirtd$' || true)
607
+            LIBVIRT_GROUP=${LIBVIRT_GROUP:-libvirt}
604 608
         else
605 609
             LIBVIRT_GROUP=libvirtd
606 610
         fi
... ...
@@ -67,6 +67,33 @@ else
67 67
     echo_summary "WARNING: unable to reserve keystone ports"
68 68
 fi
69 69
 
70
+# Ubuntu Cloud Archive
71
+#---------------------
72
+# We've found that Libvirt on Xenial is flaky and crashes enough to be
73
+# a regular top e-r bug. Opt into Ubuntu Cloud Archive if on Xenial to
74
+# get newer Libvirt.
75
+if [[ "$DISTRO" = "xenial" ]]; then
76
+    # This pulls in apt-add-repository
77
+    install_package "software-properties-common"
78
+    # Use UCA for newer libvirt. Should give us libvirt 2.5.0.
79
+    if [[ -f /etc/ci/mirror_info.sh ]] ; then
80
+        # If we are on a nodepool provided host and it has told us about where
81
+        # we can find local mirrors then use that mirror.
82
+        source /etc/ci/mirror_info.sh
83
+
84
+        sudo apt-add-repository -y "deb $NODEPOOL_UCA_MIRROR xenial-updates/ocata main"
85
+
86
+        # Disable use of libvirt wheel here as presence of mirror implies
87
+        # presence of cached wheel build against older libvirt binary.
88
+        # TODO(clarkb) figure out how to use wheel again.
89
+        sudo bash -c 'echo "no-binary = libvirt-python" >> /etc/pip.conf'
90
+    else
91
+        # Otherwise use upstream UCA
92
+        sudo add-apt-repository -y cloud-archive:ocata
93
+    fi
94
+    sudo apt-get update
95
+fi
96
+
70 97
 
71 98
 # Python Packages
72 99
 # ---------------