]> xenbits.xensource.com Git - openstack/ci-loop-config.git/commitdiff
nodepool: Create Ubuntu Xenial images
authorAnthony PERARD <anthony.perard@citrix.com>
Wed, 2 Nov 2016 12:13:48 +0000 (12:13 +0000)
committerAnthony PERARD <anthony.perard@citrix.com>
Wed, 2 Nov 2016 17:54:21 +0000 (17:54 +0000)
nodepool/nodepool.yaml
nodepool/scripts/prepare_node_devstack_xen_xenial.sh [new file with mode: 0755]

index 41660412b0ee3ecc41d3c2d2be3c7ad22403e243..20a69ffeaad78b16524178b12f7cfed38102e5f2 100644 (file)
@@ -49,11 +49,11 @@ providers:
     images:
       - name: ds-xen
         # This is the image name to use found in this provider's `glance image-list`
-        base-image: 'Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)'
+        base-image: 'Ubuntu 16.04 LTS (Xenial Xerus) (PVHVM)'
         min-ram: 8192
         name-filter: 'Performance'
         # This is the script that will be used to prepare the image
-        setup: prepare_node_devstack_xen.sh
+        setup: prepare_node_devstack_xen_xenial.sh
         #Set the public key part only of the jenkin's key (no whitespace) to the NODEPOOL_SSH_KEY environment variable in order to
         #inject it into the image's jenkins user .ssh/authorized_keys
         #This key will be used to log in and setup jenkins on the target VM
@@ -63,11 +63,11 @@ providers:
             xenapi_use_agent: 'false'
       - name: ts-xen
         # This is the image name to use found in this provider's `glance image-list`
-        base-image: 'Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)'
+        base-image: 'Ubuntu 16.04 LTS (Xenial Xerus) (PVHVM)'
         min-ram: 8192
         name-filter: 'Performance'
         # This is the script that will be used to prepare the image
-        setup: prepare_node_devstack_xen.sh
+        setup: prepare_node_devstack_xen_xenial.sh
         #Set the public key part only of the jenkin's key (no whitespace) to the NODEPOOL_SSH_KEY environment variable in order to
         #inject it into the image's jenkins user .ssh/authorized_keys
         #This key will be used to log in and setup jenkins on the target VM
diff --git a/nodepool/scripts/prepare_node_devstack_xen_xenial.sh b/nodepool/scripts/prepare_node_devstack_xen_xenial.sh
new file mode 100755 (executable)
index 0000000..2d23365
--- /dev/null
@@ -0,0 +1,91 @@
+#!/bin/bash
+set -xe
+
+# remove unused files
+rm -v read-vendor-json.py
+rm -v static-network-config
+# None of the .deb are for xenial
+rm -v *.deb
+
+./prepare_node_devstack.sh
+
+# Install Xen and update the kernel
+sudo apt-get -y install htop vim git pwgen xen-hypervisor linux-image-extra-virtual
+
+# Override any overriden value
+sudo tee /etc/default/grub.d/99_balloons.cfg << EOC
+GRUB_DEFAULT=0
+GRUB_TIMEOUT=30
+GRUB_CMDLINE_LINUX_DEFAULT="debug loglevel=7"
+GRUB_CMDLINE_LINUX=""
+GRUB_TERMINAL=console
+GRUB_DISABLE_LINUX_UUID=false
+GRUB_HIDDEN_TIMEOUT=0
+GRUB_HIDDEN_TIMEOUT_QUIET=false
+EOC
+
+sudo mv /etc/default/grub.d/xen.cfg{,.bak}
+sudo tee /etc/default/grub.d/xen.cfg << EOC
+echo "Including Xen overrides from /etc/default/grub.d/xen.cfg"
+GRUB_CMDLINE_XEN="dom0_mem=7552M,max:7552M dom0_max_vcpus=4 max-console=vga"
+GRUB_DEFAULT="Ubuntu GNU/Linux, with Xen hypervisor"
+EOC
+
+sudo update-grub
+
+# Workaround https://bugs.launchpad.net/nova/+bug/1461642
+sed -r -i 's/^( *)(handle_iptable)/\1: #\2/' /etc/xen/scripts/vif-bridge
+
+# Let cloud-init do it's job:
+# This is necessary because interfaces is replaced by static ips which does not
+# correspond to the guest, but interfaced.d have the right information
+# also interface names are not eth0, and is called ens4 instead
+mv /etc/network/interfaces{,.bak.nodepool~}
+cat > /etc/network/interfaces <<EOF
+auto lo
+iface lo inet loopback
+
+source /etc/network/interfaces.d/*.cfg
+EOF
+
+# nova-agent uses xenstore, try to disable it:
+for i in 'nova-agent' 'xe-daemon' 'xe-cloud' 'rax-cloud'; do
+  cat > "/etc/init/${i}.conf.override" <<<"manual"
+done
+systemctl mask xe-daemon nova-agent rax-cloud
+
+# Create a swap file
+sudo dd if=/dev/zero of=/swapfile bs=1024 count=524288
+sudo chown root:root /swapfile
+sudo chmod 0600 /swapfile
+sudo mkswap /swapfile
+echo "/swapfile        none    swap    sw      0       0" | sudo tee -a /etc/fstab
+
+# Install osci-upload
+install_osci_upload(){
+  apt-get install -y libmysqlclient-dev libffi-dev libssl-dev
+  mkdir /home/jenkins/prepared-osci
+  (
+  cd /home/jenkins/prepared-osci
+  virtualenv osci-env
+  . osci-env/bin/activate
+  git clone https://github.com/citrix-openstack/openstack-citrix-ci openstack-citrix-ci
+  pip install -r openstack-citrix-ci/requirements.txt
+  pip install -e openstack-citrix-ci
+  mkdir -p /etc/osci/
+  cp /opt/nodepool-scripts/osci.config /etc/osci/osci.config
+  osci-upload --help
+  )
+}
+
+install_osci_upload
+
+# Have libvirt/libxl more verbose
+mkdir -p /etc/systemd/system/libvirt-bin.service.d
+cat > /etc/systemd/system/libvirt-bin.service.d/libxl-debug.conf <<EOF
+[Service]
+Environment=LIBVIRT_DEBUG=1
+EOF
+
+sync
+sleep 5