Statistics
| Branch: | Tag: | Revision:

root / docs / upgrade / upgrade-0.15.rst @ 300e9d88

History | View | Annotate | Download (8.5 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. Register services and resources.
50

    
51
4. Bring up all services.
52

    
53
.. warning::
54

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

    
58
1. Bring web services down, backup databases
59
============================================
60

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

    
64
    $ service gunicorn stop
65
    $ service snf-dispatcher stop
66
    $ service snf-ganeti-eventd stop
67

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

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

    
72

    
73
2. Upgrade Synnefo and configure settings
74
=========================================
75

    
76
2.1 Install the new versions of packages
77
----------------------------------------
78

    
79
::
80

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

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

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

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

    
117
.. note::
118

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

    
121
.. note::
122

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

    
126
2.2 Sync and migrate the database
127
---------------------------------
128

    
129
.. note::
130

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

    
134
::
135

    
136
    astakos-host$ snf-manage syncdb
137
    astakos-host$ snf-manage migrate
138

    
139
    cyclades-host$ snf-manage syncdb
140
    cyclades-host$ snf-manage migrate
141

    
142
    pithos-host$ pithos-migrate upgrade head
143

    
144
2.3 Update configuration files
145
------------------------------
146

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

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

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

    
161
3. Register services and resources
162
==================================
163

    
164
3.1 Re-register service and resource definitions
165
------------------------------------------------
166

    
167
You will need to register again all Synnefo components, updating the
168
service and resource definitions. On the astakos node, run::
169

    
170
    astakos-host$ snf-component-register
171

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

    
176
.. note::
177

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

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

    
189
3.2 Tweek resource settings
190
---------------------------
191

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

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

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

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

    
206
.. note::
207

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

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

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

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

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

    
225
3.3 Update the Quotaholder
226
--------------------------
227

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

    
230
    astakos-host$ service gunicorn start
231

    
232
and run on the Cyclades node::
233

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

    
236
4. Bring all services up
237
========================
238

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

    
241
.. code-block:: console
242

    
243
    astakos.host  # service gunicorn start
244
    cyclades.host # service gunicorn start
245
    pithos.host   # service gunicorn start
246

    
247
    cyclades.host # service snf-dispatcher start