upgrade-0.15.rst 10.2 KB
Newer Older
1
2
3
Upgrade to Synnefo v0.15
^^^^^^^^^^^^^^^^^^^^^^^^

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Prerequisites
==============

Before upgrading to v0.15 there are two steps that must be performed, relative
with Cyclades networking service.

Add unique name to the NICs of all Ganeti instances
---------------------------------------------------

Since Ganeti 2.8, it is supported to give a name to NICs of Ganeti instances
and refer to them with their name, and not only by their index. Synnefo v0.15
assigns a unique name to each NIC and refers to them by their unique name.
Before upgrading to v0.15, Synnefo must assign names to all existing NICs.
This can easily be performed with a helper script that is shipped with Synnefo
v0.14.10:

.. code-block:: console

 cyclades.host$ /usr/lib/synnefo/tools/add_unique_name_to_nics

.. note:: If you are not upgrading from v0.14.10, you can find the migration
 script here XXX.


Extend public networks to all Ganeti backends
---------------------------------------------

Before v0.15, each public network of Cyclades existed in one of the Ganeti
backends. In order to support dynamic addition and removal of public IPv4
address across VMs, each public network must exist in all Ganeti backends.

If you are using more than one Ganeti backends, before upgrading to v0.15 you
must ensure that the network configuration to all Ganeti backends is identical
and appropriate to support all public networks of Cyclades.


Upgrade Steps
=============

43
44
45
46
47
48
The upgrade to v0.15 consists in the following steps:

1. Bring down services and backup databases.

2. Upgrade packages, migrate the databases and configure settings.

49
3. Create floating IP pools
50

51
52
53
4. Register services and resources.

5. Bring up all services.
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145

.. warning::

    It is strongly suggested that you keep separate database backups
    for each service after the completion of each step.

1. Bring web services down, backup databases
============================================

1. All web services must be brought down so that the database maintains a
   predictable and consistent state during the migration process::

    $ service gunicorn stop
    $ service snf-dispatcher stop
    $ service snf-ganeti-eventd stop

2. Backup databases for recovery to a pre-migration state.

3. Keep the database servers running during the migration process.


2. Upgrade Synnefo and configure settings
=========================================

2.1 Install the new versions of packages
----------------------------------------

::

    astakos.host$ apt-get install \
                            python-objpool \
                            snf-common \
                            python-astakosclient \
                            snf-django-lib \
                            snf-webproject \
                            snf-branding \
                            snf-astakos-app

    cyclades.host$ apt-get install \
                            python-objpool \
                            snf-common \
                            python-astakosclient \
                            snf-django-lib \
                            snf-webproject \
                            snf-branding \
                            snf-pithos-backend \
                            snf-cyclades-app

    pithos.host$ apt-get install \
                            python-objpool \
                            snf-common \
                            python-astakosclient \
                            snf-django-lib \
                            snf-webproject \
                            snf-branding \
                            snf-pithos-backend \
                            snf-pithos-app \
                            snf-pithos-webclient

    ganeti.node$ apt-get install \
                            python-objpool \
                            snf-common \
                            snf-cyclades-gtools \
                            snf-pithos-backend

.. note::

   Make sure `snf-webproject' has the same version with snf-common

.. note::

    Installing the packages will cause services to start. Make sure you bring
    them down again (at least ``gunicorn``, ``snf-dispatcher``)

2.2 Sync and migrate the database
---------------------------------

.. note::

   If you are asked about stale content types during the migration process,
   answer 'no' and let the migration finish.

::

    astakos-host$ snf-manage syncdb
    astakos-host$ snf-manage migrate

    cyclades-host$ snf-manage syncdb
    cyclades-host$ snf-manage migrate

    pithos-host$ pithos-migrate upgrade head

146
147
148
149
150
151
152
153
2.3 Update configuration files
------------------------------

The ``ASTAKOS_BASE_URL`` setting has been replaced (both in Cyclades and
Pithos services) with the ``ASTAKOS_AUTH_URL`` setting.

For Cyclades service we have to change the ``20-snf-cyclades-app-api.conf``
file, remove the ``ASTAKOS_BASE_URL`` setting and replace it with
154
``ASTAKOS_AUTH_URL``. Typically it is sufficient to add ``/identity/v2.0``
155
156
157
at the end of base url to get the auth url. For example if base url had the
value of 'https://accounts.example.synnefo.org/' then the ``ASTAKOS_AUTH_URL``
setting will have the value of
158
'https://accounts.example.synnefo.org/identity/v2.0'.
159
160
161
162

For Pithos service we have to change the ``20-snf-pithos-app-settings.conf``
file in the same way as above.

163

164
165
166
167
168
169
170
171
v0.15 has also introduced the ``CYCLADES_STATS_SECRET_KEY`` and
``STATS_SECRET_KEY`` settings. ``CYCLADES_STATS_SECRET_KEY`` in
``20-snf-cyclades-app-api.conf`` is used by Cyclades to encrypt the instance id
/ hostname  in the URLs serving the VM stats. You should set it to a random
value / string and make sure that it's the same as the ``STATS_SECRET_KEY``
setting (used to decrypt the instance hostname) in
``20-snf-stats-settings.conf`` on your Stats host.

172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
3. Create floating IP pools
===========================

Synnefo v0.15 introduces floating IPs, which are public IPv4 addresses that can
dynamically be added/removed to/from VMs and are quotable via the
'cyclades.floating_ip' resource. Connecting a VM to a public network is only
allowed if the user has firstly created a floating IP from this network.

Floating IPs are created from networks that are marked as Floating IP pools.
Creation of floating IP pools is done with the `snf-manage network-create`
command using the `--floating-ip-pool` option.

Existing networks can be converted to floating IPs using `network-modify`
command:

.. code-block:: console

  snf-manage network-modify --floating-ip-pool=True <network_ID>

Already allocated public IPv4 addresses are not automatically converted to
floating IPs. Existing VMs can keep their IPv4 addresses which will be
automatically be released when these VMs will be destroyed. In order to
convert existing public IPs to floating IPs run the following command:

.. code-block:: console

 cyclades.host$ /usr/lib/synnefo/tools/update_to_floating_ips

or for just one network:

.. code-block:: console

 cyclades.host$ /usr/lib/synnefo/tools/update_to_floating_ips --network-id=<network_ID>

4. Register services and resources
207
==================================
208

209
4.1 Re-register service and resource definitions
210
211
212
213
------------------------------------------------

You will need to register again all Synnefo components, updating the
service and resource definitions. On the astakos node, run::
214
215
216
217
218
219
220

    astakos-host$ snf-component-register

This will detect that the Synnefo components are already registered and ask
to re-register. Answer positively. You need to enter the base URL and the UI
URL for each component, just like during the initial registration.

221
222
223
224
225
226
227
228
229
230
231
232
233
.. note::

   You can run ``snf-manage component-list -o name,ui_url`` to inspect the
   current registered UI URL. In the default installation, the base URL can
   be found by stripping ``/ui`` from the UI URL.

The meaning of resources ``cyclades.cpu`` and ``cyclades.ram`` has changed:
they now denote the number of CPUs and, respectively, RAM of *active* VMs
rather than all VMs. To represent total CPUs and total RAM, as previously,
new resources ``cyclades.total_cpu`` and ``cyclades.total_ram`` are
introduced. We now also control the usage of floating IPs through resource
``cyclades.floating_ip``.

234
4.2 Tweek resource settings
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
---------------------------

New resources (``cyclades.total_cpu``, ``cyclades.total_ram``, and
``cyclades.floating_ip``) are registered with infinite default base quota.
You will probably need to restrict them, especially
``cyclades.floating_ip``. In order to change the default for all *future*
users, for instance restricting floating IPs to 2, run::

    astakos-host$ snf-manage resource-modify cyclades.floating_ip --default-quota 2

Note that this command does not affect *existing* users any more. They can
still have infinite floating IPs. You can update base quota of existing
users in bulk, possibly excluding some users, with::

    astakos-host$ snf-manage user-modify --all --base-quota cyclades.floating_ip 2 --exclude uuid1,uuid2

.. note::

   You can inspect base quota with ``snf-manage quota-list`` before applying
   any changes, for example::

     # Get users with cyclades.vm base quota that differ from the default value
     astakos-host$ snf-manage quota-list --with-custom=True --filter-by "resource=cyclades.vm"

     # Get users with cyclades.vm base quota greater than 3
     astakos-host$ snf-manage quota-list --filter-by "resource=cyclades.vm,base_quota>3"

It is now possible to control whether a resource is visible for the users
through the API or the UI. Note that the system always checks resource
quota, regardless of their visibility. By default, ``cyclades.total_cpu``,
``cyclades.total_ram`` and ``astakos.pending_app`` are not visible. You can
change this behavior with::

    astakos-host$ snf-manage resource-modify <resource> --api-visible=True (or --ui-visible=True)

270
4.3 Update the Quotaholder
271
272
273
274
275
276
277
278
279
280
--------------------------

To update quota for all new or modified Cyclades resources, bring up Astakos::

    astakos-host$ service gunicorn start

and run on the Cyclades node::

   cyclades-host$ snf-manage reconcile-resources-cyclades --fix --force

281
282

5. Bring all services up
283
284
285
286
287
288
289
290
291
292
293
========================

After the upgrade is finished, we bring up all services:

.. code-block:: console

    astakos.host  # service gunicorn start
    cyclades.host # service gunicorn start
    pithos.host   # service gunicorn start

    cyclades.host # service snf-dispatcher start