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