Revision 90c74332

b/docs/admin-guide.rst
231 231
------------
232 232

  
233 233
Asynchronous communication with Ganeti backends
234
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
234
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
235 235
Synnefo uses Google Ganeti backends for VM cluster management. In order Cyclades
236 236
to be able to handle thousand of user requests, Cyclades and Ganeti communicate
237 237
asynchronously. Briefly, requests are submitted to Ganeti, and asynchronous
......
241 241
Cyclades API server is responsible for handling user requests. Read-only
242 242
requests are directly served by looking up the Cyclades DB. If the request
243 243
needs an action in the Ganeti backend, Cyclades submit jobs to the Ganeti
244
master using the Ganeti RAPI [1].
244
master using the `Ganeti RAPI <http://docs.ganeti.org/ganeti/2.2/html/rapi.html>`_.
245 245

  
246 246
While Ganeti executes the job, snf-ganeti-eventd, snf-ganeti-hook and
247 247
snf-progress-monitor are monitoring the progress of the job and send
......
250 250
* *snf-ganeti-eventd* sends messages about operations affecting the operating
251 251
  state of instances and networks. Works by monitoring Ganeti job queue.
252 252
* *snf-ganeti_hook* sends messages about the NIC of instances. It includes a
253
  number of Ganeti hooks for customisation of operations[2].
253
  number of `Ganeti hooks <http://docs.ganeti.org/ganeti/2.2/html/hooks.html>`_
254
  for customisation of operations.
254 255
* *snf-progress_monitor* sends messages about the progress of building a new
255 256
  instance and image deployment, triggered by snf-image.
256 257

  
......
258 259
messages and properly updates the state of Cyclades DB. Subsequent requests in
259 260
Cyclades API, will retrieve the updated state from the DB.
260 261

  
261
[1]: http://docs.ganeti.org/ganeti/2.2/html/rapi.html
262
[2]: http://docs.ganeti.org/ganeti/2.2/html/hooks.html
263

  
264 262

  
265 263
Prereqs
266 264
-------
......
290 288
---------------------
291 289

  
292 290
Managing Ganeti Backends
293
^^^^^^^^^^^^^^^^^^^^^^^^
291
~~~~~~~~~~~~~~~~~~~~~~~~
294 292

  
295 293
Since v0.11 Synnefo is able to manage multiple Ganeti clusters (backends)
296 294
making it capable to scale to thousand of VMs. Backends can be dynamically be
......
309 307
be connected to the same private network.
310 308

  
311 309
Listing existing backend
312
^^^^^^^^^^^^^^^^^^^^^^^^
310
````````````````````````
313 311
To find out the available Ganeti backends, run:
312

  
314 313
.. code-block:: console
315 314

  
316 315
   $ snf-manage backend-list
317 316

  
318 317
Adding a new Ganeti backend
319
^^^^^^^^^^^^^^^^^^^^^^^^^^^
318
```````````````````````````
320 319
Backends are dynamically added under the control of Synnefo with `snf-manage
321 320
backend-add` command. In this section it is assumed that a Ganeti cluster,
322 321
named cluster.example.com is already up and running and configured to be able
323 322
to host Synnefo VMs.
324 323

  
325 324
To add the Ganeti cluster, run:
325

  
326 326
.. code-block:: console
327 327

  
328 328
   $ snf-manage backend-add --clustername=cluster.example.com --user="synnefo_user" --pass="synnefo_pass"
......
339 339
associated with it.
340 340

  
341 341
Removing an existing Ganeti backend
342
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
342
```````````````````````````````````
343 343
In order to remove an existing backend, run:
344

  
344 345
.. code-block:: console
345 346

  
346 347
   # snf-manage backend-remove ID
......
350 351
will be left.
351 352

  
352 353
Allocation of VMS in Ganneti backends
353
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
354
`````````````````````````````````````
354 355
As already mentioned, the backend allocator is responsible allocating new VMs
355 356
to backends. This allocator is not concerned about the Ganeti node that will
356 357
host the VM, which is chosen by the Ganeti allocator.
......
359 360
resources. The allocator computes a score for each backend, that shows its load
360 361
factor, and the one with the minimum score is chosen. The admin can exclude
361 362
backends from the allocation phase by marking them as drained by running:
363

  
362 364
.. code-block:: console
363 365

  
364 366
   $ snf-manage backend-modify --drained ID
......
373 375
the `BACKEND_PER_USER` setting.
374 376

  
375 377
Managing Network Resources
376
^^^^^^^^^^^^^^^^^^^^^^^^^^
378
~~~~~~~~~~~~~~~~~~~~~~~~~~
377 379

  
378 380
Proper operation of of Cyclades Network Service depends on unique assignment of
379 381
specific resources to each virtual network. Specifically, these resources are:
......
391 393
  management command.
392 394

  
393 395
Creating a new Pool
394
^^^^^^^^^^^^^^^^^^^
396
```````````````````
395 397

  
396 398
Pools are created using the `snf-manage pool-create` command.
399

  
397 400
.. code-block:: console
398 401

  
399 402
   # snf-manage pool-create --type=bridge --base=prv --size=20
......
401 404
will create a pool of bridges, containing bridges prv1, prv2,..prv21.
402 405

  
403 406
You can verify the creation of the pool, and check its contents by running:
407

  
404 408
.. code-block:: console
405 409

  
406 410
   # snf-manage pool-list
407 411
   # snf-manage pool-show --type=bridge 1
408 412

  
409 413
With the same commands you can handle the pool of MAC prefixes. For example:
414

  
410 415
.. code-block:: console
411 416

  
412 417
   # snf-manage pool-create --type=mac-prefix --base=aa:00:0 --size=65536
......
428 433
for reconciling VMs and Networks
429 434

  
430 435
Reconciling VirtualMachine
431
~~~~~~~~~~~~~~~~~~~~~~~~~~
436
``````````````````````````
432 437
Reconciliation of VMs detects the following conditions:
433 438
 * Stale DB servers without corresponding Ganeti instances
434 439
 * Orphan Ganeti instances, without corresponding DB entries
435 440
 * Out-of-sync state for DB entries wrt to Ganeti instances
436 441

  
437 442
To detect all inconsistencies you can just run:
443

  
438 444
.. code-block:: console
439 445
  $ snf-manage reconcile --detect-all
440 446

  
441 447
Adding the `--fix-all` option, will do the actual synchronization:
448

  
442 449
.. code-block:: console
443 450
  $ snf-manage reconcile --detect-all --fix-all
444 451

  
......
446 453

  
447 454

  
448 455
Reconciling Networks
449
~~~~~~~~~~~~~~~~~~~~
456
````````````````````
450 457
Reconciliation of Networks detects the following conditions:
451 458
  * Stale DB networks without corresponding Ganeti networks
452 459
  * Orphan Ganeti networks, without corresponding DB entries
......
454 461
  * Unsynchronized IP pools
455 462

  
456 463
To detect all inconsistencies you can just run:
464

  
457 465
.. code-block:: console
458 466
  $ snf-manage reconcile-networks
459 467

  
460 468
Adding the `--fix-all` option, will do the actual synchronization:
469

  
461 470
.. code-block:: console
462 471
  $ snf-manage reconcile-networks --fix-all
463 472

  

Also available in: Unified diff