Statistics
| Branch: | Tag: | Revision:

root / docs / upgrade / upgrade-0.15.rst @ 0136e854

History | View | Annotate | Download (9.7 kB)

1
Upgrade to Synnefo v0.15
2
^^^^^^^^^^^^^^^^^^^^^^^^
3

    
4
Prerequisites
5
==============
6

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

    
10
Add unique name to the NICs of all Ganeti instances
11
---------------------------------------------------
12

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

    
20
.. code-block:: console
21

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

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

    
27

    
28
Extend public networks to all Ganeti backends
29
---------------------------------------------
30

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

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

    
39

    
40
Upgrade Steps
41
=============
42

    
43
The upgrade to v0.15 consists in the following steps:
44

    
45
1. Bring down services and backup databases.
46

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

    
49
3. Create floating IP pools
50

    
51
4. Register services and resources.
52

    
53
5. Bring up all services.
54

    
55
.. warning::
56

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

    
60
1. Bring web services down, backup databases
61
============================================
62

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

    
66
    $ service gunicorn stop
67
    $ service snf-dispatcher stop
68
    $ service snf-ganeti-eventd stop
69

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

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

    
74

    
75
2. Upgrade Synnefo and configure settings
76
=========================================
77

    
78
2.1 Install the new versions of packages
79
----------------------------------------
80

    
81
::
82

    
83
    astakos.host$ apt-get install \
84
                            python-objpool \
85
                            snf-common \
86
                            python-astakosclient \
87
                            snf-django-lib \
88
                            snf-webproject \
89
                            snf-branding \
90
                            snf-astakos-app
91

    
92
    cyclades.host$ apt-get install \
93
                            python-objpool \
94
                            snf-common \
95
                            python-astakosclient \
96
                            snf-django-lib \
97
                            snf-webproject \
98
                            snf-branding \
99
                            snf-pithos-backend \
100
                            snf-cyclades-app
101

    
102
    pithos.host$ apt-get install \
103
                            python-objpool \
104
                            snf-common \
105
                            python-astakosclient \
106
                            snf-django-lib \
107
                            snf-webproject \
108
                            snf-branding \
109
                            snf-pithos-backend \
110
                            snf-pithos-app \
111
                            snf-pithos-webclient
112

    
113
    ganeti.node$ apt-get install \
114
                            python-objpool \
115
                            snf-common \
116
                            snf-cyclades-gtools \
117
                            snf-pithos-backend
118

    
119
.. note::
120

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

    
123
.. note::
124

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

    
128
2.2 Sync and migrate the database
129
---------------------------------
130

    
131
.. note::
132

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

    
136
::
137

    
138
    astakos-host$ snf-manage syncdb
139
    astakos-host$ snf-manage migrate
140

    
141
    cyclades-host$ snf-manage syncdb
142
    cyclades-host$ snf-manage migrate
143

    
144
    pithos-host$ pithos-migrate upgrade head
145

    
146
2.3 Update configuration files
147
------------------------------
148

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

    
152
For Cyclades service we have to change the ``20-snf-cyclades-app-api.conf``
153
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
at the end of base url to get the auth url. For example if base url had the
156
value of 'https://accounts.example.synnefo.org/' then the ``ASTAKOS_AUTH_URL``
157
setting will have the value of
158
'https://accounts.example.synnefo.org/identity/v2.0'.
159

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

    
163

    
164
3. Create floating IP pools
165
===========================
166

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

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

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

    
179
.. code-block:: console
180

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

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

    
188
.. code-block:: console
189

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

    
192
or for just one network:
193

    
194
.. code-block:: console
195

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

    
198
4. Register services and resources
199
==================================
200

    
201
4.1 Re-register service and resource definitions
202
------------------------------------------------
203

    
204
You will need to register again all Synnefo components, updating the
205
service and resource definitions. On the astakos node, run::
206

    
207
    astakos-host$ snf-component-register
208

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

    
213
.. note::
214

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

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

    
226
4.2 Tweek resource settings
227
---------------------------
228

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

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

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

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

    
243
.. note::
244

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

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

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

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

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

    
262
4.3 Update the Quotaholder
263
--------------------------
264

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

    
267
    astakos-host$ service gunicorn start
268

    
269
and run on the Cyclades node::
270

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

    
273

    
274
5. Bring all services up
275
========================
276

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

    
279
.. code-block:: console
280

    
281
    astakos.host  # service gunicorn start
282
    cyclades.host # service gunicorn start
283
    pithos.host   # service gunicorn start
284

    
285
    cyclades.host # service snf-dispatcher start