Browse code

Merge "Test using UCA for libvirt 2.5.0"

Jenkins authored on 2017/04/13 00:15:45
Showing 2 changed files
... ...
@@ -603,8 +603,12 @@ VIRT_DRIVER=${VIRT_DRIVER:-$DEFAULT_VIRT_DRIVER}
603 603
 case "$VIRT_DRIVER" in
604 604
     ironic|libvirt)
605 605
         LIBVIRT_TYPE=${LIBVIRT_TYPE:-kvm}
606
-        if [[ "$os_VENDOR" =~ (Debian) ]]; then
607
-            LIBVIRT_GROUP=libvirt
606
+        if [[ "$os_VENDOR" =~ (Debian|Ubuntu) ]]; then
607
+            # The groups change with newer libvirt. Older Ubuntu used
608
+            # 'libvirtd', but now uses libvirt like Debian. Do a quick check
609
+            # to see if libvirtd group already exists to handle grenade's case.
610
+            LIBVIRT_GROUP=$(cut -d ':' -f 1 /etc/group | grep 'libvirtd$' || true)
611
+            LIBVIRT_GROUP=${LIBVIRT_GROUP:-libvirt}
608 612
         else
609 613
             LIBVIRT_GROUP=libvirtd
610 614
         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
 # ---------------