root / docs / admin-guide.rst @ bb440e17
History | View | Annotate | Download (6.5 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 | Quick Installation |
9 | bc055d09 | Constantinos Venetsanopoulos | ================== |
10 | bc055d09 | Constantinos Venetsanopoulos | |
11 | bc055d09 | Constantinos Venetsanopoulos | The quick installation guide describes how to install the whole synnefo stack |
12 | bc055d09 | Constantinos Venetsanopoulos | in just two physical nodes, for testing purposes. This guide is useful to those |
13 | bc055d09 | Constantinos Venetsanopoulos | interested in deploying synnefo in large scale, as a starting point that will |
14 | bc055d09 | Constantinos Venetsanopoulos | help them get familiar with the synnefo components and overall architecture, as |
15 | bc055d09 | Constantinos Venetsanopoulos | well as the interconnection between different services. Such an installation, |
16 | bc055d09 | Constantinos Venetsanopoulos | also provides a quick preview of the basic synnefo features, although we would |
17 | bc055d09 | Constantinos Venetsanopoulos | like to think that synnefo unveils its real power while scaling. |
18 | bc055d09 | Constantinos Venetsanopoulos | |
19 | bc055d09 | Constantinos Venetsanopoulos | | :ref:`Administrator's quick installation guide <quick-install-admin-guide>` |
20 | bc055d09 | Constantinos Venetsanopoulos | | This guide will walk you through a complete installation using debian packages. |
21 | bc055d09 | Constantinos Venetsanopoulos | |
22 | bc055d09 | Constantinos Venetsanopoulos | Common administrative tasks |
23 | bc055d09 | Constantinos Venetsanopoulos | =========================== |
24 | bc055d09 | Constantinos Venetsanopoulos | |
25 | bc055d09 | Constantinos Venetsanopoulos | If you installed Synnefo successfully and have a working deployment, here are |
26 | bc055d09 | Constantinos Venetsanopoulos | some common administrative tasks that you may find useful. |
27 | bc055d09 | Constantinos Venetsanopoulos | |
28 | bc055d09 | Constantinos Venetsanopoulos | The "kamaki" API client |
29 | bc055d09 | Constantinos Venetsanopoulos | ----------------------- |
30 | bc055d09 | Constantinos Venetsanopoulos | |
31 | bc055d09 | Constantinos Venetsanopoulos | To upload, register or modify an image you will need the **kamaki** tool. |
32 | bc055d09 | Constantinos Venetsanopoulos | Before proceeding make sure that it is configured properly. Verify that |
33 | bc055d09 | Constantinos Venetsanopoulos | *image_url*, *storage_url*, and *token* are set as needed: |
34 | bc055d09 | Constantinos Venetsanopoulos | |
35 | bc055d09 | Constantinos Venetsanopoulos | .. code-block:: console |
36 | bc055d09 | Constantinos Venetsanopoulos | |
37 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki config list |
38 | bc055d09 | Constantinos Venetsanopoulos | |
39 | bc055d09 | Constantinos Venetsanopoulos | To chage a setting use ``kamaki config set``: |
40 | bc055d09 | Constantinos Venetsanopoulos | |
41 | bc055d09 | Constantinos Venetsanopoulos | .. code-block:: console |
42 | bc055d09 | Constantinos Venetsanopoulos | |
43 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki config set image_url https://cyclades.example.com/plankton |
44 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki config set storage_url https://pithos.example.com/v1 |
45 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki config set token ... |
46 | bc055d09 | Constantinos Venetsanopoulos | |
47 | bc055d09 | Constantinos Venetsanopoulos | Upload Image |
48 | bc055d09 | Constantinos Venetsanopoulos | ------------ |
49 | bc055d09 | Constantinos Venetsanopoulos | |
50 | bc055d09 | Constantinos Venetsanopoulos | As a shortcut, you can configure a default account and container that will be |
51 | bc055d09 | Constantinos Venetsanopoulos | used by the ``kamaki store`` commands: |
52 | bc055d09 | Constantinos Venetsanopoulos | |
53 | bc055d09 | Constantinos Venetsanopoulos | .. code-block:: console |
54 | bc055d09 | Constantinos Venetsanopoulos | |
55 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki config set storage_account images@example.com |
56 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki config set storage_container images |
57 | bc055d09 | Constantinos Venetsanopoulos | |
58 | bc055d09 | Constantinos Venetsanopoulos | If the container does not exist, you will have to create it before uploading |
59 | bc055d09 | Constantinos Venetsanopoulos | any images: |
60 | bc055d09 | Constantinos Venetsanopoulos | |
61 | bc055d09 | Constantinos Venetsanopoulos | .. code-block:: console |
62 | bc055d09 | Constantinos Venetsanopoulos | |
63 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki store create images |
64 | bc055d09 | Constantinos Venetsanopoulos | |
65 | bc055d09 | Constantinos Venetsanopoulos | You are now ready to upload an image. You can upload it with a Pithos+ client, |
66 | bc055d09 | Constantinos Venetsanopoulos | or use kamaki directly: |
67 | bc055d09 | Constantinos Venetsanopoulos | |
68 | bc055d09 | Constantinos Venetsanopoulos | .. code-block:: console |
69 | bc055d09 | Constantinos Venetsanopoulos | |
70 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki store upload ubuntu.iso |
71 | bc055d09 | Constantinos Venetsanopoulos | |
72 | bc055d09 | Constantinos Venetsanopoulos | You can use any Pithos+ client to verify that the image was uploaded correctly. |
73 | bc055d09 | Constantinos Venetsanopoulos | The full Pithos URL for the previous example will be |
74 | bc055d09 | Constantinos Venetsanopoulos | ``pithos://images@example.com/images/ubuntu.iso``. |
75 | bc055d09 | Constantinos Venetsanopoulos | |
76 | bc055d09 | Constantinos Venetsanopoulos | |
77 | bc055d09 | Constantinos Venetsanopoulos | Register Image |
78 | bc055d09 | Constantinos Venetsanopoulos | -------------- |
79 | bc055d09 | Constantinos Venetsanopoulos | |
80 | bc055d09 | Constantinos Venetsanopoulos | To register an image you will need to use the full Pithos+ URL. To register as |
81 | bc055d09 | Constantinos Venetsanopoulos | a public image the one from the previous example use: |
82 | bc055d09 | Constantinos Venetsanopoulos | |
83 | bc055d09 | Constantinos Venetsanopoulos | .. code-block:: console |
84 | bc055d09 | Constantinos Venetsanopoulos | |
85 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki glance register Ubuntu pithos://images@example.com/images/ubuntu.iso --public |
86 | bc055d09 | Constantinos Venetsanopoulos | |
87 | bc055d09 | Constantinos Venetsanopoulos | The ``--public`` flag is important, if missing the registered image will not |
88 | bc055d09 | Constantinos Venetsanopoulos | be listed by ``kamaki glance list``. |
89 | bc055d09 | Constantinos Venetsanopoulos | |
90 | bc055d09 | Constantinos Venetsanopoulos | Use ``kamaki glance register`` with no arguments to see a list of available |
91 | bc055d09 | Constantinos Venetsanopoulos | options. A more complete example would be the following: |
92 | bc055d09 | Constantinos Venetsanopoulos | |
93 | bc055d09 | Constantinos Venetsanopoulos | .. code-block:: console |
94 | bc055d09 | Constantinos Venetsanopoulos | |
95 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki glance register Ubuntu pithos://images@example.com/images/ubuntu.iso \ |
96 | bc055d09 | Constantinos Venetsanopoulos | --public --disk-format diskdump --property kernel=3.1.2 |
97 | bc055d09 | Constantinos Venetsanopoulos | |
98 | bc055d09 | Constantinos Venetsanopoulos | To verify that the image was registered successfully use: |
99 | bc055d09 | Constantinos Venetsanopoulos | |
100 | bc055d09 | Constantinos Venetsanopoulos | .. code-block:: console |
101 | bc055d09 | Constantinos Venetsanopoulos | |
102 | bc055d09 | Constantinos Venetsanopoulos | $ kamaki glance list -l |
103 | bc055d09 | Constantinos Venetsanopoulos | |
104 | bc055d09 | Constantinos Venetsanopoulos | |
105 | bc055d09 | Constantinos Venetsanopoulos | Admin tool: snf-manage |
106 | bc055d09 | Constantinos Venetsanopoulos | ---------------------- |
107 | bc055d09 | Constantinos Venetsanopoulos | |
108 | bc055d09 | Constantinos Venetsanopoulos | ``snf-manage`` is a tool used to perform various administrative tasks. It needs |
109 | bc055d09 | Constantinos Venetsanopoulos | to be able to access the django database, so the following should be able to |
110 | bc055d09 | Constantinos Venetsanopoulos | import the Django settings. |
111 | bc055d09 | Constantinos Venetsanopoulos | |
112 | bc055d09 | Constantinos Venetsanopoulos | Additionally, administrative tasks can be performed via the admin web interface |
113 | bc055d09 | Constantinos Venetsanopoulos | located in /admin. Only users of type ADMIN can access the admin pages. To change |
114 | bc055d09 | Constantinos Venetsanopoulos | the type of a user to ADMIN, snf-admin can be used: |
115 | bc055d09 | Constantinos Venetsanopoulos | |
116 | bc055d09 | Constantinos Venetsanopoulos | .. code-block:: console |
117 | bc055d09 | Constantinos Venetsanopoulos | |
118 | bc055d09 | Constantinos Venetsanopoulos | $ snf-manage user modify 42 --type ADMIN |
119 | bc055d09 | Constantinos Venetsanopoulos | |
120 | bc055d09 | Constantinos Venetsanopoulos | Reconciliation mechanism |
121 | bc055d09 | Constantinos Venetsanopoulos | ------------------------ |
122 | bc055d09 | Constantinos Venetsanopoulos | |
123 | bc055d09 | Constantinos Venetsanopoulos | On certain occasions, such as a Ganeti or RabbitMQ failure, the VM state in the |
124 | bc055d09 | Constantinos Venetsanopoulos | system's database may differ from that in the Ganeti installation. The |
125 | bc055d09 | Constantinos Venetsanopoulos | reconciliation process is designed to bring the system's database in sync with |
126 | bc055d09 | Constantinos Venetsanopoulos | what Ganeti knows about each VM, and is able to detect the following three |
127 | bc055d09 | Constantinos Venetsanopoulos | conditions: |
128 | bc055d09 | Constantinos Venetsanopoulos | |
129 | bc055d09 | Constantinos Venetsanopoulos | * Stale DB servers without corresponding Ganeti instances |
130 | bc055d09 | Constantinos Venetsanopoulos | * Orphan Ganeti instances, without corresponding DB entries |
131 | bc055d09 | Constantinos Venetsanopoulos | * Out-of-sync operstate for DB entries wrt to Ganeti instances |
132 | bc055d09 | Constantinos Venetsanopoulos | |
133 | bc055d09 | Constantinos Venetsanopoulos | The reconciliation mechanism runs as a management command, e.g., as follows: |
134 | bc055d09 | Constantinos Venetsanopoulos | [PYTHONPATH needs to contain the parent of the synnefo Django project |
135 | bc055d09 | Constantinos Venetsanopoulos | directory]: |
136 | bc055d09 | Constantinos Venetsanopoulos | |
137 | bc055d09 | Constantinos Venetsanopoulos | .. code-block:: console |
138 | bc055d09 | Constantinos Venetsanopoulos | |
139 | bc055d09 | Constantinos Venetsanopoulos | $ export PYTHONPATH=/srv:$PYTHONPATH |
140 | bc055d09 | Constantinos Venetsanopoulos | $ snf-manage reconcile --detect-all -v 2 |
141 | bc055d09 | Constantinos Venetsanopoulos | |
142 | bc055d09 | Constantinos Venetsanopoulos | Please see ``snf-manage reconcile --help`` for all the details. |
143 | bc055d09 | Constantinos Venetsanopoulos | |
144 | bc055d09 | Constantinos Venetsanopoulos | The administrator can also trigger reconciliation of operating state manually, |
145 | bc055d09 | Constantinos Venetsanopoulos | by issuing a Ganeti ``OP_INSTANCE_QUERY_DATA`` command on a Synnefo VM, using |
146 | bc055d09 | Constantinos Venetsanopoulos | gnt-instance info. |
147 | bc055d09 | Constantinos Venetsanopoulos | |
148 | bc055d09 | Constantinos Venetsanopoulos | Logging |
149 | bc055d09 | Constantinos Venetsanopoulos | ------- |
150 | bc055d09 | Constantinos Venetsanopoulos | |
151 | bc055d09 | Constantinos Venetsanopoulos | Logging in Synnefo is using Python's logging module. The module is configured |
152 | bc055d09 | Constantinos Venetsanopoulos | using dictionary configuration, whose format is described here: |
153 | bc055d09 | Constantinos Venetsanopoulos | |
154 | bc055d09 | Constantinos Venetsanopoulos | http://docs.python.org/release/2.7.1/library/logging.html#logging-config-dictschema |
155 | bc055d09 | Constantinos Venetsanopoulos | |
156 | bc055d09 | Constantinos Venetsanopoulos | Note that this is a feature of Python 2.7 that we have backported for use in |
157 | bc055d09 | Constantinos Venetsanopoulos | Python 2.6. |
158 | bc055d09 | Constantinos Venetsanopoulos | |
159 | bc055d09 | Constantinos Venetsanopoulos | The logging configuration dictionary is defined in settings.d/00-logging.conf |
160 | bc055d09 | Constantinos Venetsanopoulos | and is broken in 4 separate dictionaries: |
161 | bc055d09 | Constantinos Venetsanopoulos | |
162 | bc055d09 | Constantinos Venetsanopoulos | * LOGGING is the logging configuration used by the web app. By default all |
163 | bc055d09 | Constantinos Venetsanopoulos | loggers fall back to the main 'synnefo' logger. The subloggers can be |
164 | bc055d09 | Constantinos Venetsanopoulos | changed accordingly for finer logging control. e.g. To disable debug |
165 | bc055d09 | Constantinos Venetsanopoulos | messages from the API set the level of 'synnefo.api' to 'INFO'. |
166 | bc055d09 | Constantinos Venetsanopoulos | |
167 | bc055d09 | Constantinos Venetsanopoulos | * DISPATCHER_LOGGING is the logging configuration of the logic/dispatcher.py |
168 | bc055d09 | Constantinos Venetsanopoulos | command line tool. |
169 | bc055d09 | Constantinos Venetsanopoulos | |
170 | bc055d09 | Constantinos Venetsanopoulos | * SNFADMIN_LOGGING is the logging configuration of the snf-admin tool. |
171 | bc055d09 | Constantinos Venetsanopoulos | Consider using matching configuration for snf-admin and the synnefo.admin |
172 | bc055d09 | Constantinos Venetsanopoulos | logger of the web app. |
173 | bc055d09 | Constantinos Venetsanopoulos | |
174 | bc055d09 | Constantinos Venetsanopoulos | Please note the following: |
175 | bc055d09 | Constantinos Venetsanopoulos | |
176 | bc055d09 | Constantinos Venetsanopoulos | * As of Synnefo v0.7, by default the Django webapp logs to syslog, the |
177 | bc055d09 | Constantinos Venetsanopoulos | dispatcher logs to /var/log/synnefo/dispatcher.log and the console, |
178 | bc055d09 | Constantinos Venetsanopoulos | snf-admin logs to the console. |
179 | bc055d09 | Constantinos Venetsanopoulos | * Different handlers can be set to different logging levels: |
180 | bc055d09 | Constantinos Venetsanopoulos | for example, everything may appear to the console, but only INFO and higher |
181 | bc055d09 | Constantinos Venetsanopoulos | may actually be stored in a longer-term logfile |
182 | bc055d09 | Constantinos Venetsanopoulos | |
183 | bc055d09 | Constantinos Venetsanopoulos | |
184 | bc055d09 | Constantinos Venetsanopoulos | Scaling up to multiple nodes |
185 | bc055d09 | Constantinos Venetsanopoulos | ============================ |
186 | bc055d09 | Constantinos Venetsanopoulos | |
187 | bc055d09 | Constantinos Venetsanopoulos | Here we will describe how to deploy all services, interconnected with each |
188 | bc055d09 | Constantinos Venetsanopoulos | other, on multiple physical nodes. For now, if you installed successfully using |
189 | bc055d09 | Constantinos Venetsanopoulos | the quick installation guide and need more details, please refer to each |
190 | bc055d09 | Constantinos Venetsanopoulos | component's own documentation. |
191 | bc055d09 | Constantinos Venetsanopoulos | |
192 | bc055d09 | Constantinos Venetsanopoulos | Upgrade Notes |
193 | bc055d09 | Constantinos Venetsanopoulos | ============= |
194 | bc055d09 | Constantinos Venetsanopoulos | |
195 | bc055d09 | Constantinos Venetsanopoulos | Cyclades upgrade notes |
196 | bc055d09 | Constantinos Venetsanopoulos | ---------------------- |
197 | bc055d09 | Constantinos Venetsanopoulos | |
198 | bc055d09 | Constantinos Venetsanopoulos | .. toctree:: |
199 | bc055d09 | Constantinos Venetsanopoulos | :maxdepth: 2 |
200 | bc055d09 | Constantinos Venetsanopoulos | |
201 | bc055d09 | Constantinos Venetsanopoulos | cyclades-upgrade |
202 | bc055d09 | Constantinos Venetsanopoulos | |
203 | bc055d09 | Constantinos Venetsanopoulos | Changelog |
204 | bc055d09 | Constantinos Venetsanopoulos | ========= |