root / UPGRADE @ 56c934da
History | View | Annotate | Download (11.7 kB)
1 |
Upgrade notes |
---|---|
2 |
============= |
3 |
|
4 |
.. highlight:: shell-example |
5 |
|
6 |
This document details the steps needed to upgrade a cluster to newer versions |
7 |
of Ganeti. |
8 |
|
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:: |
12 |
|
13 |
$ /etc/init.d/ganeti restart |
14 |
|
15 |
2.11 and above |
16 |
-------------- |
17 |
|
18 |
Starting from 2.10 onwards, Ganeti has support for parallely installed versions |
19 |
and automated upgrades. The default configuration for 2.11 and higher already is |
20 |
to install as a parallel version without changing the running version. If both |
21 |
versions, the installed one and the one to upgrade to, are 2.10 or higher, the |
22 |
actual switch of the live version can be carried out by the following command |
23 |
on the master node.:: |
24 |
|
25 |
$ gnt-cluster upgrade --to 2.11 |
26 |
|
27 |
This will carry out the steps described below in the section on upgrades from |
28 |
2.1 and above. Downgrades to the previous minor version can be done in the same |
29 |
way, specifiying the smaller version on the ``--to`` argument. |
30 |
|
31 |
|
32 |
2.11 |
33 |
---- |
34 |
|
35 |
When upgrading to 2.11, first apply the instructions of ``2.11 and |
36 |
above``. 2.11 comes with the new feature of enhanced RPC security |
37 |
through client certificates. This features needs to be enabled after the |
38 |
upgrade by:: |
39 |
|
40 |
$ gnt-cluster renew-crypto --new-node-certificates |
41 |
|
42 |
|
43 |
2.1 and above |
44 |
------------- |
45 |
|
46 |
Starting with Ganeti 2.0, upgrades between revisions (e.g. 2.1.0 to 2.1.1) |
47 |
should not need manual intervention. As a safety measure, minor releases (e.g. |
48 |
2.1.3 to 2.2.0) require the ``cfgupgrade`` command for changing the |
49 |
configuration version. Below you find the steps necessary to upgrade between |
50 |
minor releases. |
51 |
|
52 |
To run commands on all nodes, the `distributed shell (dsh) |
53 |
<http://www.netfort.gr.jp/~dancer/software/dsh.html.en>`_ can be used, e.g. |
54 |
``dsh -M -F 8 -f /var/lib/ganeti/ssconf_online_nodes gnt-cluster --version``. |
55 |
|
56 |
#. Ensure no jobs are running (master node only):: |
57 |
|
58 |
$ gnt-job list |
59 |
|
60 |
#. Pause the watcher for an hour (master node only):: |
61 |
|
62 |
$ gnt-cluster watcher pause 1h |
63 |
|
64 |
#. Stop all daemons on all nodes:: |
65 |
|
66 |
$ /etc/init.d/ganeti stop |
67 |
|
68 |
#. Backup old configuration (master node only):: |
69 |
|
70 |
$ tar czf /var/lib/ganeti-$(date +\%FT\%T).tar.gz -C /var/lib ganeti |
71 |
|
72 |
#. Install new Ganeti version on all nodes |
73 |
#. Run cfgupgrade on the master node:: |
74 |
|
75 |
$ /usr/lib/ganeti/tools/cfgupgrade --verbose --dry-run |
76 |
$ /usr/lib/ganeti/tools/cfgupgrade --verbose |
77 |
|
78 |
(``cfgupgrade`` supports a number of parameters, run it with |
79 |
``--help`` for more information) |
80 |
|
81 |
#. Upgrade the directory permissions on all nodes:: |
82 |
|
83 |
$ /usr/lib/ganeti/ensure-dirs --full-run |
84 |
|
85 |
#. Create the (missing) required users and make users part of the required |
86 |
groups on all nodes:: |
87 |
|
88 |
$ /usr/lib/ganeti/tools/users-setup |
89 |
|
90 |
This will ask for confirmation. To execute directly, add the ``--yes-do-it`` |
91 |
option. |
92 |
|
93 |
#. Restart daemons on all nodes:: |
94 |
|
95 |
$ /etc/init.d/ganeti restart |
96 |
|
97 |
#. Re-distribute configuration (master node only):: |
98 |
|
99 |
$ gnt-cluster redist-conf |
100 |
|
101 |
#. If you use file storage, check that the ``/etc/ganeti/file-storage-paths`` |
102 |
is correct on all nodes. For security reasons it's not copied |
103 |
automatically, but it can be copied manually via:: |
104 |
|
105 |
$ gnt-cluster copyfile /etc/ganeti/file-storage-paths |
106 |
|
107 |
#. Restart daemons again on all nodes:: |
108 |
|
109 |
$ /etc/init.d/ganeti restart |
110 |
|
111 |
#. Enable the watcher again (master node only):: |
112 |
|
113 |
$ gnt-cluster watcher continue |
114 |
|
115 |
#. Verify cluster (master node only):: |
116 |
|
117 |
$ gnt-cluster verify |
118 |
|
119 |
Reverting an upgrade |
120 |
~~~~~~~~~~~~~~~~~~~~ |
121 |
|
122 |
For going back between revisions (e.g. 2.1.1 to 2.1.0) no manual |
123 |
intervention is required, as for upgrades. |
124 |
|
125 |
Starting from version 2.8, ``cfgupgrade`` supports ``--downgrade`` |
126 |
option to bring the configuration back to the previous stable version. |
127 |
This is useful if you upgrade Ganeti and after some time you run into |
128 |
problems with the new version. You can downgrade the configuration |
129 |
without losing the changes made since the upgrade. Any feature not |
130 |
supported by the old version will be removed from the configuration, of |
131 |
course, but you get a warning about it. If there is any new feature and |
132 |
you haven't changed from its default value, you don't have to worry |
133 |
about it, as it will get the same value whenever you'll upgrade again. |
134 |
|
135 |
The procedure is similar to upgrading, but please notice that you have to |
136 |
revert the configuration **before** installing the old version. |
137 |
|
138 |
#. Ensure no jobs are running (master node only):: |
139 |
|
140 |
$ gnt-job list |
141 |
|
142 |
#. Pause the watcher for an hour (master node only):: |
143 |
|
144 |
$ gnt-cluster watcher pause 1h |
145 |
|
146 |
#. Stop all daemons on all nodes:: |
147 |
|
148 |
$ /etc/init.d/ganeti stop |
149 |
|
150 |
#. Backup old configuration (master node only):: |
151 |
|
152 |
$ tar czf /var/lib/ganeti-$(date +\%FT\%T).tar.gz -C /var/lib ganeti |
153 |
|
154 |
#. Run cfgupgrade on the master node:: |
155 |
|
156 |
$ /usr/lib/ganeti/tools/cfgupgrade --verbose --downgrade --dry-run |
157 |
$ /usr/lib/ganeti/tools/cfgupgrade --verbose --downgrade |
158 |
|
159 |
You may want to copy all the messages about features that have been |
160 |
removed during the downgrade, in case you want to restore them when |
161 |
upgrading again. |
162 |
|
163 |
#. Install the old Ganeti version on all nodes |
164 |
|
165 |
NB: in Ganeti 2.8, the ``cmdlib.py`` file was split into a series of files |
166 |
contained in the ``cmdlib`` directory. If Ganeti is installed from sources |
167 |
and not from a package, while downgrading Ganeti to a pre-2.8 |
168 |
version it is important to remember to remove the ``cmdlib`` directory |
169 |
from the directory containing the Ganeti python files (which usually is |
170 |
``${PREFIX}/lib/python${VERSION}/dist-packages/ganeti``). |
171 |
A simpler upgrade/downgrade procedure will be made available in future |
172 |
versions of Ganeti. |
173 |
|
174 |
#. Restart daemons on all nodes:: |
175 |
|
176 |
$ /etc/init.d/ganeti restart |
177 |
|
178 |
#. Re-distribute configuration (master node only):: |
179 |
|
180 |
$ gnt-cluster redist-conf |
181 |
|
182 |
#. Restart daemons again on all nodes:: |
183 |
|
184 |
$ /etc/init.d/ganeti restart |
185 |
|
186 |
#. Enable the watcher again (master node only):: |
187 |
|
188 |
$ gnt-cluster watcher continue |
189 |
|
190 |
#. Verify cluster (master node only):: |
191 |
|
192 |
$ gnt-cluster verify |
193 |
|
194 |
|
195 |
2.0 releases |
196 |
------------ |
197 |
|
198 |
2.0.3 to 2.0.4 |
199 |
~~~~~~~~~~~~~~ |
200 |
|
201 |
No changes needed except restarting the daemon; but rollback to 2.0.3 might |
202 |
require configuration editing. |
203 |
|
204 |
If you're using Xen-HVM instances, please double-check the network |
205 |
configuration (``nic_type`` parameter) as the defaults might have changed: |
206 |
2.0.4 adds any missing configuration items and depending on the version of the |
207 |
software the cluster has been installed with, some new keys might have been |
208 |
added. |
209 |
|
210 |
2.0.1 to 2.0.2/2.0.3 |
211 |
~~~~~~~~~~~~~~~~~~~~ |
212 |
|
213 |
Between 2.0.1 and 2.0.2 there have been some changes in the handling of block |
214 |
devices, which can cause some issues. 2.0.3 was then released which adds two |
215 |
new options/commands to fix this issue. |
216 |
|
217 |
If you use DRBD-type instances and see problems in instance start or |
218 |
activate-disks with messages from DRBD about "lower device too small" or |
219 |
similar, it is recoomended to: |
220 |
|
221 |
#. Run ``gnt-instance activate-disks --ignore-size $instance`` for each |
222 |
of the affected instances |
223 |
#. Then run ``gnt-cluster repair-disk-sizes`` which will check that |
224 |
instances have the correct disk sizes |
225 |
|
226 |
1.2 to 2.0 |
227 |
---------- |
228 |
|
229 |
Prerequisites: |
230 |
|
231 |
- Ganeti 1.2.7 is currently installed |
232 |
- All instances have been migrated from DRBD 0.7 to DRBD 8.x (i.e. no |
233 |
``remote_raid1`` disk template) |
234 |
- Upgrade to Ganeti 2.0.0~rc2 or later (~rc1 and earlier don't have the needed |
235 |
upgrade tool) |
236 |
|
237 |
In the below steps, replace :file:`/var/lib` with ``$libdir`` if Ganeti was not |
238 |
installed with this prefix (e.g. :file:`/usr/local/var`). Same for |
239 |
:file:`/usr/lib`. |
240 |
|
241 |
Execution (all steps are required in the order given): |
242 |
|
243 |
#. Make a backup of the current configuration, for safety:: |
244 |
|
245 |
$ cp -a /var/lib/ganeti /var/lib/ganeti-1.2.backup |
246 |
|
247 |
#. Stop all instances:: |
248 |
|
249 |
$ gnt-instance stop --all |
250 |
|
251 |
#. Make sure no DRBD device are in use, the following command should show no |
252 |
active minors:: |
253 |
|
254 |
$ gnt-cluster command grep cs: /proc/drbd | grep -v cs:Unconf |
255 |
|
256 |
#. Stop the node daemons and rapi daemon on all nodes (note: should be logged |
257 |
in not via the cluster name, but the master node name, as the command below |
258 |
will remove the cluster ip from the master node):: |
259 |
|
260 |
$ gnt-cluster command /etc/init.d/ganeti stop |
261 |
|
262 |
#. Install the new software on all nodes, either from packaging (if available) |
263 |
or from sources; the master daemon will not start but give error messages |
264 |
about wrong configuration file, which is normal |
265 |
#. Upgrade the configuration file:: |
266 |
|
267 |
$ /usr/lib/ganeti/tools/cfgupgrade12 -v --dry-run |
268 |
$ /usr/lib/ganeti/tools/cfgupgrade12 -v |
269 |
|
270 |
#. Make sure ``ganeti-noded`` is running on all nodes (and start it if |
271 |
not) |
272 |
#. Start the master daemon:: |
273 |
|
274 |
$ ganeti-masterd |
275 |
|
276 |
#. Check that a simple node-list works:: |
277 |
|
278 |
$ gnt-node list |
279 |
|
280 |
#. Redistribute updated configuration to all nodes:: |
281 |
|
282 |
$ gnt-cluster redist-conf |
283 |
$ gnt-cluster copyfile /var/lib/ganeti/known_hosts |
284 |
|
285 |
#. Optional: if needed, install RAPI-specific certificates under |
286 |
:file:`/var/lib/ganeti/rapi.pem` and run:: |
287 |
|
288 |
$ gnt-cluster copyfile /var/lib/ganeti/rapi.pem |
289 |
|
290 |
#. Run a cluster verify, this should show no problems:: |
291 |
|
292 |
$ gnt-cluster verify |
293 |
|
294 |
#. Remove some obsolete files:: |
295 |
|
296 |
$ gnt-cluster command rm /var/lib/ganeti/ssconf_node_pass |
297 |
$ gnt-cluster command rm /var/lib/ganeti/ssconf_hypervisor |
298 |
|
299 |
#. Update the xen pvm (if this was a pvm cluster) setting for 1.2 |
300 |
compatibility:: |
301 |
|
302 |
$ gnt-cluster modify -H xen-pvm:root_path=/dev/sda |
303 |
|
304 |
#. Depending on your setup, you might also want to reset the initrd parameter:: |
305 |
|
306 |
$ gnt-cluster modify -H xen-pvm:initrd_path=/boot/initrd-2.6-xenU |
307 |
|
308 |
#. Reset the instance autobalance setting to default:: |
309 |
|
310 |
$ for i in $(gnt-instance list -o name --no-headers); do \ |
311 |
gnt-instance modify -B auto_balance=default $i; \ |
312 |
done |
313 |
|
314 |
#. Optional: start the RAPI demon:: |
315 |
|
316 |
$ ganeti-rapi |
317 |
|
318 |
#. Restart instances:: |
319 |
|
320 |
$ gnt-instance start --force-multiple --all |
321 |
|
322 |
At this point, ``gnt-cluster verify`` should show no errors and the migration |
323 |
is complete. |
324 |
|
325 |
1.2 releases |
326 |
------------ |
327 |
|
328 |
1.2.4 to any other higher 1.2 version |
329 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
330 |
|
331 |
No changes needed. Rollback will usually require manual edit of the |
332 |
configuration file. |
333 |
|
334 |
1.2.3 to 1.2.4 |
335 |
~~~~~~~~~~~~~~ |
336 |
|
337 |
No changes needed. Note that going back from 1.2.4 to 1.2.3 will require manual |
338 |
edit of the configuration file (since we added some HVM-related new |
339 |
attributes). |
340 |
|
341 |
1.2.2 to 1.2.3 |
342 |
~~~~~~~~~~~~~~ |
343 |
|
344 |
No changes needed. Note that the drbd7-to-8 upgrade tool does a disk format |
345 |
change for the DRBD metadata, so in theory this might be **risky**. It is |
346 |
advised to have (good) backups before doing the upgrade. |
347 |
|
348 |
1.2.1 to 1.2.2 |
349 |
~~~~~~~~~~~~~~ |
350 |
|
351 |
No changes needed. |
352 |
|
353 |
1.2.0 to 1.2.1 |
354 |
~~~~~~~~~~~~~~ |
355 |
|
356 |
No changes needed. Only some bugfixes and new additions that don't affect |
357 |
existing clusters. |
358 |
|
359 |
1.2.0 beta 3 to 1.2.0 |
360 |
~~~~~~~~~~~~~~~~~~~~~ |
361 |
|
362 |
No changes needed. |
363 |
|
364 |
1.2.0 beta 2 to beta 3 |
365 |
~~~~~~~~~~~~~~~~~~~~~~ |
366 |
|
367 |
No changes needed. A new version of the debian-etch-instance OS (0.3) has been |
368 |
released, but upgrading it is not required. |
369 |
|
370 |
1.2.0 beta 1 to beta 2 |
371 |
~~~~~~~~~~~~~~~~~~~~~~ |
372 |
|
373 |
Beta 2 switched the config file format to JSON. Steps to upgrade: |
374 |
|
375 |
#. Stop the daemons (``/etc/init.d/ganeti stop``) on all nodes |
376 |
#. Disable the cron job (default is :file:`/etc/cron.d/ganeti`) |
377 |
#. Install the new version |
378 |
#. Make a backup copy of the config file |
379 |
#. Upgrade the config file using the following command:: |
380 |
|
381 |
$ /usr/share/ganeti/cfgupgrade --verbose /var/lib/ganeti/config.data |
382 |
|
383 |
#. Start the daemons and run ``gnt-cluster info``, ``gnt-node list`` and |
384 |
``gnt-instance list`` to check if the upgrade process finished successfully |
385 |
|
386 |
The OS definition also need to be upgraded. There is a new version of the |
387 |
debian-etch-instance OS (0.2) that goes along with beta 2. |
388 |
|
389 |
.. vim: set textwidth=72 : |
390 |
.. Local Variables: |
391 |
.. mode: rst |
392 |
.. fill-column: 72 |
393 |
.. End: |