Statistics
| Branch: | Tag: | Revision:

root / UPGRADE @ f7f03738

History | View | Annotate | Download (9.6 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
#. Install new Ganeti version on all nodes
46
#. Run cfgupgrade on the master node::
47

    
48
    $ /usr/lib/ganeti/tools/cfgupgrade --verbose --dry-run
49
    $ /usr/lib/ganeti/tools/cfgupgrade --verbose
50

    
51
   (``cfgupgrade`` supports a number of parameters, run it with
52
   ``--help`` for more information)
53

    
54
#. Restart daemons on all nodes::
55

    
56
    $ /etc/init.d/ganeti restart
57

    
58
#. Re-distribute configuration (master node only)::
59

    
60
    $ gnt-cluster redist-conf
61

    
62
#. Restart daemons again on all nodes::
63

    
64
    $ /etc/init.d/ganeti restart
65

    
66
#. Enable the watcher again (master node only)::
67

    
68
    $ gnt-cluster watcher continue
69

    
70
#. Verify cluster (master node only)::
71

    
72
    $ gnt-cluster verify
73

    
74
Reverting an upgrade
75
~~~~~~~~~~~~~~~~~~~~
76

    
77
For going back between revisions (e.g. 2.1.1 to 2.1.0) no manual
78
intervention is required, as for upgrades.
79

    
80
Starting from version 2.8, ``cfgupgrade`` supports ``--downgrade``
81
option to bring the configuration back to the previous stable version.
82
This is useful if you upgrade Ganeti and after some time you run into
83
problems with the new version. You can downgrade the configuration
84
without losing the changes made since the upgrade. Any feature not
85
supported by the old version will be removed from the configuration, of
86
course, but you get a warning about it. If there is any new feature and
87
you haven't changed from its default value, you don't have to worry
88
about it, as it will get the same value whenever you'll upgrade again.
89

    
90
The procedure is similar to upgrading, but please notice that you have to
91
revert the configuration **before** installing the old version.
92

    
93
#. Ensure no jobs are running (master node only)::
94

    
95
    $ gnt-job list
96

    
97
#. Pause the watcher for an hour (master node only)::
98

    
99
    $ gnt-cluster watcher pause 1h
100

    
101
#. Stop all daemons on all nodes::
102

    
103
    $ /etc/init.d/ganeti stop
104

    
105
#. Backup old configuration (master node only)::
106

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

    
109
#. Run cfgupgrade on the master node::
110

    
111
    $ /usr/lib/ganeti/tools/cfgupgrade --verbose --downgrade --dry-run
112
    $ /usr/lib/ganeti/tools/cfgupgrade --verbose --downgrade
113

    
114
   You may want to copy all the messages about features that have been
115
   removed during the downgrade, in case you want to restore them when
116
   upgrading again.
117

    
118
#. Install the old Ganeti version on all nodes
119
#. Restart daemons on all nodes::
120

    
121
    $ /etc/init.d/ganeti restart
122

    
123
#. Re-distribute configuration (master node only)::
124

    
125
    $ gnt-cluster redist-conf
126

    
127
#. Restart daemons again on all nodes::
128

    
129
    $ /etc/init.d/ganeti restart
130

    
131
#. Enable the watcher again (master node only)::
132

    
133
    $ gnt-cluster watcher continue
134

    
135
#. Verify cluster (master node only)::
136

    
137
    $ gnt-cluster verify
138

    
139

    
140
2.0 releases
141
------------
142

    
143
2.0.3 to 2.0.4
144
~~~~~~~~~~~~~~
145

    
146
No changes needed except restarting the daemon; but rollback to 2.0.3 might
147
require configuration editing.
148

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

    
155
2.0.1 to 2.0.2/2.0.3
156
~~~~~~~~~~~~~~~~~~~~
157

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

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

    
166
#. Run ``gnt-instance activate-disks --ignore-size $instance`` for each
167
   of the affected instances
168
#. Then run ``gnt-cluster repair-disk-sizes`` which will check that
169
   instances have the correct disk sizes
170

    
171
1.2 to 2.0
172
----------
173

    
174
Prerequisites:
175

    
176
- Ganeti 1.2.7 is currently installed
177
- All instances have been migrated from DRBD 0.7 to DRBD 8.x (i.e. no
178
  ``remote_raid1`` disk template)
179
- Upgrade to Ganeti 2.0.0~rc2 or later (~rc1 and earlier don't have the needed
180
  upgrade tool)
181

    
182
In the below steps, replace :file:`/var/lib` with ``$libdir`` if Ganeti was not
183
installed with this prefix (e.g. :file:`/usr/local/var`). Same for
184
:file:`/usr/lib`.
185

    
186
Execution (all steps are required in the order given):
187

    
188
#. Make a backup of the current configuration, for safety::
189

    
190
    $ cp -a /var/lib/ganeti /var/lib/ganeti-1.2.backup
191

    
192
#. Stop all instances::
193

    
194
    $ gnt-instance stop --all
195

    
196
#. Make sure no DRBD device are in use, the following command should show no
197
   active minors::
198

    
199
    $ gnt-cluster command grep cs: /proc/drbd | grep -v cs:Unconf
200

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

    
205
    $ gnt-cluster command /etc/init.d/ganeti stop
206

    
207
#. Install the new software on all nodes, either from packaging (if available)
208
   or from sources; the master daemon will not start but give error messages
209
   about wrong configuration file, which is normal
210
#. Upgrade the configuration file::
211

    
212
    $ /usr/lib/ganeti/tools/cfgupgrade12 -v --dry-run
213
    $ /usr/lib/ganeti/tools/cfgupgrade12 -v
214

    
215
#. Make sure ``ganeti-noded`` is running on all nodes (and start it if
216
   not)
217
#. Start the master daemon::
218

    
219
    $ ganeti-masterd
220

    
221
#. Check that a simple node-list works::
222

    
223
    $ gnt-node list
224

    
225
#. Redistribute updated configuration to all nodes::
226

    
227
    $ gnt-cluster redist-conf
228
    $ gnt-cluster copyfile /var/lib/ganeti/known_hosts
229

    
230
#. Optional: if needed, install RAPI-specific certificates under
231
   :file:`/var/lib/ganeti/rapi.pem` and run::
232

    
233
    $ gnt-cluster copyfile /var/lib/ganeti/rapi.pem
234

    
235
#. Run a cluster verify, this should show no problems::
236

    
237
    $ gnt-cluster verify
238

    
239
#. Remove some obsolete files::
240

    
241
    $ gnt-cluster command rm /var/lib/ganeti/ssconf_node_pass
242
    $ gnt-cluster command rm /var/lib/ganeti/ssconf_hypervisor
243

    
244
#. Update the xen pvm (if this was a pvm cluster) setting for 1.2
245
   compatibility::
246

    
247
    $ gnt-cluster modify -H xen-pvm:root_path=/dev/sda
248

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

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

    
253
#. Reset the instance autobalance setting to default::
254

    
255
    $ for i in $(gnt-instance list -o name --no-headers); do \
256
       gnt-instance modify -B auto_balance=default $i; \
257
      done
258

    
259
#. Optional: start the RAPI demon::
260

    
261
    $ ganeti-rapi
262

    
263
#. Restart instances::
264

    
265
    $ gnt-instance start --force-multiple --all
266

    
267
At this point, ``gnt-cluster verify`` should show no errors and the migration
268
is complete.
269

    
270
1.2 releases
271
------------
272

    
273
1.2.4 to any other higher 1.2 version
274
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
275

    
276
No changes needed. Rollback will usually require manual edit of the
277
configuration file.
278

    
279
1.2.3 to 1.2.4
280
~~~~~~~~~~~~~~
281

    
282
No changes needed. Note that going back from 1.2.4 to 1.2.3 will require manual
283
edit of the configuration file (since we added some HVM-related new
284
attributes).
285

    
286
1.2.2 to 1.2.3
287
~~~~~~~~~~~~~~
288

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

    
293
1.2.1 to 1.2.2
294
~~~~~~~~~~~~~~
295

    
296
No changes needed.
297

    
298
1.2.0 to 1.2.1
299
~~~~~~~~~~~~~~
300

    
301
No changes needed. Only some bugfixes and new additions that don't affect
302
existing clusters.
303

    
304
1.2.0 beta 3 to 1.2.0
305
~~~~~~~~~~~~~~~~~~~~~
306

    
307
No changes needed.
308

    
309
1.2.0 beta 2 to beta 3
310
~~~~~~~~~~~~~~~~~~~~~~
311

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

    
315
1.2.0 beta 1 to beta 2
316
~~~~~~~~~~~~~~~~~~~~~~
317

    
318
Beta 2 switched the config file format to JSON. Steps to upgrade:
319

    
320
#. Stop the daemons (``/etc/init.d/ganeti stop``) on all nodes
321
#. Disable the cron job (default is :file:`/etc/cron.d/ganeti`)
322
#. Install the new version
323
#. Make a backup copy of the config file
324
#. Upgrade the config file using the following command::
325

    
326
    $ /usr/share/ganeti/cfgupgrade --verbose /var/lib/ganeti/config.data
327

    
328
#. Start the daemons and run ``gnt-cluster info``, ``gnt-node list`` and
329
   ``gnt-instance list`` to check if the upgrade process finished successfully
330

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

    
334
.. vim: set textwidth=72 :
335
.. Local Variables:
336
.. mode: rst
337
.. fill-column: 72
338
.. End: