Statistics
| Branch: | Tag: | Revision:

root / UPGRADE @ 229da00f

History | View | Annotate | Download (11.4 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
The procedure is similar to upgrading, but please notice that you have to
125
revert the configuration **before** installing the old version.
126

    
127
#. Ensure no jobs are running (master node only)::
128

    
129
    $ gnt-job list
130

    
131
#. Pause the watcher for an hour (master node only)::
132

    
133
    $ gnt-cluster watcher pause 1h
134

    
135
#. Stop all daemons on all nodes::
136

    
137
    $ /etc/init.d/ganeti stop
138

    
139
#. Backup old configuration (master node only)::
140

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

    
143
#. Run cfgupgrade on the master node::
144

    
145
    $ /usr/lib/ganeti/tools/cfgupgrade --verbose --downgrade --dry-run
146
    $ /usr/lib/ganeti/tools/cfgupgrade --verbose --downgrade
147

    
148
   You may want to copy all the messages about features that have been
149
   removed during the downgrade, in case you want to restore them when
150
   upgrading again.
151

    
152
#. Install the old Ganeti version on all nodes
153

    
154
   NB: in Ganeti 2.8, the ``cmdlib.py`` file was split into a series of files
155
   contained in the ``cmdlib`` directory. If Ganeti is installed from sources
156
   and not from a package, while downgrading Ganeti to a pre-2.8
157
   version it is important to remember to remove the ``cmdlib`` directory
158
   from the directory containing the Ganeti python files (which usually is
159
   ``${PREFIX}/lib/python${VERSION}/dist-packages/ganeti``).
160
   A simpler upgrade/downgrade procedure will be made available in future
161
   versions of Ganeti.
162

    
163
#. Restart daemons on all nodes::
164

    
165
    $ /etc/init.d/ganeti restart
166

    
167
#. Re-distribute configuration (master node only)::
168

    
169
    $ gnt-cluster redist-conf
170

    
171
#. Restart daemons again on all nodes::
172

    
173
    $ /etc/init.d/ganeti restart
174

    
175
#. Enable the watcher again (master node only)::
176

    
177
    $ gnt-cluster watcher continue
178

    
179
#. Verify cluster (master node only)::
180

    
181
    $ gnt-cluster verify
182

    
183

    
184
2.0 releases
185
------------
186

    
187
2.0.3 to 2.0.4
188
~~~~~~~~~~~~~~
189

    
190
No changes needed except restarting the daemon; but rollback to 2.0.3 might
191
require configuration editing.
192

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

    
199
2.0.1 to 2.0.2/2.0.3
200
~~~~~~~~~~~~~~~~~~~~
201

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

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

    
210
#. Run ``gnt-instance activate-disks --ignore-size $instance`` for each
211
   of the affected instances
212
#. Then run ``gnt-cluster repair-disk-sizes`` which will check that
213
   instances have the correct disk sizes
214

    
215
1.2 to 2.0
216
----------
217

    
218
Prerequisites:
219

    
220
- Ganeti 1.2.7 is currently installed
221
- All instances have been migrated from DRBD 0.7 to DRBD 8.x (i.e. no
222
  ``remote_raid1`` disk template)
223
- Upgrade to Ganeti 2.0.0~rc2 or later (~rc1 and earlier don't have the needed
224
  upgrade tool)
225

    
226
In the below steps, replace :file:`/var/lib` with ``$libdir`` if Ganeti was not
227
installed with this prefix (e.g. :file:`/usr/local/var`). Same for
228
:file:`/usr/lib`.
229

    
230
Execution (all steps are required in the order given):
231

    
232
#. Make a backup of the current configuration, for safety::
233

    
234
    $ cp -a /var/lib/ganeti /var/lib/ganeti-1.2.backup
235

    
236
#. Stop all instances::
237

    
238
    $ gnt-instance stop --all
239

    
240
#. Make sure no DRBD device are in use, the following command should show no
241
   active minors::
242

    
243
    $ gnt-cluster command grep cs: /proc/drbd | grep -v cs:Unconf
244

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

    
249
    $ gnt-cluster command /etc/init.d/ganeti stop
250

    
251
#. Install the new software on all nodes, either from packaging (if available)
252
   or from sources; the master daemon will not start but give error messages
253
   about wrong configuration file, which is normal
254
#. Upgrade the configuration file::
255

    
256
    $ /usr/lib/ganeti/tools/cfgupgrade12 -v --dry-run
257
    $ /usr/lib/ganeti/tools/cfgupgrade12 -v
258

    
259
#. Make sure ``ganeti-noded`` is running on all nodes (and start it if
260
   not)
261
#. Start the master daemon::
262

    
263
    $ ganeti-masterd
264

    
265
#. Check that a simple node-list works::
266

    
267
    $ gnt-node list
268

    
269
#. Redistribute updated configuration to all nodes::
270

    
271
    $ gnt-cluster redist-conf
272
    $ gnt-cluster copyfile /var/lib/ganeti/known_hosts
273

    
274
#. Optional: if needed, install RAPI-specific certificates under
275
   :file:`/var/lib/ganeti/rapi.pem` and run::
276

    
277
    $ gnt-cluster copyfile /var/lib/ganeti/rapi.pem
278

    
279
#. Run a cluster verify, this should show no problems::
280

    
281
    $ gnt-cluster verify
282

    
283
#. Remove some obsolete files::
284

    
285
    $ gnt-cluster command rm /var/lib/ganeti/ssconf_node_pass
286
    $ gnt-cluster command rm /var/lib/ganeti/ssconf_hypervisor
287

    
288
#. Update the xen pvm (if this was a pvm cluster) setting for 1.2
289
   compatibility::
290

    
291
    $ gnt-cluster modify -H xen-pvm:root_path=/dev/sda
292

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

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

    
297
#. Reset the instance autobalance setting to default::
298

    
299
    $ for i in $(gnt-instance list -o name --no-headers); do \
300
       gnt-instance modify -B auto_balance=default $i; \
301
      done
302

    
303
#. Optional: start the RAPI demon::
304

    
305
    $ ganeti-rapi
306

    
307
#. Restart instances::
308

    
309
    $ gnt-instance start --force-multiple --all
310

    
311
At this point, ``gnt-cluster verify`` should show no errors and the migration
312
is complete.
313

    
314
1.2 releases
315
------------
316

    
317
1.2.4 to any other higher 1.2 version
318
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
319

    
320
No changes needed. Rollback will usually require manual edit of the
321
configuration file.
322

    
323
1.2.3 to 1.2.4
324
~~~~~~~~~~~~~~
325

    
326
No changes needed. Note that going back from 1.2.4 to 1.2.3 will require manual
327
edit of the configuration file (since we added some HVM-related new
328
attributes).
329

    
330
1.2.2 to 1.2.3
331
~~~~~~~~~~~~~~
332

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

    
337
1.2.1 to 1.2.2
338
~~~~~~~~~~~~~~
339

    
340
No changes needed.
341

    
342
1.2.0 to 1.2.1
343
~~~~~~~~~~~~~~
344

    
345
No changes needed. Only some bugfixes and new additions that don't affect
346
existing clusters.
347

    
348
1.2.0 beta 3 to 1.2.0
349
~~~~~~~~~~~~~~~~~~~~~
350

    
351
No changes needed.
352

    
353
1.2.0 beta 2 to beta 3
354
~~~~~~~~~~~~~~~~~~~~~~
355

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

    
359
1.2.0 beta 1 to beta 2
360
~~~~~~~~~~~~~~~~~~~~~~
361

    
362
Beta 2 switched the config file format to JSON. Steps to upgrade:
363

    
364
#. Stop the daemons (``/etc/init.d/ganeti stop``) on all nodes
365
#. Disable the cron job (default is :file:`/etc/cron.d/ganeti`)
366
#. Install the new version
367
#. Make a backup copy of the config file
368
#. Upgrade the config file using the following command::
369

    
370
    $ /usr/share/ganeti/cfgupgrade --verbose /var/lib/ganeti/config.data
371

    
372
#. Start the daemons and run ``gnt-cluster info``, ``gnt-node list`` and
373
   ``gnt-instance list`` to check if the upgrade process finished successfully
374

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

    
378
.. vim: set textwidth=72 :
379
.. Local Variables:
380
.. mode: rst
381
.. fill-column: 72
382
.. End: