Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paurkedal/dfd240e3fa07e46f5fbbfeade8371999 to your computer and use it in GitHub Desktop.
Save paurkedal/dfd240e3fa07e46f5fbbfeade8371999 to your computer and use it in GitHub Desktop.
# Based on
# https://launchpad.net/ubuntu/+source/ganeti/2.16.0-1ubuntu1
FROM ubuntu:16.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y \
&& apt-get install -y debhelper build-essential fakeroot devscripts
RUN apt-get install -y m4 pandoc python-all python3-all ghc ghc-ghci cabal-install libghc-case-insensitive-dev libghc-curl-dev libghc-json-dev libghc-snap-server-dev libghc-network-dev libghc-parallel-dev libghc-utf8-string-dev libghc-deepseq-dev libghc-hslogger-dev libghc-crypto-dev libghc-text-dev libghc-hinotify-dev libghc-base64-bytestring-dev libghc-zlib-dev libghc-regex-pcre-dev libghc-attoparsec-dev libghc-vector-dev libghc-lifted-base-dev libghc-lens-dev libghc-psqueue-dev libghc-test-framework-quickcheck2-dev libghc-test-framework-hunit-dev libghc-temporary-dev libghc-old-time-dev libpcre3-dev libcurl4-openssl-dev python-simplejson python-pyparsing python-openssl python-bitarray python-pyinotify python-pycurl python-paramiko python-ipaddr python-sphinx graphviz qemu-utils socat bash-completion po-debconf
RUN apt-get install -y git iproute2 dh-autoreconf
RUN cabal update
WORKDIR /workdir
ADD https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/ganeti/2.16.0-1ubuntu1/ganeti_2.16.0.orig.tar.gz ./
RUN tar -xzf ganeti_2.16.0.orig.tar.gz
WORKDIR ganeti-2.16.0
ADD https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/ganeti/2.16.0-1ubuntu1/ganeti_2.16.0-1ubuntu1.debian.tar.xz ./
RUN tar -xJf ganeti_2.16.0-1ubuntu1.debian.tar.xz
RUN sed -i -e '/debhelper/ s/(>= 11~)//' debian/control \
&& echo 10 >debian/compat \
&& sed -i -e '/^\s*dh\s/ s/python2,python3,sphinxdoc,bash_completion$/\0,autoreconf/' debian/rules \
&& sed -i -e '/^\(001[89]-\|THH-\|cabal-\)/d' debian/patches/series
RUN debuild -b -uc -us
@paurkedal
Copy link
Author

paurkedal commented Feb 14, 2019

Test Upgrade

The following scheme for upgrading from Ganeti 2.15 on Ubuntu 16.04 to Ganeti 2.16 on Ubuntu 18.04 was tested on two aged but KVM capable workstations running two trivial VMs with had disks attached but did not access them. The procedure described here is not exactly what I did, but what I believe to work. The overall test procedure was:

  • Kickstart the nodes to start from a pristine environment.
  • Set up the Ganeti 2.15 cluster.
  • Run the upgrade procedure below and make sure the VMs and cluster survive.

Upgrading Ganeti 2.15 to 2.16

  • Install explicitly versioned 2.16 packages parallel to 2.15 packages:
    dpkg -i ganeti-2.16_2.16.0-1ubuntu1_all.deb \
            ganeti-haskell-2.16_2.16.0-1ubuntu1_amd64.deb \
            ganeti-htools-2.16_2.16.0-1ubuntu1_amd64.deb \
            ganeti_2.16.0-1ubuntu1_all.deb
    apt install -f
    
  • Make sure the cluster is in a good state:
    gnt-cluster verify
    
  • Upgrade:
    gnt-cluster upgrade --to 2.16
    
  • Fix all crypto issues:
    gnt-cluster renew-crypto \
        --new-node-certificates \
        --new-spice-certificate \
        --new-rapi-certificate \
        --new-cluster-certificate
    gnt-cluster verify
    

Upgrading Ubuntu 16.04 to 18.04

master# gnt-cluster master-failover # if needed
master# gnt-cluster verify
master# gnt-node migrate node
master# gnt-node list
master# gnt-node modify -O yes node
node# systemctl stop ganeti
node# apt remove \*ganeti\*
node# do-release-upgrade
# Host rebooted
node# apt install ganeti
node# systemctl status ganeti
master# gnt-node add --readd node OR gnt-node modify -O no node

Issues

  • Warnings from gnt-cluster verify from master upgraded to Ubuntu 18.04
    about node not upgraded to Ubuntu 16.04:
    - WARNING: node straumli1.int.nbi.dk: software version mismatch: master 2.16.0~rc2, node 2.16.0
    - WARNING: node 0e84f3ef-333d-4214-840b-c41678b4bd39: DRBD version mismatch: 8.4.5 (api:1/proto:86-101)
    - WARNING: node a91223b4-05df-45d7-bb16-3de6e6a59e8d: DRBD version mismatch: 8.4.10 (api:1/proto:86-101)
    
  • DRBD did not start on the second upgraded node. gnt-instance activate-disks vm1 failed with the following exception, but after that DRBD was running normally for both VMs. Maybe it just took time to recover.
    Traceback (most recent call last):
      File "/usr/sbin/gnt-instance", line 21, in <module>
        sys.exit(main.ain())
      File "/usr/share/ganeti/2.16/ganeti/client/gnt_instance.py", line 1748, in ain
        env_override=_ENV_OVERRIDE)
      File "/usr/share/ganeti/2.16/ganeti/cli.py", line 1253, in Genericain
        result = func(options, args)
      File "/usr/share/ganeti/2.16/ganeti/client/gnt_instance.py", line 498, in ActivateDisks
        disks_info = SubmitOrSend(op, opts)
      File "/usr/share/ganeti/2.16/ganeti/cli.py", line 1043, in SubmitOrSend
        return SubmitOpCode(op, cl=cl, feedback_fn=feedback_fn, opts=opts)
      File "/usr/share/ganeti/2.16/ganeti/cli.py", line 1008, in SubmitOpCode
        reporter=reporter)
      File "/usr/share/ganeti/2.16/ganeti/cli.py", line 987, in PollJob
        cancel_fn=cancel_fn, update_freq=update_freq)
      File "/usr/share/ganeti/2.16/ganeti/cli.py", line 749, in GenericPollJob
        (job_info, log_entries) = result
    TypeError: 'int' object is not iterable
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment