Statistics
| Branch: | Tag: | Revision:

root / snf-docs / admin.rst @ 9940eacf

History | View | Annotate | Download (3.2 kB)

1 82b5509d Kostas Papadimitriou
Administration
2 82b5509d Kostas Papadimitriou
==============
3 03353341 Vangelis Koukis
4 03353341 Vangelis Koukis
This file contains notes related to administration of a working Synnefo
5 03353341 Vangelis Koukis
deployment. This document should be read *after* README.deploy, which contains
6 03353341 Vangelis Koukis
step-by-step Synnefo deployment instructions.
7 03353341 Vangelis Koukis
8 03353341 Vangelis Koukis
9 96b635d9 Vangelis Koukis
Database
10 82b5509d Kostas Papadimitriou
--------
11 96b635d9 Vangelis Koukis
12 96b635d9 Vangelis Koukis
MySQL: manage.py dbshell seems to ignore the setting of 'init_command'
13 96b635d9 Vangelis Koukis
       in settings.DATABASES
14 96b635d9 Vangelis Koukis
15 3b40590c Vangelis Koukis
16 03353341 Vangelis Koukis
Reconciliation mechanism
17 82b5509d Kostas Papadimitriou
------------------------
18 03353341 Vangelis Koukis
19 03353341 Vangelis Koukis
On certain occasions, such as a Ganeti or RabbitMQ failure, the VM state in the
20 03353341 Vangelis Koukis
system's database may differ from that in the Ganeti installation. The
21 03353341 Vangelis Koukis
reconciliation process is designed to bring the system's database in sync with
22 3b40590c Vangelis Koukis
what Ganeti knows about each VM, and is able to detect the following three
23 3b40590c Vangelis Koukis
conditions:
24 03353341 Vangelis Koukis
25 3b40590c Vangelis Koukis
 * Stale DB servers without corresponding Ganeti instances
26 3b40590c Vangelis Koukis
 * Orphan Ganeti instances, without corresponding DB entries
27 3b40590c Vangelis Koukis
 * Out-of-sync operstate for DB entries wrt to Ganeti instances
28 03353341 Vangelis Koukis
29 3b40590c Vangelis Koukis
The reconciliation mechanism runs as a management command, e.g., as follows:
30 3b40590c Vangelis Koukis
[PYTHONPATH needs to contain the parent of the synnefo Django project
31 3b40590c Vangelis Koukis
directory]:
32 03353341 Vangelis Koukis
33 3b40590c Vangelis Koukis
/srv/synnefo$ export PYTHONPATH=/srv:$PYTHONPATH
34 3b40590c Vangelis Koukis
vkoukis@dev67:~/synnefo [reconc]$ ./manage.py reconcile --detect-all -v 2
35 03353341 Vangelis Koukis
36 3b40590c Vangelis Koukis
Please see ./manage.py reconcile --help for all the details.
37 03353341 Vangelis Koukis
38 3b40590c Vangelis Koukis
The administrator can also trigger reconciliation of operating state manually,
39 3b40590c Vangelis Koukis
by issuing a Ganeti OP_INSTANCE_QUERY_DATA command on a Synnefo VM, using
40 3b40590c Vangelis Koukis
gnt-instance info.
41 03353341 Vangelis Koukis
42 03353341 Vangelis Koukis
43 3a4e3bac Georgios Gousios
Logging
44 82b5509d Kostas Papadimitriou
-------
45 3a4e3bac Georgios Gousios
46 3a4e3bac Georgios Gousios
Logging in Synnefo is using Python's logging module. The module is configured
47 9e98ba3c Giorgos Verigakis
using dictionary configuration, whose format is described here:
48 9e98ba3c Giorgos Verigakis
49 9e98ba3c Giorgos Verigakis
http://docs.python.org/release/2.7.1/library/logging.html#logging-config-dictschema
50 9e98ba3c Giorgos Verigakis
51 9e98ba3c Giorgos Verigakis
Note that this is a feature of Python 2.7 that we have backported for use in
52 9e98ba3c Giorgos Verigakis
Python 2.6.
53 9e98ba3c Giorgos Verigakis
54 9e98ba3c Giorgos Verigakis
The logging configuration dictionary is defined in settings.d/00-logging.conf
55 9e98ba3c Giorgos Verigakis
and is broken in 4 separate dictionaries:
56 9e98ba3c Giorgos Verigakis
57 9e98ba3c Giorgos Verigakis
  * LOGGING is the logging configuration used by the web app. By default all
58 9e98ba3c Giorgos Verigakis
    loggers fall back to the main 'synnefo' logger. The subloggers can be
59 9e98ba3c Giorgos Verigakis
    changed accordingly for finer logging control. e.g. To disable debug
60 9e98ba3c Giorgos Verigakis
    messages from the API set the level of 'synnefo.api' to 'INFO'.
61 9e98ba3c Giorgos Verigakis
  
62 9e98ba3c Giorgos Verigakis
  * DISPATCHER_LOGGING is the logging configuration of the logic/dispatcher.py
63 9e98ba3c Giorgos Verigakis
    command line tool.
64 9e98ba3c Giorgos Verigakis
  
65 9e98ba3c Giorgos Verigakis
  * SNFADMIN_LOGGING is the logging configuration of the snf-admin tool.
66 9e98ba3c Giorgos Verigakis
    Consider using matching configuration for snf-admin and the synnefo.admin
67 9e98ba3c Giorgos Verigakis
    logger of the web app.
68 9999b451 Giorgos Verigakis
69 a65ee5fc Vangelis Koukis
Please note the following:
70 a65ee5fc Vangelis Koukis
  * As of Synnefo v0.7, by default the Django webapp logs to syslog, the
71 a65ee5fc Vangelis Koukis
    dispatcher logs to /var/log/synnefo/dispatcher.log and the console,
72 a65ee5fc Vangelis Koukis
    snf-admin logs to the console.
73 a65ee5fc Vangelis Koukis
  * Different handlers can be set to different logging levels:
74 a65ee5fc Vangelis Koukis
    for example, everything may appear to the console, but only INFO and higher
75 a65ee5fc Vangelis Koukis
    may actually be stored in a longer-term logfile.
76 a65ee5fc Vangelis Koukis
77 9999b451 Giorgos Verigakis
78 9999b451 Giorgos Verigakis
Admin Tools
79 82b5509d Kostas Papadimitriou
-----------
80 9999b451 Giorgos Verigakis
81 9999b451 Giorgos Verigakis
snf-admin is a tool used to perform various administrative tasks. It needs to
82 9999b451 Giorgos Verigakis
be able to access the django database, so the following should be able to import
83 9999b451 Giorgos Verigakis
the Django settings.
84 9999b451 Giorgos Verigakis
85 9999b451 Giorgos Verigakis
Additionally, administrative tasks can be performed via the admin web interface
86 9999b451 Giorgos Verigakis
located in /admin. Only users of type ADMIN can access the admin pages. To change
87 9999b451 Giorgos Verigakis
the type of a user to ADMIN, snf-admin can be used:
88 9999b451 Giorgos Verigakis
89 9999b451 Giorgos Verigakis
   snf-admin user modify 42 --type ADMIN