Statistics
| Branch: | Tag: | Revision:

root / docs / upgrade / upgrade-0.14.rst @ 68358dbe

History | View | Annotate | Download (7.2 kB)

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

    
4
The upgrade to v0.14 consists in three steps:
5

    
6
1. Bring down services and backup databases.
7

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

    
10
3. Register services to astakos and perform a quota-related data migration.
11

    
12
4. Bring up all services.
13

    
14
.. warning::
15

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

    
19
1. Bring web services down, backup databases
20
============================================
21

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

    
25
    $ service gunicorn stop
26
    $ service snf-dispatcher stop
27
    $ service snf-ganeti-eventd stop
28

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

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

    
33

    
34
2. Upgrade Synnefo and configure settings
35
=========================================
36

    
37
2.1 Install the new versions of packages
38
----------------------------------------
39

    
40
::
41

    
42
    astakos.host$ apt-get install \
43
                            python-objpool \
44
                            snf-common \
45
                            python-astakosclient \
46
                            snf-django-lib \
47
                            snf-webproject \
48
                            snf-branding \
49
                            snf-astakos-app
50

    
51
    cyclades.host$ apt-get install \
52
                            python-objpool \
53
                            snf-common \
54
                            python-astakosclient \
55
                            snf-django-lib \
56
                            snf-webproject \
57
                            snf-branding \
58
                            snf-pithos-backend \
59
                            snf-cyclades-app
60

    
61
    pithos.host$ apt-get install \
62
                            python-objpool \
63
                            snf-common \
64
                            python-astakosclient \
65
                            snf-django-lib \
66
                            snf-webproject \
67
                            snf-branding \
68
                            snf-pithos-backend \
69
                            snf-pithos-app \
70
                            snf-pithos-webclient
71

    
72
    ganeti.node$ apt-get install \
73
                            python-objpool \
74
                            snf-common \
75
                            snf-cyclades-gtools \
76
                            snf-pithos-backend
77

    
78
.. note::
79

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

    
82
.. note::
83

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

    
87
2.2 Sync and migrate the database
88
---------------------------------
89

    
90
.. note::
91

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

    
95
::
96

    
97
    astakos-host$ snf-manage syncdb
98
    astakos-host$ snf-manage migrate quotaholder_app 0001 --fake
99
    astakos-host$ snf-manage migrate quotaholder_app
100
    astakos-host$ snf-manage migrate im
101

    
102
    cyclades-host$ snf-manage syncdb
103
    cyclades-host$ snf-manage migrate
104

    
105
    pithos-host$ pithos-migrate upgrade head
106

    
107
2.3 Configure Base URL settings for all services
108
------------------------------------------------
109

    
110
In order to make all services' URLs configurable and discoverable from
111
a single endpoint in Astakos through the Openstack Keystone API,
112
every service has a ``XXXXX_BASE_URL`` setting, or it's old corresponding
113
setting was renamed to this. Therefore:
114

    
115
* Rename ``ASTAKOS_URL`` setting to ``ASTAKOS_BASE_URL``
116
  everywhere in your settings, in all nodes and all config files.
117
  This must point to the top-level Astakos URL.
118

    
119
* In Cyclades settings, rename the ``APP_INSTALL_URL`` setting
120
  to ``CYCLADES_BASE_URL``. If no such setting has been configured,
121
  you must set it. It must point to the top-level Cyclades URL.
122
  Rename ``CYCLADES_ASTAKOS_SERVICE_TOKEN`` to ``CYCLADES_SERVICE_TOKEN``.
123

    
124
* In Pithos settings, introduce a ``PITHOS_BASE_URL`` setting; it must point
125
  to the top-level Pithos URL. Rename ``PITHOS_QUOTAHOLDER_POOLSIZE``, if
126
  set, to ``PITHOS_ASTAKOSCLIENT_POOLSIZE``.
127

    
128
* In all 20-<service>-cloudbar.conf files change setting
129
  ``CLOUDBAR_SERVICES_URL`` to point to ``ASTAKOS_BASE_URL/ui/get_services``,
130
  where ``ASTAKOS_BASE_URL`` as above. Similarly, set
131
  ``CLOUDBAR_MENU_URL`` to ``ASTAKOS_BASE_URL/ui/get_menu``.
132

    
133

    
134
3 Register services and migrate quota
135
=====================================
136

    
137
You need to register astakos as a component. Moreover you need to register
138
all services provided by cyclades and pithos.
139
Running the following script you will be asked to provide the base
140
installation URL for each component. You will also need to specify the UI
141
URL for astakos.
142

    
143
The former is the location where each component resides; it should equal
144
the ``<component_name>_BASE_URL`` as specified in the respective component
145
settings (see above).
146

    
147
The latter is the URL that appears in the Cloudbar and leads to the
148
component UI. If you want to follow the default setup, set
149
the UI URL to ``<base_url>/ui/`` where ``base_url`` is the component's base
150
URL as explained before. (You can later change the UI URL with
151
``snf-manage component-modify <component_name> --url new_ui_url``).
152

    
153
For example, for Astakos, if
154
``BASE_URL = https://accounts.example.synnefo.org/astakos``,
155
then ``UI_URL = https://accounts.example.synnefo.org/astakos/ui``)::
156

    
157
    astakos-host$ snf-component-register
158

    
159
(ATTENTION: make sure to go to the next step *WITHOUT* running
160
``snf-manage resource-modify``, suggested at the end of this command)
161

    
162
.. note::
163

    
164
   This command is equivalent to running the following series of commands;
165
   in each host it exports the respective service definitions, copies the
166
   exported json file to the astakos host, where it finally imports it:
167

    
168
    .. code-block:: console
169

    
170
       astakos-host$ snf-manage component-add astakos ui_url
171
       astakos-host$ snf-manage service-export-astakos > astakos.json
172
       astakos-host$ snf-manage service-import --json astakos.json
173
       cyclades-host$ snf-manage service-export-cyclades > cyclades.json
174
       # copy the file to astakos-host
175
       astakos-host$ snf-manage service-import --json cyclades.json
176
       pithos-host$ snf-manage service-export-pithos > pithos.json
177
       # copy the file to astakos-host
178
       astakos-host$ snf-manage service-import --json pithos.json
179

    
180
The limit on the pending project applications is since 0.14 handled as an
181
Astakos resource, rather than a custom setting. So, as a last step we need
182
to run::
183

    
184
    astakos-host$ astakos-migrate-0.14
185

    
186
This will prompt you to set this limit (replacing setting
187
``ASTAKOS_PENDING_APPLICATION_LIMIT``) and then automatically migrate the
188
user-specific base quota for the new resource ``astakos.pending_app`` using
189
the deprecated user setting.
190

    
191
You are now done migrating from Synnefo v0.13 to v0.14. Please test your
192
installation to make sure everything works as expected.
193

    
194

    
195
4. Bring all services up
196
========================
197

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

    
200
.. code-block:: console
201

    
202
    astakos.host  # service gunicorn start
203
    cyclades.host # service gunicorn start
204
    pithos.host   # service gunicorn start
205

    
206
    cyclades.host # service snf-dispatcher start