6 This document details the steps needed to upgrade a cluster to newer versions
9 As a general rule the node daemons need to be restarted after each software
10 upgrade; if using the provided example init.d script, this means running the
11 following command on all nodes::
13 /etc/init.d/ganeti restart
19 Starting with Ganeti 2.0, upgrades between revisions (e.g. 2.1.0 to 2.1.1)
20 should not need manual intervention. As a safety measure, minor releases (e.g.
21 2.1.3 to 2.2.0) require the ``cfgupgrade`` command for changing the
22 configuration version. Below you find the steps necessary to upgrade between
25 To run commands on all nodes, the `distributed shell (dsh)
26 <http://www.netfort.gr.jp/~dancer/software/dsh.html.en>`_ can be used, e.g.
27 ``dsh -M -F 8 -f /var/lib/ganeti/ssconf_online_nodes gnt-cluster --version``.
29 #. Ensure no jobs are running (master node only)::
33 #. Stop all daemons on all nodes::
35 /etc/init.d/ganeti stop
37 #. Backup old configuration (master node only)::
39 tar czf /var/lib/ganeti-$(date +%FT%T).tar.gz -C /var/lib ganeti
41 #. Install new Ganeti version on all nodes
42 #. Run cfgupgrade on the master node::
44 /usr/lib/ganeti/tools/cfgupgrade --verbose --dry-run
45 /usr/lib/ganeti/tools/cfgupgrade --verbose
47 (``cfgupgrade`` supports a number of parameters, run it with
48 ``--help`` for more information)
50 #. Restart daemons on all nodes::
52 /etc/init.d/ganeti restart
54 #. Re-distribute configuration (master node only)::
56 gnt-cluster redist-conf
58 #. Restart daemons again on all nodes::
60 /etc/init.d/ganeti restart
62 #. Verify cluster (master node only)::
73 No changes needed except restarting the daemon; but rollback to 2.0.3 might
74 require configuration editing.
76 If you're using Xen-HVM instances, please double-check the network
77 configuration (``nic_type`` parameter) as the defaults might have changed:
78 2.0.4 adds any missing configuration items and depending on the version of the
79 software the cluster has been installed with, some new keys might have been
85 Between 2.0.1 and 2.0.2 there have been some changes in the handling of block
86 devices, which can cause some issues. 2.0.3 was then released which adds two
87 new options/commands to fix this issue.
89 If you use DRBD-type instances and see problems in instance start or
90 activate-disks with messages from DRBD about "lower device too small" or
91 similar, it is recoomended to:
93 #. Run ``gnt-instance activate-disks --ignore-size $instance`` for each
94 of the affected instances
95 #. Then run ``gnt-cluster repair-disk-sizes`` which will check that
96 instances have the correct disk sizes
103 - Ganeti 1.2.7 is currently installed
104 - All instances have been migrated from DRBD 0.7 to DRBD 8.x (i.e. no
105 ``remote_raid1`` disk template)
106 - Upgrade to Ganeti 2.0.0~rc2 or later (~rc1 and earlier don't have the needed
109 In the below steps, replace :file:`/var/lib` with ``$libdir`` if Ganeti was not
110 installed with this prefix (e.g. :file:`/usr/local/var`). Same for
113 Execution (all steps are required in the order given):
115 #. Make a backup of the current configuration, for safety::
117 cp -a /var/lib/ganeti /var/lib/ganeti-1.2.backup
119 #. Stop all instances::
121 gnt-instance stop --all
123 #. Make sure no DRBD device are in use, the following command should show no
126 gnt-cluster command grep cs: /proc/drbd \| grep -v cs:Unconf
128 #. Stop the node daemons and rapi daemon on all nodes (note: should be logged
129 in not via the cluster name, but the master node name, as the command below
130 will remove the cluster ip from the master node)::
132 gnt-cluster command /etc/init.d/ganeti stop
134 #. Install the new software on all nodes, either from packaging (if available)
135 or from sources; the master daemon will not start but give error messages
136 about wrong configuration file, which is normal
137 #. Upgrade the configuration file::
139 /usr/lib/ganeti/tools/cfgupgrade12 -v --dry-run
140 /usr/lib/ganeti/tools/cfgupgrade12 -v
142 #. Make sure ``ganeti-noded`` is running on all nodes (and start it if
144 #. Start the master daemon::
148 #. Check that a simple node-list works::
152 #. Redistribute updated configuration to all nodes::
154 gnt-cluster redist-conf
155 gnt-cluster copyfile /var/lib/ganeti/known_hosts
157 #. Optional: if needed, install RAPI-specific certificates under
158 :file:`/var/lib/ganeti/rapi.pem` and run::
160 gnt-cluster copyfile /var/lib/ganeti/rapi.pem
162 #. Run a cluster verify, this should show no problems::
166 #. Remove some obsolete files::
168 gnt-cluster command rm /var/lib/ganeti/ssconf_node_pass
169 gnt-cluster command rm /var/lib/ganeti/ssconf_hypervisor
171 #. Update the xen pvm (if this was a pvm cluster) setting for 1.2
174 gnt-cluster modify -H xen-pvm:root_path=/dev/sda
176 #. Depending on your setup, you might also want to reset the initrd parameter::
178 gnt-cluster modify -H xen-pvm:initrd_path=/boot/initrd-2.6-xenU
180 #. Reset the instance autobalance setting to default::
182 for i in $(gnt-instance list -o name --no-headers); do \
183 gnt-instance modify -B auto_balance=default $i; \
186 #. Optional: start the RAPI demon::
190 #. Restart instances::
192 gnt-instance start --force-multiple --all
194 At this point, ``gnt-cluster verify`` should show no errors and the migration
200 1.2.4 to any other higher 1.2 version
201 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
203 No changes needed. Rollback will usually require manual edit of the
209 No changes needed. Note that going back from 1.2.4 to 1.2.3 will require manual
210 edit of the configuration file (since we added some HVM-related new
216 No changes needed. Note that the drbd7-to-8 upgrade tool does a disk format
217 change for the DRBD metadata, so in theory this might be **risky**. It is
218 advised to have (good) backups before doing the upgrade.
228 No changes needed. Only some bugfixes and new additions that don't affect
231 1.2.0 beta 3 to 1.2.0
232 ~~~~~~~~~~~~~~~~~~~~~
236 1.2.0 beta 2 to beta 3
237 ~~~~~~~~~~~~~~~~~~~~~~
239 No changes needed. A new version of the debian-etch-instance OS (0.3) has been
240 released, but upgrading it is not required.
242 1.2.0 beta 1 to beta 2
243 ~~~~~~~~~~~~~~~~~~~~~~
245 Beta 2 switched the config file format to JSON. Steps to upgrade:
247 #. Stop the daemons (``/etc/init.d/ganeti stop``) on all nodes
248 #. Disable the cron job (default is :file:`/etc/cron.d/ganeti`)
249 #. Install the new version
250 #. Make a backup copy of the config file
251 #. Upgrade the config file using the following command::
253 /usr/share/ganeti/cfgupgrade --verbose /var/lib/ganeti/config.data
255 #. Start the daemons and run ``gnt-cluster info``, ``gnt-node list`` and
256 ``gnt-instance list`` to check if the upgrade process finished successfully
258 The OS definition also need to be upgraded. There is a new version of the
259 debian-etch-instance OS (0.2) that goes along with beta 2.