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
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
--- /dev/null
+#!/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