Statistics
| Branch: | Tag: | Revision:

root / UPGRADE @ 7a562e5e

History | View | Annotate | Download (10.8 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

    
16
2.1 and above
17
-------------
18

    
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
23
minor releases.
24

    
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``.
28

    
29
#. Ensure no jobs are running (master node only)::
30

    
31
    $ gnt-job list
32

    
33
#. Pause the watcher for an hour (master node only)::
34

    
35
    $ gnt-cluster watcher pause 1h
36

    
37
#. Stop all daemons on all nodes::
38

    
39
    $ /etc/init.d/ganeti stop
40

    
41
#. Backup old configuration (master node only)::
42

    
43
    $ tar czf /var/lib/ganeti-$(date +\%FT\%T).tar.gz -C /var/lib ganeti
44

    
45
    (``/var/lib/ganeti`` can also contain exported instances, so make sure to
46
    backup only files you are interested in. Use ``--exclude export`` for
47
    example)
48

    
49
#. Install new Ganeti version on all nodes
50
#. Run cfgupgrade on the master node::
51

    
52
    $ /usr/lib/ganeti/tools/cfgupgrade --verbose --dry-run
53
    $ /usr/lib/ganeti/tools/cfgupgrade --verbose
54

    
55
   (``cfgupgrade`` supports a number of parameters, run it with
56
   ``--help`` for more information)
57

    
58
#. Upgrade the directory permissions on all nodes::
59

    
60
    $ /usr/lib/ganeti/ensure-dirs --full-run
61

    
62
#. Create the (missing) required users and make users part of the required
63
   groups on all nodes::
64

    
65
    $ /usr/lib/ganeti/tools/users-setup
66

    
67
   This will ask for confirmation. To execute directly, add the ``--yes-do-it``
68
   option.
69

    
70
#. Restart daemons on all nodes::
71

    
72
    $ /etc/init.d/ganeti restart
73

    
74
#. Re-distribute configuration (master node only)::
75

    
76
    $ gnt-cluster redist-conf
77

    
78
#. If you use file storage, check that the ``/etc/ganeti/file-storage-paths``
79
   is correct on all nodes. For security reasons it's not copied
80
   automatically, but it can be copied manually via::
81

    
82
   $ gnt-cluster copyfile /etc/ganeti/file-storage-paths
83

    
84
#. Restart daemons again on all nodes::
85

    
86
    $ /etc/init.d/ganeti restart
87

    
88
#. Enable the watcher again (master node only)::
89

    
90
    $ gnt-cluster watcher continue
91

    
92
#. Verify cluster (master node only)::
93

    
94
    $ gnt-cluster verify
95

    
96
Reverting an upgrade
97
~~~~~~~~~~~~~~~~~~~~
98

    
99
For going back between revisions (e.g. 2.1.1 to 2.1.0) no manual
100
intervention is required, as for upgrades.
101

    
102
Starting from version 2.8, ``cfgupgrade`` supports ``--downgrade``
103
option to bring the configuration back to the previous stable version.
104
This is useful if you upgrade Ganeti and after some time you run into
105
problems with the new version. You can downgrade the configuration
106
without losing the changes made since the upgrade. Any feature not
107
supported by the old version will be removed from the configuration, of
108
course, but you get a warning about it. If there is any new feature and
109
you haven't changed from its default value, you don't have to worry
110
about it, as it will get the same value whenever you'll upgrade again.
111

    
112
The procedure is similar to upgrading, but please notice that you have to
113
revert the configuration **before** installing the old version.
114

    
115
#. Ensure no jobs are running (master node only)::
116

    
117
    $ gnt-job list
118

    
119
#. Pause the watcher for an hour (master node only)::
120

    
121
    $ gnt-cluster watcher pause 1h
122

    
123
#. Stop all daemons on all nodes::
124

    
125
    $ /etc/init.d/ganeti stop
126

    
127
#. Backup old configuration (master node only)::
128

    
129
    $ tar czf /var/lib/ganeti-$(date +\%FT\%T).tar.gz -C /var/lib ganeti
130

    
131
#. Run cfgupgrade on the master node::
132

    
133
    $ /usr/lib/ganeti/tools/cfgupgrade --verbose --downgrade --dry-run
134
    $ /usr/lib/ganeti/tools/cfgupgrade --verbose --downgrade
135

    
136
   You may want to copy all the messages about features that have been
137
   removed during the downgrade, in case you want to restore them when
138
   upgrading again.
139

    
140
#. Install the old Ganeti version on all nodes
141

    
142
   NB: in Ganeti 2.8, the ``cmdlib.py`` file was split into a series of files
143
   contained in the ``cmdlib`` directory. If Ganeti is installed from sources
144
   and not from a package, while downgrading Ganeti to a pre-2.8
145
   version it is important to remember to remove the ``cmdlib`` directory
146
   from the directory containing the Ganeti python files (which usually is
147
   ``${PREFIX}/lib/python${VERSION}/dist-packages/ganeti``).
148
   A simpler upgrade/downgrade procedure will be made available in future
149
   versions of Ganeti.
150

    
151
#. Restart daemons on all nodes::
152

    
153
    $ /etc/init.d/ganeti restart
154

    
155
#. Re-distribute configuration (master node only)::
156

    
157
    $ gnt-cluster redist-conf
158

    
159
#. Restart daemons again on all nodes::
160

    
161
    $ /etc/init.d/ganeti restart
162

    
163
#. Enable the watcher again (master node only)::
164

    
165
    $ gnt-cluster watcher continue
166

    
167
#. Verify cluster (master node only)::
168

    
169
    $ gnt-cluster verify
170

    
171

    
172
2.0 releases
173
------------
174

    
175
2.0.3 to 2.0.4
176
~~~~~~~~~~~~~~
177

    
178
No changes needed except restarting the daemon; but rollback to 2.0.3 might
179
require configuration editing.
180

    
181
If you're using Xen-HVM instances, please double-check the network
182
configuration (``nic_type`` parameter) as the defaults might have changed:
183
2.0.4 adds any missing configuration items and depending on the version of the
184
software the cluster has been installed with, some new keys might have been
185
added.
186

    
187
2.0.1 to 2.0.2/2.0.3
188
~~~~~~~~~~~~~~~~~~~~
189

    
190
Between 2.0.1 and 2.0.2 there have been some changes in the handling of block
191
devices, which can cause some issues. 2.0.3 was then released which adds two
192
new options/commands to fix this issue.
193

    
194
If you use DRBD-type instances and see problems in instance start or
195
activate-disks with messages from DRBD about "lower device too small" or
196
similar, it is recoomended to:
197

    
198
#. Run ``gnt-instance activate-disks --ignore-size $instance`` for each
199
   of the affected instances
200
#. Then run ``gnt-cluster repair-disk-sizes`` which will check that
201
   instances have the correct disk sizes
202

    
203
1.2 to 2.0
204
----------
205

    
206
Prerequisites:
207

    
208
- Ganeti 1.2.7 is currently installed
209
- All instances have been migrated from DRBD 0.7 to DRBD 8.x (i.e. no
210
  ``remote_raid1`` disk template)
211
- Upgrade to Ganeti 2.0.0~rc2 or later (~rc1 and earlier don't have the needed
212
  upgrade tool)
213

    
214
In the below steps, replace :file:`/var/lib` with ``$libdir`` if Ganeti was not
215
installed with this prefix (e.g. :file:`/usr/local/var`). Same for
216
:file:`/usr/lib`.
217

    
218
Execution (all steps are required in the order given):
219

    
220
#. Make a backup of the current configuration, for safety::
221

    
222
    $ cp -a /var/lib/ganeti /var/lib/ganeti-1.2.backup
223

    
224
#. Stop all instances::
225

    
226
    $ gnt-instance stop --all
227

    
228
#. Make sure no DRBD device are in use, the following command should show no
229
   active minors::
230

    
231
    $ gnt-cluster command grep cs: /proc/drbd | grep -v cs:Unconf
232

    
233
#. Stop the node daemons and rapi daemon on all nodes (note: should be logged
234
   in not via the cluster name, but the master node name, as the command below
235
   will remove the cluster ip from the master node)::
236

    
237
    $ gnt-cluster command /etc/init.d/ganeti stop
238

    
239
#. Install the new software on all nodes, either from packaging (if available)
240
   or from sources; the master daemon will not start but give error messages
241
   about wrong configuration file, which is normal
242
#. Upgrade the configuration file::
243

    
244
    $ /usr/lib/ganeti/tools/cfgupgrade12 -v --dry-run
245
    $ /usr/lib/ganeti/tools/cfgupgrade12 -v
246

    
247
#. Make sure ``ganeti-noded`` is running on all nodes (and start it if
248
   not)
249
#. Start the master daemon::
250

    
251
    $ ganeti-masterd
252

    
253
#. Check that a simple node-list works::
254

    
255
    $ gnt-node list
256

    
257
#. Redistribute updated configuration to all nodes::
258

    
259
    $ gnt-cluster redist-conf
260
    $ gnt-cluster copyfile /var/lib/ganeti/known_hosts
261

    
262
#. Optional: if needed, install RAPI-specific certificates under
263
   :file:`/var/lib/ganeti/rapi.pem` and run::
264

    
265
    $ gnt-cluster copyfile /var/lib/ganeti/rapi.pem
266

    
267
#. Run a cluster verify, this should show no problems::
268

    
269
    $ gnt-cluster verify
270

    
271
#. Remove some obsolete files::
272

    
273
    $ gnt-cluster command rm /var/lib/ganeti/ssconf_node_pass
274
    $ gnt-cluster command rm /var/lib/ganeti/ssconf_hypervisor
275

    
276
#. Update the xen pvm (if this was a pvm cluster) setting for 1.2
277
   compatibility::
278

    
279
    $ gnt-cluster modify -H xen-pvm:root_path=/dev/sda
280

    
281
#. Depending on your setup, you might also want to reset the initrd parameter::
282

    
283
    $ gnt-cluster modify -H xen-pvm:initrd_path=/boot/initrd-2.6-xenU
284

    
285
#. Reset the instance autobalance setting to default::
286

    
287
    $ for i in $(gnt-instance list -o name --no-headers); do \
288
       gnt-instance modify -B auto_balance=default $i; \
289
      done
290

    
291
#. Optional: start the RAPI demon::
292

    
293
    $ ganeti-rapi
294

    
295
#. Restart instances::
296

    
297
    $ gnt-instance start --force-multiple --all
298

    
299
At this point, ``gnt-cluster verify`` should show no errors and the migration
300
is complete.
301

    
302
1.2 releases
303
------------
304

    
305
1.2.4 to any other higher 1.2 version
306
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
307

    
308
No changes needed. Rollback will usually require manual edit of the
309
configuration file.
310

    
311
1.2.3 to 1.2.4
312
~~~~~~~~~~~~~~
313

    
314
No changes needed. Note that going back from 1.2.4 to 1.2.3 will require manual
315
edit of the configuration file (since we added some HVM-related new
316
attributes).
317

    
318
1.2.2 to 1.2.3
319
~~~~~~~~~~~~~~
320

    
321
No changes needed. Note that the drbd7-to-8 upgrade tool does a disk format
322
change for the DRBD metadata, so in theory this might be **risky**. It is
323
advised to have (good) backups before doing the upgrade.
324

    
325
1.2.1 to 1.2.2
326
~~~~~~~~~~~~~~
327

    
328
No changes needed.
329

    
330
1.2.0 to 1.2.1
331
~~~~~~~~~~~~~~
332

    
333
No changes needed. Only some bugfixes and new additions that don't affect
334
existing clusters.
335

    
336
1.2.0 beta 3 to 1.2.0
337
~~~~~~~~~~~~~~~~~~~~~
338

    
339
No changes needed.
340

    
341
1.2.0 beta 2 to beta 3
342
~~~~~~~~~~~~~~~~~~~~~~
343

    
344
No changes needed. A new version of the debian-etch-instance OS (0.3) has been
345
released, but upgrading it is not required.
346

    
347
1.2.0 beta 1 to beta 2
348
~~~~~~~~~~~~~~~~~~~~~~
349

    
350
Beta 2 switched the config file format to JSON. Steps to upgrade:
351

    
352
#. Stop the daemons (``/etc/init.d/ganeti stop``) on all nodes
353
#. Disable the cron job (default is :file:`/etc/cron.d/ganeti`)
354
#. Install the new version
355
#. Make a backup copy of the config file
356
#. Upgrade the config file using the following command::
357

    
358
    $ /usr/share/ganeti/cfgupgrade --verbose /var/lib/ganeti/config.data
359

    
360
#. Start the daemons and run ``gnt-cluster info``, ``gnt-node list`` and
361
   ``gnt-instance list`` to check if the upgrade process finished successfully
362

    
363
The OS definition also need to be upgraded. There is a new version of the
364
debian-etch-instance OS (0.2) that goes along with beta 2.
365

    
366
.. vim: set textwidth=72 :
367
.. Local Variables:
368
.. mode: rst
369
.. fill-column: 72
370
.. End: