root / docs / admin-guide.rst @ b4be4eee
History | View | Annotate | Download (24.9 kB)
1 | bc055d09 | Constantinos Venetsanopoulos | .. _admin-guide: |
---|---|---|---|
2 | bc055d09 | Constantinos Venetsanopoulos | |
3 | bc055d09 | Constantinos Venetsanopoulos | Synnefo Administrator's Guide |
4 | bc055d09 | Constantinos Venetsanopoulos | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
5 | bc055d09 | Constantinos Venetsanopoulos | |
6 | bc055d09 | Constantinos Venetsanopoulos | This is the complete Synnefo Administrator's Guide. |
7 | bc055d09 | Constantinos Venetsanopoulos | |
8 | bc055d09 | Constantinos Venetsanopoulos | |
9 | bc055d09 | Constantinos Venetsanopoulos | |
10 | eab73849 | Constantinos Venetsanopoulos | General Synnefo Architecture |
11 | eab73849 | Constantinos Venetsanopoulos | ============================ |
12 | eab73849 | Constantinos Venetsanopoulos | |
13 | eab73849 | Constantinos Venetsanopoulos | The following graph shows the whole Synnefo architecture and how it interacts |
14 | eab73849 | Constantinos Venetsanopoulos | with multiple Ganeti clusters. We hope that after reading the Administrator's |
15 | eab73849 | Constantinos Venetsanopoulos | Guide you will be able to understand every component and all the interactions |
16 | eab73849 | Constantinos Venetsanopoulos | between them. It is a good idea to first go through the Quick Administrator's |
17 | eab73849 | Constantinos Venetsanopoulos | Guide before proceeding. |
18 | eab73849 | Constantinos Venetsanopoulos | |
19 | eab73849 | Constantinos Venetsanopoulos | .. image:: images/synnefo-architecture1.png |
20 | 16539dad | Kostas Papadimitriou | :width: 100% |
21 | 16539dad | Kostas Papadimitriou | :target: _images/synnefo-architecture1.png |
22 | eab73849 | Constantinos Venetsanopoulos | |
23 | eab73849 | Constantinos Venetsanopoulos | |
24 | a1c707c9 | Constantinos Venetsanopoulos | |
25 | eab73849 | Constantinos Venetsanopoulos | Identity Service (Astakos) |
26 | eab73849 | Constantinos Venetsanopoulos | ========================== |
27 | f846d8df | Constantinos Venetsanopoulos | |
28 | f846d8df | Constantinos Venetsanopoulos | |
29 | eab73849 | Constantinos Venetsanopoulos | Overview |
30 | eab73849 | Constantinos Venetsanopoulos | -------- |
31 | eab73849 | Constantinos Venetsanopoulos | |
32 | eab73849 | Constantinos Venetsanopoulos | Authentication methods |
33 | eab73849 | Constantinos Venetsanopoulos | ~~~~~~~~~~~~~~~~~~~~~~ |
34 | eab73849 | Constantinos Venetsanopoulos | |
35 | eab73849 | Constantinos Venetsanopoulos | Local Authentication |
36 | eab73849 | Constantinos Venetsanopoulos | ```````````````````` |
37 | eab73849 | Constantinos Venetsanopoulos | |
38 | eab73849 | Constantinos Venetsanopoulos | LDAP Authentication |
39 | eab73849 | Constantinos Venetsanopoulos | ``````````````````` |
40 | eab73849 | Constantinos Venetsanopoulos | |
41 | eab73849 | Constantinos Venetsanopoulos | .. _shibboleth-auth: |
42 | eab73849 | Constantinos Venetsanopoulos | |
43 | eab73849 | Constantinos Venetsanopoulos | Shibboleth Authentication |
44 | eab73849 | Constantinos Venetsanopoulos | ````````````````````````` |
45 | eab73849 | Constantinos Venetsanopoulos | |
46 | eab73849 | Constantinos Venetsanopoulos | Astakos can delegate user authentication to a Shibboleth federation. |
47 | eab73849 | Constantinos Venetsanopoulos | |
48 | eab73849 | Constantinos Venetsanopoulos | To setup shibboleth, install package:: |
49 | eab73849 | Constantinos Venetsanopoulos | |
50 | eab73849 | Constantinos Venetsanopoulos | apt-get install libapache2-mod-shib2 |
51 | eab73849 | Constantinos Venetsanopoulos | |
52 | eab73849 | Constantinos Venetsanopoulos | Change appropriately the configuration files in ``/etc/shibboleth``. |
53 | eab73849 | Constantinos Venetsanopoulos | |
54 | eab73849 | Constantinos Venetsanopoulos | Add in ``/etc/apache2/sites-available/synnefo-ssl``:: |
55 | eab73849 | Constantinos Venetsanopoulos | |
56 | eab73849 | Constantinos Venetsanopoulos | ShibConfig /etc/shibboleth/shibboleth2.xml |
57 | eab73849 | Constantinos Venetsanopoulos | Alias /shibboleth-sp /usr/share/shibboleth |
58 | eab73849 | Constantinos Venetsanopoulos | |
59 | eab73849 | Constantinos Venetsanopoulos | <Location /im/login/shibboleth> |
60 | eab73849 | Constantinos Venetsanopoulos | AuthType shibboleth |
61 | eab73849 | Constantinos Venetsanopoulos | ShibRequireSession On |
62 | eab73849 | Constantinos Venetsanopoulos | ShibUseHeaders On |
63 | eab73849 | Constantinos Venetsanopoulos | require valid-user |
64 | eab73849 | Constantinos Venetsanopoulos | </Location> |
65 | eab73849 | Constantinos Venetsanopoulos | |
66 | eab73849 | Constantinos Venetsanopoulos | and before the line containing:: |
67 | eab73849 | Constantinos Venetsanopoulos | |
68 | eab73849 | Constantinos Venetsanopoulos | ProxyPass / http://localhost:8080/ retry=0 |
69 | eab73849 | Constantinos Venetsanopoulos | |
70 | eab73849 | Constantinos Venetsanopoulos | add:: |
71 | eab73849 | Constantinos Venetsanopoulos | |
72 | eab73849 | Constantinos Venetsanopoulos | ProxyPass /Shibboleth.sso ! |
73 | f846d8df | Constantinos Venetsanopoulos | |
74 | eab73849 | Constantinos Venetsanopoulos | Then, enable the shibboleth module:: |
75 | eab73849 | Constantinos Venetsanopoulos | |
76 | eab73849 | Constantinos Venetsanopoulos | a2enmod shib2 |
77 | f846d8df | Constantinos Venetsanopoulos | |
78 | eab73849 | Constantinos Venetsanopoulos | After passing through the apache module, the following tokens should be |
79 | eab73849 | Constantinos Venetsanopoulos | available at the destination:: |
80 | eab73849 | Constantinos Venetsanopoulos | |
81 | eab73849 | Constantinos Venetsanopoulos | eppn # eduPersonPrincipalName |
82 | eab73849 | Constantinos Venetsanopoulos | Shib-InetOrgPerson-givenName |
83 | eab73849 | Constantinos Venetsanopoulos | Shib-Person-surname |
84 | eab73849 | Constantinos Venetsanopoulos | Shib-Person-commonName |
85 | eab73849 | Constantinos Venetsanopoulos | Shib-InetOrgPerson-displayName |
86 | eab73849 | Constantinos Venetsanopoulos | Shib-EP-Affiliation |
87 | eab73849 | Constantinos Venetsanopoulos | Shib-Session-ID |
88 | eab73849 | Constantinos Venetsanopoulos | |
89 | eab73849 | Constantinos Venetsanopoulos | Finally, add 'shibboleth' in ``ASTAKOS_IM_MODULES`` list. The variable resides |
90 | eab73849 | Constantinos Venetsanopoulos | inside the file ``/etc/synnefo/20-snf-astakos-app-settings.conf`` |
91 | eab73849 | Constantinos Venetsanopoulos | |
92 | eab73849 | Constantinos Venetsanopoulos | Architecture |
93 | eab73849 | Constantinos Venetsanopoulos | ------------ |
94 | eab73849 | Constantinos Venetsanopoulos | |
95 | eab73849 | Constantinos Venetsanopoulos | Prereqs |
96 | eab73849 | Constantinos Venetsanopoulos | ------- |
97 | eab73849 | Constantinos Venetsanopoulos | |
98 | eab73849 | Constantinos Venetsanopoulos | Installation |
99 | eab73849 | Constantinos Venetsanopoulos | ------------ |
100 | eab73849 | Constantinos Venetsanopoulos | |
101 | eab73849 | Constantinos Venetsanopoulos | Configuration |
102 | eab73849 | Constantinos Venetsanopoulos | ------------- |
103 | eab73849 | Constantinos Venetsanopoulos | |
104 | eab73849 | Constantinos Venetsanopoulos | Working with Astakos |
105 | eab73849 | Constantinos Venetsanopoulos | -------------------- |
106 | eab73849 | Constantinos Venetsanopoulos | |
107 | eab73849 | Constantinos Venetsanopoulos | User activation methods |
108 | eab73849 | Constantinos Venetsanopoulos | ~~~~~~~~~~~~~~~~~~~~~~~ |
109 | f846d8df | Constantinos Venetsanopoulos | |
110 | f846d8df | Constantinos Venetsanopoulos | When a new user signs up, he/she is not marked as active. You can see his/her |
111 | f846d8df | Constantinos Venetsanopoulos | state by running (on the machine that runs the Astakos app): |
112 | f846d8df | Constantinos Venetsanopoulos | |
113 | f846d8df | Constantinos Venetsanopoulos | .. code-block:: console |
114 | f846d8df | Constantinos Venetsanopoulos | |
115 | 4404e02e | Ilias Tsitsimpis | $ snf-manage user-list |
116 | f846d8df | Constantinos Venetsanopoulos | |
117 | f846d8df | Constantinos Venetsanopoulos | There are two different ways to activate a new user. Both need access to a |
118 | 4404e02e | Ilias Tsitsimpis | running :ref:`mail server <mail-server>`. |
119 | f846d8df | Constantinos Venetsanopoulos | |
120 | f846d8df | Constantinos Venetsanopoulos | Manual activation |
121 | eab73849 | Constantinos Venetsanopoulos | ````````````````` |
122 | f846d8df | Constantinos Venetsanopoulos | |
123 | f846d8df | Constantinos Venetsanopoulos | You can manually activate a new user that has already signed up, by sending |
124 | f846d8df | Constantinos Venetsanopoulos | him/her an activation email. The email will contain an approriate activation |
125 | f846d8df | Constantinos Venetsanopoulos | link, which will complete the activation process if followed. You can send the |
126 | f846d8df | Constantinos Venetsanopoulos | email by running: |
127 | f846d8df | Constantinos Venetsanopoulos | |
128 | f846d8df | Constantinos Venetsanopoulos | .. code-block:: console |
129 | f846d8df | Constantinos Venetsanopoulos | |
130 | 4404e02e | Ilias Tsitsimpis | $ snf-manage user-activation-send <user ID or email> |
131 | f846d8df | Constantinos Venetsanopoulos | |
132 | eab73849 | Constantinos Venetsanopoulos | Be sure to have already setup your mail server and defined it in your Synnefo |
133 | f846d8df | Constantinos Venetsanopoulos | settings, before running the command. |
134 | f846d8df | Constantinos Venetsanopoulos | |
135 | f846d8df | Constantinos Venetsanopoulos | Automatic activation |
136 | eab73849 | Constantinos Venetsanopoulos | ```````````````````` |
137 | eab73849 | Constantinos Venetsanopoulos | |
138 | eab73849 | Constantinos Venetsanopoulos | FIXME: Describe Regex activation method |
139 | eab73849 | Constantinos Venetsanopoulos | |
140 | eab73849 | Constantinos Venetsanopoulos | Astakos advanced operations |
141 | eab73849 | Constantinos Venetsanopoulos | --------------------------- |
142 | eab73849 | Constantinos Venetsanopoulos | |
143 | eab73849 | Constantinos Venetsanopoulos | Adding "Terms of Use" |
144 | eab73849 | Constantinos Venetsanopoulos | ~~~~~~~~~~~~~~~~~~~~~ |
145 | eab73849 | Constantinos Venetsanopoulos | |
146 | eab73849 | Constantinos Venetsanopoulos | Astakos supports versioned terms-of-use. First of all you need to create an |
147 | eab73849 | Constantinos Venetsanopoulos | html file that will contain your terms. For example, create the file |
148 | eab73849 | Constantinos Venetsanopoulos | ``/usr/share/synnefo/sample-terms.html``, which contains the following: |
149 | eab73849 | Constantinos Venetsanopoulos | |
150 | eab73849 | Constantinos Venetsanopoulos | .. code-block:: console |
151 | eab73849 | Constantinos Venetsanopoulos | |
152 | eab73849 | Constantinos Venetsanopoulos | <h1>~okeanos terms</h1> |
153 | eab73849 | Constantinos Venetsanopoulos | |
154 | eab73849 | Constantinos Venetsanopoulos | These are the example terms for ~okeanos |
155 | eab73849 | Constantinos Venetsanopoulos | |
156 | eab73849 | Constantinos Venetsanopoulos | Then, add those terms-of-use with the snf-manage command: |
157 | eab73849 | Constantinos Venetsanopoulos | |
158 | eab73849 | Constantinos Venetsanopoulos | .. code-block:: console |
159 | eab73849 | Constantinos Venetsanopoulos | |
160 | eab73849 | Constantinos Venetsanopoulos | $ snf-manage term-add /usr/share/synnefo/sample-terms.html |
161 | eab73849 | Constantinos Venetsanopoulos | |
162 | eab73849 | Constantinos Venetsanopoulos | Your terms have been successfully added and you will see the corresponding link |
163 | eab73849 | Constantinos Venetsanopoulos | appearing in the Astakos web pages' footer. |
164 | eab73849 | Constantinos Venetsanopoulos | |
165 | a23251f4 | Constantinos Venetsanopoulos | Enabling reCAPTCHA |
166 | a23251f4 | Constantinos Venetsanopoulos | ~~~~~~~~~~~~~~~~~~ |
167 | a23251f4 | Constantinos Venetsanopoulos | |
168 | a23251f4 | Constantinos Venetsanopoulos | Astakos supports the `reCAPTCHA <http://www.google.com/recaptcha>`_ feature. |
169 | a23251f4 | Constantinos Venetsanopoulos | If enabled, it protects the Astakos forms from bots. To enable the feature, go |
170 | a23251f4 | Constantinos Venetsanopoulos | to https://www.google.com/recaptcha/admin/create and create your own reCAPTCHA |
171 | a23251f4 | Constantinos Venetsanopoulos | key pair. Then edit ``/etc/synnefo/20-snf-astakos-app-settings.conf`` and set |
172 | a23251f4 | Constantinos Venetsanopoulos | the corresponding variables to reflect your newly created key pair. Finally, set |
173 | a23251f4 | Constantinos Venetsanopoulos | the ``ASTAKOS_RECAPTCHA_ENABLED`` variable to ``True``: |
174 | a23251f4 | Constantinos Venetsanopoulos | |
175 | a23251f4 | Constantinos Venetsanopoulos | .. code-block:: console |
176 | a23251f4 | Constantinos Venetsanopoulos | |
177 | a23251f4 | Constantinos Venetsanopoulos | ASTAKOS_RECAPTCHA_PUBLIC_KEY = 'example_recaptcha_public_key!@#$%^&*(' |
178 | a23251f4 | Constantinos Venetsanopoulos | ASTAKOS_RECAPTCHA_PRIVATE_KEY = 'example_recaptcha_private_key!@#$%^&*(' |
179 | a23251f4 | Constantinos Venetsanopoulos | |
180 | a23251f4 | Constantinos Venetsanopoulos | ASTAKOS_RECAPTCHA_ENABLED = True |
181 | a23251f4 | Constantinos Venetsanopoulos | |
182 | a23251f4 | Constantinos Venetsanopoulos | Restart the service on the Astakos node(s) and you are ready: |
183 | a23251f4 | Constantinos Venetsanopoulos | |
184 | a23251f4 | Constantinos Venetsanopoulos | .. code-block:: console |
185 | a23251f4 | Constantinos Venetsanopoulos | |
186 | a23251f4 | Constantinos Venetsanopoulos | # /etc/init.d/gunicorn restart |
187 | a23251f4 | Constantinos Venetsanopoulos | |
188 | a23251f4 | Constantinos Venetsanopoulos | Checkout your new Sign up page. If you see the reCAPTCHA box, you have setup |
189 | a23251f4 | Constantinos Venetsanopoulos | everything correctly. |
190 | a23251f4 | Constantinos Venetsanopoulos | |
191 | eab73849 | Constantinos Venetsanopoulos | |
192 | eab73849 | Constantinos Venetsanopoulos | |
193 | eab73849 | Constantinos Venetsanopoulos | File Storage Service (Pithos) |
194 | eab73849 | Constantinos Venetsanopoulos | ============================= |
195 | eab73849 | Constantinos Venetsanopoulos | |
196 | eab73849 | Constantinos Venetsanopoulos | Overview |
197 | eab73849 | Constantinos Venetsanopoulos | -------- |
198 | eab73849 | Constantinos Venetsanopoulos | |
199 | eab73849 | Constantinos Venetsanopoulos | Architecture |
200 | eab73849 | Constantinos Venetsanopoulos | ------------ |
201 | eab73849 | Constantinos Venetsanopoulos | |
202 | eab73849 | Constantinos Venetsanopoulos | Prereqs |
203 | eab73849 | Constantinos Venetsanopoulos | ------- |
204 | eab73849 | Constantinos Venetsanopoulos | |
205 | eab73849 | Constantinos Venetsanopoulos | Installation |
206 | eab73849 | Constantinos Venetsanopoulos | ------------ |
207 | eab73849 | Constantinos Venetsanopoulos | |
208 | eab73849 | Constantinos Venetsanopoulos | Configuration |
209 | eab73849 | Constantinos Venetsanopoulos | ------------- |
210 | eab73849 | Constantinos Venetsanopoulos | |
211 | eab73849 | Constantinos Venetsanopoulos | Working with Pithos |
212 | eab73849 | Constantinos Venetsanopoulos | ------------------- |
213 | eab73849 | Constantinos Venetsanopoulos | |
214 | eab73849 | Constantinos Venetsanopoulos | Pithos advanced operations |
215 | eab73849 | Constantinos Venetsanopoulos | -------------------------- |
216 | eab73849 | Constantinos Venetsanopoulos | |
217 | eab73849 | Constantinos Venetsanopoulos | |
218 | eab73849 | Constantinos Venetsanopoulos | |
219 | eab73849 | Constantinos Venetsanopoulos | Compute/Network/Image Service (Cyclades) |
220 | eab73849 | Constantinos Venetsanopoulos | ======================================== |
221 | eab73849 | Constantinos Venetsanopoulos | |
222 | eab73849 | Constantinos Venetsanopoulos | Compute Overview |
223 | eab73849 | Constantinos Venetsanopoulos | ---------------- |
224 | eab73849 | Constantinos Venetsanopoulos | |
225 | eab73849 | Constantinos Venetsanopoulos | Network Overview |
226 | eab73849 | Constantinos Venetsanopoulos | ---------------- |
227 | eab73849 | Constantinos Venetsanopoulos | |
228 | eab73849 | Constantinos Venetsanopoulos | Image Overview |
229 | eab73849 | Constantinos Venetsanopoulos | -------------- |
230 | eab73849 | Constantinos Venetsanopoulos | |
231 | eab73849 | Constantinos Venetsanopoulos | Architecture |
232 | eab73849 | Constantinos Venetsanopoulos | ------------ |
233 | eab73849 | Constantinos Venetsanopoulos | |
234 | b9fd8ed3 | Christos Stavrakakis | Asynchronous communication with Ganeti backends |
235 | 90c74332 | Christos Stavrakakis | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
236 | a1c707c9 | Constantinos Venetsanopoulos | Synnefo uses Google Ganeti backends for VM cluster management. In order for |
237 | a1c707c9 | Constantinos Venetsanopoulos | Cyclades to be able to handle thousands of user requests, Cyclades and Ganeti |
238 | a1c707c9 | Constantinos Venetsanopoulos | communicate asynchronously. Briefly, requests are submitted to Ganeti through |
239 | a1c707c9 | Constantinos Venetsanopoulos | Ganeti's RAPI/HTTP interface, and then asynchronous notifications about the |
240 | a1c707c9 | Constantinos Venetsanopoulos | progress of Ganeti jobs are being created and pushed upwards to Cyclades. The |
241 | a1c707c9 | Constantinos Venetsanopoulos | architecture and communication with a Ganeti backend is shown in the graph |
242 | a1c707c9 | Constantinos Venetsanopoulos | below: |
243 | 9b659162 | Christos Stavrakakis | |
244 | 9b659162 | Christos Stavrakakis | .. image:: images/cyclades-ganeti-communication.png |
245 | 9b659162 | Christos Stavrakakis | :width: 50% |
246 | 9b659162 | Christos Stavrakakis | :target: _images/cyclades-ganeti-communication.png |
247 | b9fd8ed3 | Christos Stavrakakis | |
248 | a1c707c9 | Constantinos Venetsanopoulos | The Cyclades API server is responsible for handling user requests. Read-only |
249 | b9fd8ed3 | Christos Stavrakakis | requests are directly served by looking up the Cyclades DB. If the request |
250 | b9fd8ed3 | Christos Stavrakakis | needs an action in the Ganeti backend, Cyclades submit jobs to the Ganeti |
251 | a1c707c9 | Constantinos Venetsanopoulos | master using the `Ganeti RAPI interface |
252 | a1c707c9 | Constantinos Venetsanopoulos | <http://docs.ganeti.org/ganeti/2.2/html/rapi.html>`_. |
253 | b9fd8ed3 | Christos Stavrakakis | |
254 | a1c707c9 | Constantinos Venetsanopoulos | While Ganeti executes the job, `snf-ganeti-eventd`, `snf-ganeti-hook` and |
255 | a1c707c9 | Constantinos Venetsanopoulos | `snf-progress-monitor` are monitoring the progress of the job and send |
256 | c84d78c8 | Christos Stavrakakis | corresponding messages to the RabbitMQ servers. These components are part |
257 | a1c707c9 | Constantinos Venetsanopoulos | of `snf-cyclades-gtools` and must be installed on all Ganeti nodes. Specially: |
258 | b9fd8ed3 | Christos Stavrakakis | |
259 | b9fd8ed3 | Christos Stavrakakis | * *snf-ganeti-eventd* sends messages about operations affecting the operating |
260 | a1c707c9 | Constantinos Venetsanopoulos | state of instances and networks. Works by monitoring the Ganeti job queue. |
261 | a1c707c9 | Constantinos Venetsanopoulos | * *snf-ganeti_hook* sends messages about the NICs of instances. It includes a |
262 | 90c74332 | Christos Stavrakakis | number of `Ganeti hooks <http://docs.ganeti.org/ganeti/2.2/html/hooks.html>`_ |
263 | 90c74332 | Christos Stavrakakis | for customisation of operations. |
264 | a1c707c9 | Constantinos Venetsanopoulos | * *snf-progress_monitor* sends messages about the progress of the Image deployment |
265 | a1c707c9 | Constantinos Venetsanopoulos | phase which is done by the Ganeti OS Definition `snf-image`. |
266 | b9fd8ed3 | Christos Stavrakakis | |
267 | a1c707c9 | Constantinos Venetsanopoulos | Finally, `snf-dispatcher` consumes messages from the RabbitMQ queues, processes |
268 | a1c707c9 | Constantinos Venetsanopoulos | these messages and properly updates the state of the Cyclades DB. Subsequent |
269 | a1c707c9 | Constantinos Venetsanopoulos | requests to the Cyclades API, will retrieve the updated state from the DB. |
270 | b9fd8ed3 | Christos Stavrakakis | |
271 | b9fd8ed3 | Christos Stavrakakis | |
272 | eab73849 | Constantinos Venetsanopoulos | Prereqs |
273 | eab73849 | Constantinos Venetsanopoulos | ------- |
274 | eab73849 | Constantinos Venetsanopoulos | |
275 | c84d78c8 | Christos Stavrakakis | Work in progress. Please refer to :ref:`quick administrator quide <quick-install-admin-guide>`. |
276 | c84d78c8 | Christos Stavrakakis | |
277 | eab73849 | Constantinos Venetsanopoulos | Installation |
278 | eab73849 | Constantinos Venetsanopoulos | ------------ |
279 | eab73849 | Constantinos Venetsanopoulos | |
280 | c84d78c8 | Christos Stavrakakis | Work in progress. Please refer to :ref:`quick administrator quide <quick-install-admin-guide>`. |
281 | c84d78c8 | Christos Stavrakakis | |
282 | eab73849 | Constantinos Venetsanopoulos | Configuration |
283 | eab73849 | Constantinos Venetsanopoulos | ------------- |
284 | eab73849 | Constantinos Venetsanopoulos | |
285 | c84d78c8 | Christos Stavrakakis | Work in progress. Please refer to :ref:`quick administrator quide <quick-install-admin-guide>`. |
286 | c84d78c8 | Christos Stavrakakis | |
287 | eab73849 | Constantinos Venetsanopoulos | Working with Cyclades |
288 | eab73849 | Constantinos Venetsanopoulos | --------------------- |
289 | eab73849 | Constantinos Venetsanopoulos | |
290 | 0768a1df | Christos Stavrakakis | Managing Ganeti Backends |
291 | 90c74332 | Christos Stavrakakis | ~~~~~~~~~~~~~~~~~~~~~~~~ |
292 | 0768a1df | Christos Stavrakakis | |
293 | a1c707c9 | Constantinos Venetsanopoulos | Since v0.11, Synnefo is able to manage multiple Ganeti clusters (backends) |
294 | a1c707c9 | Constantinos Venetsanopoulos | making it capable to scale linearly to tens of thousands of VMs. Backends |
295 | a1c707c9 | Constantinos Venetsanopoulos | can be dynamically added or removed via `snf-manage` commands. |
296 | 0768a1df | Christos Stavrakakis | |
297 | a1c707c9 | Constantinos Venetsanopoulos | Each newly created VM is allocated to a Ganeti backend by the Cyclades backend |
298 | a1c707c9 | Constantinos Venetsanopoulos | allocator. The VM is "pinned" to this backend, and can not change through its |
299 | a1c707c9 | Constantinos Venetsanopoulos | lifetime. The backend allocator decides in which backend to spawn the VM based |
300 | a1c707c9 | Constantinos Venetsanopoulos | on the available resources of each backend, trying to balance the load between |
301 | a1c707c9 | Constantinos Venetsanopoulos | them. |
302 | 0768a1df | Christos Stavrakakis | |
303 | 0768a1df | Christos Stavrakakis | Handling of Networks, as far as backends are concerned, is based on whether the |
304 | a1c707c9 | Constantinos Venetsanopoulos | network is public or not. Public networks are created through the `snf-manage |
305 | a1c707c9 | Constantinos Venetsanopoulos | network-create` command, and are only created on one backend. Private networks |
306 | a1c707c9 | Constantinos Venetsanopoulos | are created on all backends, in order to ensure that VMs residing on different |
307 | a1c707c9 | Constantinos Venetsanopoulos | backends can be connected to the same private network. |
308 | 0768a1df | Christos Stavrakakis | |
309 | a1c707c9 | Constantinos Venetsanopoulos | Listing existing backends |
310 | a1c707c9 | Constantinos Venetsanopoulos | ````````````````````````` |
311 | a1c707c9 | Constantinos Venetsanopoulos | To list all the Ganeti backends known to Synnefo, we run: |
312 | 90c74332 | Christos Stavrakakis | |
313 | 0768a1df | Christos Stavrakakis | .. code-block:: console |
314 | 0768a1df | Christos Stavrakakis | |
315 | 0768a1df | Christos Stavrakakis | $ snf-manage backend-list |
316 | 0768a1df | Christos Stavrakakis | |
317 | 0768a1df | Christos Stavrakakis | Adding a new Ganeti backend |
318 | 90c74332 | Christos Stavrakakis | ``````````````````````````` |
319 | 0768a1df | Christos Stavrakakis | Backends are dynamically added under the control of Synnefo with `snf-manage |
320 | 0768a1df | Christos Stavrakakis | backend-add` command. In this section it is assumed that a Ganeti cluster, |
321 | a1c707c9 | Constantinos Venetsanopoulos | named ``cluster.example.com`` is already up and running and configured to be |
322 | a1c707c9 | Constantinos Venetsanopoulos | able to host Synnefo VMs. |
323 | 0768a1df | Christos Stavrakakis | |
324 | a1c707c9 | Constantinos Venetsanopoulos | To add this Ganeti cluster, we run: |
325 | 90c74332 | Christos Stavrakakis | |
326 | 0768a1df | Christos Stavrakakis | .. code-block:: console |
327 | 0768a1df | Christos Stavrakakis | |
328 | 0768a1df | Christos Stavrakakis | $ snf-manage backend-add --clustername=cluster.example.com --user="synnefo_user" --pass="synnefo_pass" |
329 | 0768a1df | Christos Stavrakakis | |
330 | 46ccbcb9 | Christos Stavrakakis | where ``clustername`` is the Cluster hostname of the Ganeti cluster, and |
331 | 46ccbcb9 | Christos Stavrakakis | ``user`` and ``pass`` are the credentials for the `Ganeti RAPI user |
332 | 46ccbcb9 | Christos Stavrakakis | <http://docs.ganeti.org/ganeti/2.2/html/rapi.html#users-and-passwords>`_. All |
333 | 46ccbcb9 | Christos Stavrakakis | backend attributes can be also changed dynamically using the `snf-manage |
334 | 46ccbcb9 | Christos Stavrakakis | backend-modify` command. |
335 | 0768a1df | Christos Stavrakakis | |
336 | a1c707c9 | Constantinos Venetsanopoulos | ``snf-manage backend-add`` will also create all existing private networks to |
337 | a1c707c9 | Constantinos Venetsanopoulos | the new backend. You can verify that the backend is added, by running |
338 | a1c707c9 | Constantinos Venetsanopoulos | `snf-manage backend-list`. |
339 | 0768a1df | Christos Stavrakakis | |
340 | a1c707c9 | Constantinos Venetsanopoulos | Note that no VMs will be spawned to this backend, since by default it is in a |
341 | a1c707c9 | Constantinos Venetsanopoulos | ``drained`` state after addition and also it has no public network assigned to |
342 | a1c707c9 | Constantinos Venetsanopoulos | it. |
343 | a1c707c9 | Constantinos Venetsanopoulos | |
344 | a1c707c9 | Constantinos Venetsanopoulos | So, first you need to create its public network, make sure everything works as |
345 | a1c707c9 | Constantinos Venetsanopoulos | expected and finally make it active by un-setting the ``drained`` flag. You can |
346 | a1c707c9 | Constantinos Venetsanopoulos | do this by running: |
347 | a1c707c9 | Constantinos Venetsanopoulos | |
348 | a1c707c9 | Constantinos Venetsanopoulos | .. code-block:: console |
349 | a1c707c9 | Constantinos Venetsanopoulos | |
350 | 46ccbcb9 | Christos Stavrakakis | $ snf-manage backend-modify --drained=False <backend_id> |
351 | 0768a1df | Christos Stavrakakis | |
352 | 0768a1df | Christos Stavrakakis | Removing an existing Ganeti backend |
353 | 90c74332 | Christos Stavrakakis | ``````````````````````````````````` |
354 | a1c707c9 | Constantinos Venetsanopoulos | In order to remove an existing backend from Synnefo, we run: |
355 | 90c74332 | Christos Stavrakakis | |
356 | 0768a1df | Christos Stavrakakis | .. code-block:: console |
357 | 0768a1df | Christos Stavrakakis | |
358 | a1c707c9 | Constantinos Venetsanopoulos | # snf-manage backend-remove <backend_id> |
359 | 0768a1df | Christos Stavrakakis | |
360 | a1c707c9 | Constantinos Venetsanopoulos | This command will fail if there are active VMs on the backend. Also, the |
361 | a1c707c9 | Constantinos Venetsanopoulos | backend is not cleaned before removal, so all the Synnefo private networks |
362 | a1c707c9 | Constantinos Venetsanopoulos | will be left on the Ganeti nodes. You need to remove them manually. |
363 | 0768a1df | Christos Stavrakakis | |
364 | a1c707c9 | Constantinos Venetsanopoulos | Allocation of VMs in Ganeti backends |
365 | a1c707c9 | Constantinos Venetsanopoulos | ```````````````````````````````````` |
366 | a1c707c9 | Constantinos Venetsanopoulos | As already mentioned, the Cyclades backend allocator is responsible for |
367 | a1c707c9 | Constantinos Venetsanopoulos | allocating new VMs to backends. This allocator does not choose the exact Ganeti |
368 | a1c707c9 | Constantinos Venetsanopoulos | node that will host the VM but just the Ganeti backend. The exact node is |
369 | a1c707c9 | Constantinos Venetsanopoulos | chosen by the Ganeti cluster's allocator (hail). |
370 | 0768a1df | Christos Stavrakakis | |
371 | 0768a1df | Christos Stavrakakis | The decision about which backend will host a VM is based on the available |
372 | 0768a1df | Christos Stavrakakis | resources. The allocator computes a score for each backend, that shows its load |
373 | 0768a1df | Christos Stavrakakis | factor, and the one with the minimum score is chosen. The admin can exclude |
374 | a1c707c9 | Constantinos Venetsanopoulos | backends from the allocation phase by marking them as ``drained`` by running: |
375 | 90c74332 | Christos Stavrakakis | |
376 | 0768a1df | Christos Stavrakakis | .. code-block:: console |
377 | 0768a1df | Christos Stavrakakis | |
378 | 46ccbcb9 | Christos Stavrakakis | $ snf-manage backend-modify --drained=True <backend_id> |
379 | 0768a1df | Christos Stavrakakis | |
380 | 0768a1df | Christos Stavrakakis | The backend resources are periodically updated, at a period defined by |
381 | a1c707c9 | Constantinos Venetsanopoulos | the ``BACKEND_REFRESH_MIN`` setting, or by running `snf-manage backend-update-status` |
382 | 0768a1df | Christos Stavrakakis | command. It is advised to have a cron job running this command at a smaller |
383 | a1c707c9 | Constantinos Venetsanopoulos | interval than ``BACKEND_REFRESH_MIN`` in order to remove the load of refreshing |
384 | 0768a1df | Christos Stavrakakis | the backends stats from the VM creation phase. |
385 | 0768a1df | Christos Stavrakakis | |
386 | a1c707c9 | Constantinos Venetsanopoulos | Finally, the admin can decide to have a user's VMs being allocated to a |
387 | a1c707c9 | Constantinos Venetsanopoulos | specific backend, with the ``BACKEND_PER_USER`` setting. This is a mapping |
388 | a1c707c9 | Constantinos Venetsanopoulos | between users and backends. If the user is found in ``BACKEND_PER_USER``, then |
389 | 46ccbcb9 | Christos Stavrakakis | Synnefo allocates all his/hers VMs to the specific backend in the variable, |
390 | 46ccbcb9 | Christos Stavrakakis | even if is marked as drained (useful for testing). |
391 | 0768a1df | Christos Stavrakakis | |
392 | 9492387a | Christos Stavrakakis | |
393 | 9492387a | Christos Stavrakakis | Managing Virtual Machines |
394 | 9492387a | Christos Stavrakakis | ~~~~~~~~~~~~~~~~~~~~~~~~~ |
395 | 9492387a | Christos Stavrakakis | |
396 | a1c707c9 | Constantinos Venetsanopoulos | As mentioned, Cyclades uses Ganeti for management of VMs. The administrator can |
397 | a1c707c9 | Constantinos Venetsanopoulos | handle Cyclades VMs just like any other Ganeti instance, via `gnt-instance` |
398 | a1c707c9 | Constantinos Venetsanopoulos | commands. All Ganeti instances that belong to Synnefo, are separated from |
399 | a1c707c9 | Constantinos Venetsanopoulos | others, by a prefix in their names. This prefix is defined in |
400 | a1c707c9 | Constantinos Venetsanopoulos | ``BACKEND_PREFIX_ID`` setting in |
401 | a1c707c9 | Constantinos Venetsanopoulos | ``/etc/synnefo/20-snf-cyclades-app-backend.conf``. |
402 | 9492387a | Christos Stavrakakis | |
403 | a1c707c9 | Constantinos Venetsanopoulos | Apart from handling instances directly in the Ganeti level, a number of `snf-manage` |
404 | 9492387a | Christos Stavrakakis | commands are available: |
405 | 9492387a | Christos Stavrakakis | |
406 | a1c707c9 | Constantinos Venetsanopoulos | * ``snf-manage server-list``: List servers |
407 | a1c707c9 | Constantinos Venetsanopoulos | * ``snf-manage server-show``: Show information about a server in the Cyclades DB |
408 | a1c707c9 | Constantinos Venetsanopoulos | * ``snf-manage server-inspect``: Inspect the state of a server both in DB and Ganeti |
409 | a1c707c9 | Constantinos Venetsanopoulos | * ``snf-manage server-modify``: Modify the state of a server in the Cycldes DB |
410 | a1c707c9 | Constantinos Venetsanopoulos | * ``snf-manage server-create``: Create a new server |
411 | a1c707c9 | Constantinos Venetsanopoulos | * ``snf-manage server-import``: Import an existing Ganeti instance to Cyclades |
412 | 9492387a | Christos Stavrakakis | |
413 | 9492387a | Christos Stavrakakis | |
414 | 9492387a | Christos Stavrakakis | Managing Virtual Networks |
415 | 9492387a | Christos Stavrakakis | ~~~~~~~~~~~~~~~~~~~~~~~~~ |
416 | 9492387a | Christos Stavrakakis | |
417 | a1c707c9 | Constantinos Venetsanopoulos | Cyclades is able to create and manage Virtual Networks. Networking is |
418 | a1c707c9 | Constantinos Venetsanopoulos | desployment specific and must be customized based on the specific needs of the |
419 | a1c707c9 | Constantinos Venetsanopoulos | system administrator. For better understanding of networking please refer to |
420 | a1c707c9 | Constantinos Venetsanopoulos | the :ref:`Network <networks>` section. |
421 | a653c059 | Christos Stavrakakis | |
422 | a653c059 | Christos Stavrakakis | Exactly as Cyclades VMs can be handled like Ganeti instances, Cyclades Networks |
423 | a653c059 | Christos Stavrakakis | can also by handled as Ganeti networks, via `gnt-network commands`. All Ganeti |
424 | a1c707c9 | Constantinos Venetsanopoulos | networks that belong to Synnefo are named with the prefix |
425 | a653c059 | Christos Stavrakakis | `${BACKEND_PREFIX_ID}-net-`. |
426 | a653c059 | Christos Stavrakakis | |
427 | a1c707c9 | Constantinos Venetsanopoulos | There are also the following `snf-manage` commands for managing networks: |
428 | a653c059 | Christos Stavrakakis | |
429 | a1c707c9 | Constantinos Venetsanopoulos | * ``snf-manage network-list``: List networks |
430 | a1c707c9 | Constantinos Venetsanopoulos | * ``snf-manage network-show``: Show information about a network in the Cyclades DB |
431 | a1c707c9 | Constantinos Venetsanopoulos | * ``snf-manage network-inspect``: Inspect the state of the network in DB and Ganeti backends |
432 | a1c707c9 | Constantinos Venetsanopoulos | * ``snf-manage network-modify``: Modify the state of a network in the Cycldes DB |
433 | a1c707c9 | Constantinos Venetsanopoulos | * ``snf-manage network-create``: Create a new network |
434 | a1c707c9 | Constantinos Venetsanopoulos | * ``snf-manage network-remove``: Remove an existing network |
435 | a653c059 | Christos Stavrakakis | |
436 | 9c98c6fc | Christos Stavrakakis | Managing Network Resources |
437 | a1c707c9 | Constantinos Venetsanopoulos | `````````````````````````` |
438 | 9c98c6fc | Christos Stavrakakis | |
439 | a1c707c9 | Constantinos Venetsanopoulos | Proper operation of the Cyclades Network Service depends on the unique |
440 | a1c707c9 | Constantinos Venetsanopoulos | assignment of specific resources to each type of virtual network. Specifically, |
441 | a1c707c9 | Constantinos Venetsanopoulos | these resources are: |
442 | 9c98c6fc | Christos Stavrakakis | |
443 | a1c707c9 | Constantinos Venetsanopoulos | * IP addresses. Cyclades creates a Pool of IPs for each Network, and assigns a |
444 | a1c707c9 | Constantinos Venetsanopoulos | unique IP address to each VM, thus connecting it to this Network. You can see |
445 | a1c707c9 | Constantinos Venetsanopoulos | the IP pool of each network by running `snf-manage network-inspect |
446 | a1c707c9 | Constantinos Venetsanopoulos | <network_ID>`. IP pools are automatically created and managed by Cyclades, |
447 | a1c707c9 | Constantinos Venetsanopoulos | depending on the subnet of the Network. |
448 | 9492387a | Christos Stavrakakis | * Bridges corresponding to physical VLANs, which are required for networks of |
449 | a1c707c9 | Constantinos Venetsanopoulos | type `PRIVATE_PHYSICAL_VLAN`. |
450 | a1c707c9 | Constantinos Venetsanopoulos | * One Bridge corresponding to one physical VLAN which is required for networks of |
451 | a1c707c9 | Constantinos Venetsanopoulos | type `PRIVATE_MAC_PREFIX`. |
452 | 9c98c6fc | Christos Stavrakakis | |
453 | a1c707c9 | Constantinos Venetsanopoulos | Cyclades allocates those resources from pools that are created by the |
454 | a1c707c9 | Constantinos Venetsanopoulos | administrator with the `snf-manage pool-create` management command. |
455 | 9c98c6fc | Christos Stavrakakis | |
456 | a1c707c9 | Constantinos Venetsanopoulos | Pool Creation |
457 | a1c707c9 | Constantinos Venetsanopoulos | ````````````` |
458 | a1c707c9 | Constantinos Venetsanopoulos | Pools are created using the `snf-manage pool-create` command: |
459 | 90c74332 | Christos Stavrakakis | |
460 | 9c98c6fc | Christos Stavrakakis | .. code-block:: console |
461 | 9c98c6fc | Christos Stavrakakis | |
462 | 9c98c6fc | Christos Stavrakakis | # snf-manage pool-create --type=bridge --base=prv --size=20 |
463 | 9c98c6fc | Christos Stavrakakis | |
464 | 9c98c6fc | Christos Stavrakakis | will create a pool of bridges, containing bridges prv1, prv2,..prv21. |
465 | 9c98c6fc | Christos Stavrakakis | |
466 | 9c98c6fc | Christos Stavrakakis | You can verify the creation of the pool, and check its contents by running: |
467 | 90c74332 | Christos Stavrakakis | |
468 | 9c98c6fc | Christos Stavrakakis | .. code-block:: console |
469 | 9c98c6fc | Christos Stavrakakis | |
470 | 9c98c6fc | Christos Stavrakakis | # snf-manage pool-list |
471 | 9c98c6fc | Christos Stavrakakis | # snf-manage pool-show --type=bridge 1 |
472 | 9c98c6fc | Christos Stavrakakis | |
473 | a1c707c9 | Constantinos Venetsanopoulos | With the same commands you can handle a pool of MAC prefixes. For example: |
474 | 90c74332 | Christos Stavrakakis | |
475 | 9c98c6fc | Christos Stavrakakis | .. code-block:: console |
476 | 9c98c6fc | Christos Stavrakakis | |
477 | 9c98c6fc | Christos Stavrakakis | # snf-manage pool-create --type=mac-prefix --base=aa:00:0 --size=65536 |
478 | 9c98c6fc | Christos Stavrakakis | |
479 | a1c707c9 | Constantinos Venetsanopoulos | will create a pool of MAC prefixes from ``aa:00:1`` to ``b9:ff:f``. The MAC |
480 | a1c707c9 | Constantinos Venetsanopoulos | prefix pool is responsible for providing only unicast and locally administered |
481 | a1c707c9 | Constantinos Venetsanopoulos | MAC addresses, so many of these prefixes will be externally reserved, to |
482 | a1c707c9 | Constantinos Venetsanopoulos | exclude from allocation. |
483 | 0768a1df | Christos Stavrakakis | |
484 | eab73849 | Constantinos Venetsanopoulos | Cyclades advanced operations |
485 | eab73849 | Constantinos Venetsanopoulos | ---------------------------- |
486 | eab73849 | Constantinos Venetsanopoulos | |
487 | eab73849 | Constantinos Venetsanopoulos | Reconciliation mechanism |
488 | eab73849 | Constantinos Venetsanopoulos | ~~~~~~~~~~~~~~~~~~~~~~~~ |
489 | a1c707c9 | Constantinos Venetsanopoulos | |
490 | 06e23415 | Christos Stavrakakis | On certain occasions, such as a Ganeti or RabbitMQ failure, the state of |
491 | 06e23415 | Christos Stavrakakis | Cyclades database may differ from the real state of VMs and networks in the |
492 | 06e23415 | Christos Stavrakakis | Ganeti backends. The reconciliation process is designed to synchronize |
493 | 06e23415 | Christos Stavrakakis | the state of the Cyclades DB with Ganeti. There are two management commands |
494 | 06e23415 | Christos Stavrakakis | for reconciling VMs and Networks |
495 | 06e23415 | Christos Stavrakakis | |
496 | a1c707c9 | Constantinos Venetsanopoulos | Reconciling Virtual Machines |
497 | a1c707c9 | Constantinos Venetsanopoulos | ```````````````````````````` |
498 | a1c707c9 | Constantinos Venetsanopoulos | |
499 | 06e23415 | Christos Stavrakakis | Reconciliation of VMs detects the following conditions: |
500 | a1c707c9 | Constantinos Venetsanopoulos | |
501 | eab73849 | Constantinos Venetsanopoulos | * Stale DB servers without corresponding Ganeti instances |
502 | eab73849 | Constantinos Venetsanopoulos | * Orphan Ganeti instances, without corresponding DB entries |
503 | 06e23415 | Christos Stavrakakis | * Out-of-sync state for DB entries wrt to Ganeti instances |
504 | eab73849 | Constantinos Venetsanopoulos | |
505 | 06e23415 | Christos Stavrakakis | To detect all inconsistencies you can just run: |
506 | 90c74332 | Christos Stavrakakis | |
507 | eab73849 | Constantinos Venetsanopoulos | .. code-block:: console |
508 | a1c707c9 | Constantinos Venetsanopoulos | |
509 | a1c707c9 | Constantinos Venetsanopoulos | $ snf-manage reconcile-servers |
510 | eab73849 | Constantinos Venetsanopoulos | |
511 | 06e23415 | Christos Stavrakakis | Adding the `--fix-all` option, will do the actual synchronization: |
512 | 90c74332 | Christos Stavrakakis | |
513 | 06e23415 | Christos Stavrakakis | .. code-block:: console |
514 | a1c707c9 | Constantinos Venetsanopoulos | |
515 | a1c707c9 | Constantinos Venetsanopoulos | $ snf-manage reconcile --fix-all |
516 | eab73849 | Constantinos Venetsanopoulos | |
517 | eab73849 | Constantinos Venetsanopoulos | Please see ``snf-manage reconcile --help`` for all the details. |
518 | eab73849 | Constantinos Venetsanopoulos | |
519 | eab73849 | Constantinos Venetsanopoulos | |
520 | 06e23415 | Christos Stavrakakis | Reconciling Networks |
521 | 90c74332 | Christos Stavrakakis | ```````````````````` |
522 | a1c707c9 | Constantinos Venetsanopoulos | |
523 | 06e23415 | Christos Stavrakakis | Reconciliation of Networks detects the following conditions: |
524 | a1c707c9 | Constantinos Venetsanopoulos | |
525 | 06e23415 | Christos Stavrakakis | * Stale DB networks without corresponding Ganeti networks |
526 | 06e23415 | Christos Stavrakakis | * Orphan Ganeti networks, without corresponding DB entries |
527 | 06e23415 | Christos Stavrakakis | * Private networks that are not created to all Ganeti backends |
528 | 06e23415 | Christos Stavrakakis | * Unsynchronized IP pools |
529 | 06e23415 | Christos Stavrakakis | |
530 | 06e23415 | Christos Stavrakakis | To detect all inconsistencies you can just run: |
531 | 90c74332 | Christos Stavrakakis | |
532 | 06e23415 | Christos Stavrakakis | .. code-block:: console |
533 | a1c707c9 | Constantinos Venetsanopoulos | |
534 | 06e23415 | Christos Stavrakakis | $ snf-manage reconcile-networks |
535 | 06e23415 | Christos Stavrakakis | |
536 | 06e23415 | Christos Stavrakakis | Adding the `--fix-all` option, will do the actual synchronization: |
537 | 90c74332 | Christos Stavrakakis | |
538 | 06e23415 | Christos Stavrakakis | .. code-block:: console |
539 | a1c707c9 | Constantinos Venetsanopoulos | |
540 | 06e23415 | Christos Stavrakakis | $ snf-manage reconcile-networks --fix-all |
541 | 06e23415 | Christos Stavrakakis | |
542 | 06e23415 | Christos Stavrakakis | Please see ``snf-manage reconcile-networks --help`` for all the details. |
543 | eab73849 | Constantinos Venetsanopoulos | |
544 | eab73849 | Constantinos Venetsanopoulos | |
545 | a1c707c9 | Constantinos Venetsanopoulos | |
546 | eab73849 | Constantinos Venetsanopoulos | Block Storage Service (Archipelago) |
547 | eab73849 | Constantinos Venetsanopoulos | =================================== |
548 | eab73849 | Constantinos Venetsanopoulos | |
549 | eab73849 | Constantinos Venetsanopoulos | Overview |
550 | eab73849 | Constantinos Venetsanopoulos | -------- |
551 | eab73849 | Constantinos Venetsanopoulos | |
552 | eab73849 | Constantinos Venetsanopoulos | Architecture |
553 | eab73849 | Constantinos Venetsanopoulos | ------------ |
554 | eab73849 | Constantinos Venetsanopoulos | |
555 | eab73849 | Constantinos Venetsanopoulos | Prereqs |
556 | eab73849 | Constantinos Venetsanopoulos | ------- |
557 | eab73849 | Constantinos Venetsanopoulos | |
558 | eab73849 | Constantinos Venetsanopoulos | Installation |
559 | eab73849 | Constantinos Venetsanopoulos | ------------ |
560 | eab73849 | Constantinos Venetsanopoulos | |
561 | eab73849 | Constantinos Venetsanopoulos | Configuration |
562 | eab73849 | Constantinos Venetsanopoulos | ------------- |
563 | eab73849 | Constantinos Venetsanopoulos | |
564 | eab73849 | Constantinos Venetsanopoulos | Working with Archipelago |
565 | eab73849 | Constantinos Venetsanopoulos | ------------------------ |
566 | eab73849 | Constantinos Venetsanopoulos | |
567 | eab73849 | Constantinos Venetsanopoulos | Archipelago advanced operations |
568 | eab73849 | Constantinos Venetsanopoulos | ------------------------------- |
569 | eab73849 | Constantinos Venetsanopoulos | |
570 | f846d8df | Constantinos Venetsanopoulos | |
571 | a1c707c9 | Constantinos Venetsanopoulos | |
572 | bc055d09 | Constantinos Venetsanopoulos | The "kamaki" API client |
573 | eab73849 | Constantinos Venetsanopoulos | ======================= |
574 | bc055d09 | Constantinos Venetsanopoulos | |
575 | bc055d09 | Constantinos Venetsanopoulos | To upload, register or modify an image you will need the **kamaki** tool. |
576 | bc055d09 | Constantinos Venetsanopoulos | Before proceeding make sure that it is configured properly. Verify that |
577 | bc055d09 | Constantinos Venetsanopoulos | *image_url*, *storage_url*, and *token* are set as needed: |
578 | bc055d09 | Constantinos Venetsanopoulos | |
579 | bc055d09 | Constantinos Venetsanopoulos | .. code-block:: console |
580 | bc055d09 | Constantinos Venetsanopoulos | |
581 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki config list |
582 | bc055d09 | Constantinos Venetsanopoulos | |
583 | bc055d09 | Constantinos Venetsanopoulos | To chage a setting use ``kamaki config set``: |
584 | bc055d09 | Constantinos Venetsanopoulos | |
585 | bc055d09 | Constantinos Venetsanopoulos | .. code-block:: console |
586 | bc055d09 | Constantinos Venetsanopoulos | |
587 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki config set image_url https://cyclades.example.com/plankton |
588 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki config set storage_url https://pithos.example.com/v1 |
589 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki config set token ... |
590 | bc055d09 | Constantinos Venetsanopoulos | |
591 | bc055d09 | Constantinos Venetsanopoulos | Upload Image |
592 | bc055d09 | Constantinos Venetsanopoulos | ------------ |
593 | bc055d09 | Constantinos Venetsanopoulos | |
594 | bc055d09 | Constantinos Venetsanopoulos | As a shortcut, you can configure a default account and container that will be |
595 | bc055d09 | Constantinos Venetsanopoulos | used by the ``kamaki store`` commands: |
596 | bc055d09 | Constantinos Venetsanopoulos | |
597 | bc055d09 | Constantinos Venetsanopoulos | .. code-block:: console |
598 | bc055d09 | Constantinos Venetsanopoulos | |
599 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki config set storage_account images@example.com |
600 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki config set storage_container images |
601 | bc055d09 | Constantinos Venetsanopoulos | |
602 | bc055d09 | Constantinos Venetsanopoulos | If the container does not exist, you will have to create it before uploading |
603 | bc055d09 | Constantinos Venetsanopoulos | any images: |
604 | bc055d09 | Constantinos Venetsanopoulos | |
605 | bc055d09 | Constantinos Venetsanopoulos | .. code-block:: console |
606 | bc055d09 | Constantinos Venetsanopoulos | |
607 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki store create images |
608 | bc055d09 | Constantinos Venetsanopoulos | |
609 | bc055d09 | Constantinos Venetsanopoulos | You are now ready to upload an image. You can upload it with a Pithos+ client, |
610 | bc055d09 | Constantinos Venetsanopoulos | or use kamaki directly: |
611 | bc055d09 | Constantinos Venetsanopoulos | |
612 | bc055d09 | Constantinos Venetsanopoulos | .. code-block:: console |
613 | bc055d09 | Constantinos Venetsanopoulos | |
614 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki store upload ubuntu.iso |
615 | bc055d09 | Constantinos Venetsanopoulos | |
616 | bc055d09 | Constantinos Venetsanopoulos | You can use any Pithos+ client to verify that the image was uploaded correctly. |
617 | bc055d09 | Constantinos Venetsanopoulos | The full Pithos URL for the previous example will be |
618 | bc055d09 | Constantinos Venetsanopoulos | ``pithos://images@example.com/images/ubuntu.iso``. |
619 | bc055d09 | Constantinos Venetsanopoulos | |
620 | bc055d09 | Constantinos Venetsanopoulos | |
621 | bc055d09 | Constantinos Venetsanopoulos | Register Image |
622 | bc055d09 | Constantinos Venetsanopoulos | -------------- |
623 | bc055d09 | Constantinos Venetsanopoulos | |
624 | bc055d09 | Constantinos Venetsanopoulos | To register an image you will need to use the full Pithos+ URL. To register as |
625 | bc055d09 | Constantinos Venetsanopoulos | a public image the one from the previous example use: |
626 | bc055d09 | Constantinos Venetsanopoulos | |
627 | bc055d09 | Constantinos Venetsanopoulos | .. code-block:: console |
628 | bc055d09 | Constantinos Venetsanopoulos | |
629 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki glance register Ubuntu pithos://images@example.com/images/ubuntu.iso --public |
630 | bc055d09 | Constantinos Venetsanopoulos | |
631 | bc055d09 | Constantinos Venetsanopoulos | The ``--public`` flag is important, if missing the registered image will not |
632 | bc055d09 | Constantinos Venetsanopoulos | be listed by ``kamaki glance list``. |
633 | bc055d09 | Constantinos Venetsanopoulos | |
634 | bc055d09 | Constantinos Venetsanopoulos | Use ``kamaki glance register`` with no arguments to see a list of available |
635 | bc055d09 | Constantinos Venetsanopoulos | options. A more complete example would be the following: |
636 | bc055d09 | Constantinos Venetsanopoulos | |
637 | bc055d09 | Constantinos Venetsanopoulos | .. code-block:: console |
638 | bc055d09 | Constantinos Venetsanopoulos | |
639 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki glance register Ubuntu pithos://images@example.com/images/ubuntu.iso \ |
640 | bc055d09 | Constantinos Venetsanopoulos | --public --disk-format diskdump --property kernel=3.1.2 |
641 | bc055d09 | Constantinos Venetsanopoulos | |
642 | bc055d09 | Constantinos Venetsanopoulos | To verify that the image was registered successfully use: |
643 | bc055d09 | Constantinos Venetsanopoulos | |
644 | bc055d09 | Constantinos Venetsanopoulos | .. code-block:: console |
645 | bc055d09 | Constantinos Venetsanopoulos | |
646 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki glance list -l |
647 | bc055d09 | Constantinos Venetsanopoulos | |
648 | bc055d09 | Constantinos Venetsanopoulos | |
649 | eab73849 | Constantinos Venetsanopoulos | |
650 | eab73849 | Constantinos Venetsanopoulos | Miscellaneous |
651 | eab73849 | Constantinos Venetsanopoulos | ============= |
652 | eab73849 | Constantinos Venetsanopoulos | |
653 | 9b659162 | Christos Stavrakakis | .. RabbitMQ |
654 | a1c707c9 | Constantinos Venetsanopoulos | |
655 | 9b659162 | Christos Stavrakakis | RabbitMQ Broker |
656 | 9b659162 | Christos Stavrakakis | --------------- |
657 | 9b659162 | Christos Stavrakakis | |
658 | 9b659162 | Christos Stavrakakis | Queue nodes run the RabbitMQ sofware, which provides AMQP functionality. To |
659 | 9b659162 | Christos Stavrakakis | guarantee high-availability, more than one Queue nodes should be deployed, each |
660 | 9b659162 | Christos Stavrakakis | of them belonging to the same `RabbitMQ cluster |
661 | a1c707c9 | Constantinos Venetsanopoulos | <http://www.rabbitmq.com/clustering.html>`_. Synnefo uses the RabbitMQ |
662 | a1c707c9 | Constantinos Venetsanopoulos | active/active `High Available Queues <http://www.rabbitmq.com/ha.html>`_ which |
663 | a1c707c9 | Constantinos Venetsanopoulos | are mirrored between two nodes within a RabbitMQ cluster. |
664 | a1c707c9 | Constantinos Venetsanopoulos | |
665 | a1c707c9 | Constantinos Venetsanopoulos | The RabbitMQ nodes that form the cluster, are declared to Synnefo through the |
666 | a1c707c9 | Constantinos Venetsanopoulos | `AMQP_HOSTS` setting. Each time a Synnefo component needs to connect to |
667 | a1c707c9 | Constantinos Venetsanopoulos | RabbitMQ, one of these nodes is chosen in a random way. The client that Synnefo |
668 | a1c707c9 | Constantinos Venetsanopoulos | uses to connect to RabbitMQ, handles connection failures transparently and |
669 | a1c707c9 | Constantinos Venetsanopoulos | tries to reconnect to a different node. As long as one of these nodes are up |
670 | a1c707c9 | Constantinos Venetsanopoulos | and running, functionality of Synnefo should not be downgraded by the RabbitMQ |
671 | a1c707c9 | Constantinos Venetsanopoulos | node failures. |
672 | 9b659162 | Christos Stavrakakis | |
673 | 9b659162 | Christos Stavrakakis | All the queues that are being used are declared as durable, meaning that |
674 | a1c707c9 | Constantinos Venetsanopoulos | messages are persistently stored to RabbitMQ, until they get successfully |
675 | a1c707c9 | Constantinos Venetsanopoulos | processed by a client. |
676 | 9b659162 | Christos Stavrakakis | |
677 | 9b659162 | Christos Stavrakakis | Currently, RabbitMQ is used by the following components: |
678 | 9b659162 | Christos Stavrakakis | |
679 | a1c707c9 | Constantinos Venetsanopoulos | * `snf-ganeti-eventd`, `snf-ganeti-hook` and `snf-progress-monitor`: |
680 | 9b659162 | Christos Stavrakakis | These components send messages concerning the status and progress of |
681 | 9b659162 | Christos Stavrakakis | jobs in the Ganeti backend. |
682 | a1c707c9 | Constantinos Venetsanopoulos | * `snf-dispatcher`: This daemon, consumes the messages that are sent from |
683 | a1c707c9 | Constantinos Venetsanopoulos | the above components, and updates the Cyclades DB accordingly. |
684 | 9b659162 | Christos Stavrakakis | |
685 | 9b659162 | Christos Stavrakakis | Installation |
686 | 9b659162 | Christos Stavrakakis | ```````````` |
687 | a1c707c9 | Constantinos Venetsanopoulos | Please check the RabbitMQ documentation which covers extensively the |
688 | a1c707c9 | Constantinos Venetsanopoulos | `installation of RabbitMQ server <http://www.rabbitmq.com/download.html>`_ and |
689 | a1c707c9 | Constantinos Venetsanopoulos | the setup of a `RabbitMQ cluster <http://www.rabbitmq.com/clustering.html>`_. |
690 | a1c707c9 | Constantinos Venetsanopoulos | Also, check out the `web management plugin |
691 | a1c707c9 | Constantinos Venetsanopoulos | <http://www.rabbitmq.com/management.html>`_ that can be useful for managing and |
692 | a1c707c9 | Constantinos Venetsanopoulos | monitoring RabbitMQ. |
693 | 9b659162 | Christos Stavrakakis | |
694 | 9b659162 | Christos Stavrakakis | For a basic installation of RabbitMQ on two nodes (node1 and node2) you can do |
695 | a1c707c9 | Constantinos Venetsanopoulos | the following: |
696 | 9b659162 | Christos Stavrakakis | |
697 | a1c707c9 | Constantinos Venetsanopoulos | On both nodes, install rabbitmq-server and create a Synnefo user: |
698 | 9b659162 | Christos Stavrakakis | |
699 | 9b659162 | Christos Stavrakakis | .. code-block:: console |
700 | 9b659162 | Christos Stavrakakis | |
701 | 9b659162 | Christos Stavrakakis | $ apt-get install rabbitmq-server |
702 | 9b659162 | Christos Stavrakakis | $ rabbitmqctl add_user synnefo "example_pass" |
703 | 9b659162 | Christos Stavrakakis | $ rabbitmqctl set_permissions synnefo ".*" ".*" ".*" |
704 | 9b659162 | Christos Stavrakakis | |
705 | a1c707c9 | Constantinos Venetsanopoulos | Also guarantee that both nodes share the same cookie, by running: |
706 | 9b659162 | Christos Stavrakakis | |
707 | 9b659162 | Christos Stavrakakis | .. code-block:: console |
708 | 9b659162 | Christos Stavrakakis | |
709 | 9b659162 | Christos Stavrakakis | $ scp node1:/var/lib/rabbitmq/.erlang.cookie node2:/var/lib/rabbitmq/.erlang.cookie |
710 | 9b659162 | Christos Stavrakakis | |
711 | 9b659162 | Christos Stavrakakis | and restart the nodes: |
712 | 9b659162 | Christos Stavrakakis | |
713 | 9b659162 | Christos Stavrakakis | .. code-block:: console |
714 | 9b659162 | Christos Stavrakakis | |
715 | 9b659162 | Christos Stavrakakis | $ /etc/init.d/rabbitmq-server restart |
716 | 9b659162 | Christos Stavrakakis | |
717 | 9b659162 | Christos Stavrakakis | |
718 | 9b659162 | Christos Stavrakakis | To setup the RabbitMQ cluster run: |
719 | 9b659162 | Christos Stavrakakis | |
720 | 9b659162 | Christos Stavrakakis | .. code-block:: console |
721 | 9b659162 | Christos Stavrakakis | |
722 | 9b659162 | Christos Stavrakakis | root@node2: rabbitmqctl stop_app |
723 | 9b659162 | Christos Stavrakakis | root@node2: rabbitmqctl reset |
724 | 9b659162 | Christos Stavrakakis | root@node2: rabbitmqctl cluster rabbit@node1 rabbit@node2 |
725 | 9b659162 | Christos Stavrakakis | root@node2: rabbitmqctl start_app |
726 | 9b659162 | Christos Stavrakakis | |
727 | 9b659162 | Christos Stavrakakis | You can verify that the cluster is set up correctly by running: |
728 | 9b659162 | Christos Stavrakakis | |
729 | 9b659162 | Christos Stavrakakis | .. code-block:: console |
730 | 9b659162 | Christos Stavrakakis | |
731 | 9b659162 | Christos Stavrakakis | root@node2: rabbitmqctl cluster_status |
732 | 9b659162 | Christos Stavrakakis | |
733 | 9b659162 | Christos Stavrakakis | |
734 | 9b659162 | Christos Stavrakakis | |
735 | 9b659162 | Christos Stavrakakis | |
736 | 9b659162 | Christos Stavrakakis | |
737 | bc055d09 | Constantinos Venetsanopoulos | Admin tool: snf-manage |
738 | bc055d09 | Constantinos Venetsanopoulos | ---------------------- |
739 | bc055d09 | Constantinos Venetsanopoulos | |
740 | bc055d09 | Constantinos Venetsanopoulos | ``snf-manage`` is a tool used to perform various administrative tasks. It needs |
741 | bc055d09 | Constantinos Venetsanopoulos | to be able to access the django database, so the following should be able to |
742 | bc055d09 | Constantinos Venetsanopoulos | import the Django settings. |
743 | bc055d09 | Constantinos Venetsanopoulos | |
744 | bc055d09 | Constantinos Venetsanopoulos | Additionally, administrative tasks can be performed via the admin web interface |
745 | e18edd26 | Constantinos Venetsanopoulos | located in /admin. Only users of type ADMIN can access the admin pages. To |
746 | e18edd26 | Constantinos Venetsanopoulos | change the type of a user to ADMIN, snf-admin can be used: |
747 | bc055d09 | Constantinos Venetsanopoulos | |
748 | bc055d09 | Constantinos Venetsanopoulos | .. code-block:: console |
749 | bc055d09 | Constantinos Venetsanopoulos | |
750 | 7a3439cf | Constantinos Venetsanopoulos | $ snf-manage user-modify 42 --type ADMIN |
751 | bc055d09 | Constantinos Venetsanopoulos | |
752 | bc055d09 | Constantinos Venetsanopoulos | Logging |
753 | bc055d09 | Constantinos Venetsanopoulos | ------- |
754 | bc055d09 | Constantinos Venetsanopoulos | |
755 | bc055d09 | Constantinos Venetsanopoulos | Logging in Synnefo is using Python's logging module. The module is configured |
756 | bc055d09 | Constantinos Venetsanopoulos | using dictionary configuration, whose format is described here: |
757 | bc055d09 | Constantinos Venetsanopoulos | |
758 | bc055d09 | Constantinos Venetsanopoulos | http://docs.python.org/release/2.7.1/library/logging.html#logging-config-dictschema |
759 | bc055d09 | Constantinos Venetsanopoulos | |
760 | bc055d09 | Constantinos Venetsanopoulos | Note that this is a feature of Python 2.7 that we have backported for use in |
761 | bc055d09 | Constantinos Venetsanopoulos | Python 2.6. |
762 | bc055d09 | Constantinos Venetsanopoulos | |
763 | 4be65f1f | Christos Stavrakakis | The logging configuration dictionary is defined in |
764 | a1c707c9 | Constantinos Venetsanopoulos | ``/etc/synnefo/10-snf-webproject-logging.conf`` |
765 | bc055d09 | Constantinos Venetsanopoulos | |
766 | a1c707c9 | Constantinos Venetsanopoulos | The administrator can have finer logging control by modifying the |
767 | a1c707c9 | Constantinos Venetsanopoulos | ``LOGGING_SETUP`` dictionary, and defining subloggers with different handlers |
768 | a1c707c9 | Constantinos Venetsanopoulos | and log levels. e.g. To enable debug messages only for the API set the level |
769 | a1c707c9 | Constantinos Venetsanopoulos | of 'synnefo.api' to ``DEBUG`` |
770 | 4be65f1f | Christos Stavrakakis | |
771 | a1c707c9 | Constantinos Venetsanopoulos | By default, the Django webapp and snf-manage logs to syslog, while |
772 | a1c707c9 | Constantinos Venetsanopoulos | `snf-dispatcher` logs to `/var/log/synnefo/dispatcher.log`. |
773 | bc055d09 | Constantinos Venetsanopoulos | |
774 | d189d11c | Constantinos Venetsanopoulos | |
775 | bc055d09 | Constantinos Venetsanopoulos | Scaling up to multiple nodes |
776 | bc055d09 | Constantinos Venetsanopoulos | ============================ |
777 | bc055d09 | Constantinos Venetsanopoulos | |
778 | bc055d09 | Constantinos Venetsanopoulos | Here we will describe how to deploy all services, interconnected with each |
779 | 2f6143c9 | Constantinos Venetsanopoulos | other, on multiple physical nodes. |
780 | 2f6143c9 | Constantinos Venetsanopoulos | |
781 | 2f6143c9 | Constantinos Venetsanopoulos | synnefo components |
782 | 2f6143c9 | Constantinos Venetsanopoulos | ------------------ |
783 | 2f6143c9 | Constantinos Venetsanopoulos | |
784 | 2f6143c9 | Constantinos Venetsanopoulos | You need to install the appropriate synnefo software components on each node, |
785 | 2f6143c9 | Constantinos Venetsanopoulos | depending on its type, see :ref:`Architecture <cyclades-architecture>`. |
786 | 2f6143c9 | Constantinos Venetsanopoulos | |
787 | 2f6143c9 | Constantinos Venetsanopoulos | Please see the page of each synnefo software component for specific |
788 | 2f6143c9 | Constantinos Venetsanopoulos | installation instructions, where applicable. |
789 | 2f6143c9 | Constantinos Venetsanopoulos | |
790 | 2f6143c9 | Constantinos Venetsanopoulos | Install the following synnefo components: |
791 | 2f6143c9 | Constantinos Venetsanopoulos | |
792 | 2f6143c9 | Constantinos Venetsanopoulos | Nodes of type :ref:`APISERVER <APISERVER_NODE>` |
793 | 2f6143c9 | Constantinos Venetsanopoulos | Components |
794 | 2f6143c9 | Constantinos Venetsanopoulos | :ref:`snf-common <snf-common>`, |
795 | 2f6143c9 | Constantinos Venetsanopoulos | :ref:`snf-webproject <snf-webproject>`, |
796 | 2f6143c9 | Constantinos Venetsanopoulos | :ref:`snf-cyclades-app <snf-cyclades-app>` |
797 | 2f6143c9 | Constantinos Venetsanopoulos | Nodes of type :ref:`GANETI-MASTER <GANETI_MASTER>` and :ref:`GANETI-NODE <GANETI_NODE>` |
798 | 2f6143c9 | Constantinos Venetsanopoulos | Components |
799 | 2f6143c9 | Constantinos Venetsanopoulos | :ref:`snf-common <snf-common>`, |
800 | 2f6143c9 | Constantinos Venetsanopoulos | :ref:`snf-cyclades-gtools <snf-cyclades-gtools>` |
801 | 2f6143c9 | Constantinos Venetsanopoulos | Nodes of type :ref:`LOGIC <LOGIC_NODE>` |
802 | 2f6143c9 | Constantinos Venetsanopoulos | Components |
803 | 2f6143c9 | Constantinos Venetsanopoulos | :ref:`snf-common <snf-common>`, |
804 | 2f6143c9 | Constantinos Venetsanopoulos | :ref:`snf-webproject <snf-webproject>`, |
805 | 2f6143c9 | Constantinos Venetsanopoulos | :ref:`snf-cyclades-app <snf-cyclades-app>`. |
806 | 2f6143c9 | Constantinos Venetsanopoulos | |
807 | 547c78f6 | Constantinos Venetsanopoulos | |
808 | bc055d09 | Constantinos Venetsanopoulos | |
809 | bc055d09 | Constantinos Venetsanopoulos | Upgrade Notes |
810 | bc055d09 | Constantinos Venetsanopoulos | ============= |
811 | bc055d09 | Constantinos Venetsanopoulos | |
812 | bc055d09 | Constantinos Venetsanopoulos | Cyclades upgrade notes |
813 | bc055d09 | Constantinos Venetsanopoulos | ---------------------- |
814 | bc055d09 | Constantinos Venetsanopoulos | |
815 | bc055d09 | Constantinos Venetsanopoulos | .. toctree:: |
816 | bc055d09 | Constantinos Venetsanopoulos | :maxdepth: 2 |
817 | bc055d09 | Constantinos Venetsanopoulos | |
818 | bc055d09 | Constantinos Venetsanopoulos | cyclades-upgrade |
819 | bc055d09 | Constantinos Venetsanopoulos | |
820 | bc055d09 | Constantinos Venetsanopoulos | Changelog |
821 | bc055d09 | Constantinos Venetsanopoulos | ========= |