Statistics
| Branch: | Tag: | Revision:

root / docs / setup.rst @ 2bd23362

History | View | Annotate | Download (19.1 kB)

1 85e3803d Stavros Sachtouris
Setup
2 85e3803d Stavros Sachtouris
=====
3 0c24b26b Stavros Sachtouris
4 fa479dc3 Stavros Sachtouris
Kamaki is easy to install from source or as a package. Some advanced or ui features
5 fa479dc3 Stavros Sachtouris
are optional and can be installed separately. Kamaki behavior can be configured in
6 fa479dc3 Stavros Sachtouris
the kamaki config file.
7 0c24b26b Stavros Sachtouris
8 c52d1b08 Stavros Sachtouris
Quick Setup
9 c52d1b08 Stavros Sachtouris
-----------
10 c52d1b08 Stavros Sachtouris
11 2bd23362 Stavros Sachtouris
.. warning:: Users of kamaki 0.8.X or older should consult the
12 2bd23362 Stavros Sachtouris
    `migration guide <#migrating-from-kamaki-0-8-x-to-0-9-or-better>`_ first.
13 c52d1b08 Stavros Sachtouris
14 fa382f9e Stavros Sachtouris
Kamaki has to be configured for a specific Synnefo deployment, with an
15 fa382f9e Stavros Sachtouris
authentication url and user token pair. Users should also pick an alias to name
16 2bd23362 Stavros Sachtouris
the cloud configuration. This can be any single word, e.g., "default",
17 2bd23362 Stavros Sachtouris
"mycloud"or whatever suits the user.
18 fa479dc3 Stavros Sachtouris
19 fa479dc3 Stavros Sachtouris
.. code-block:: console
20 abfaa6d9 Vangelis Koukis
21 fa382f9e Stavros Sachtouris
    $ kamaki config set cloud.<cloud alias>.url <cloud-authentication-URL>
22 fa382f9e Stavros Sachtouris
    $ kamaki config set cloud.<cloud alias>.token myt0k3n==
23 fa479dc3 Stavros Sachtouris
24 fa382f9e Stavros Sachtouris
If only one cloud is configured, kamaki automatically picks it as the default.
25 fa382f9e Stavros Sachtouris
Otherwise, a default cloud should be specified:
26 fa382f9e Stavros Sachtouris
27 fa382f9e Stavros Sachtouris
.. code-block:: console
28 fa382f9e Stavros Sachtouris
29 fa382f9e Stavros Sachtouris
    $ kamaki config set default_cloud <cloud alias>
30 fa382f9e Stavros Sachtouris
31 abfaa6d9 Vangelis Koukis
Since version 0.14, Synnefo supports a single authentication URL for retrieving
32 abfaa6d9 Vangelis Koukis
all API endpoints. This URL is retrieved from the Synnefo Web UI and should be
33 abfaa6d9 Vangelis Koukis
set as the cloud URL for kamaki. All service-specific URLs are retrieved and
34 2bd23362 Stavros Sachtouris
handled automatically. Users of Synnefo clouds >=0.14 are advised against using
35 2bd23362 Stavros Sachtouris
any service-specific URLs.
36 904091dd Stavros Sachtouris
37 2bd23362 Stavros Sachtouris
Migrating from kamaki 0.8.X to 0.9 or better
38 2bd23362 Stavros Sachtouris
--------------------------------------------
39 fa479dc3 Stavros Sachtouris
40 abfaa6d9 Vangelis Koukis
This section refers to running installations of kamaki version <= 0.8.X. To
41 fa382f9e Stavros Sachtouris
check the current kamaki version:
42 fa479dc3 Stavros Sachtouris
43 fa479dc3 Stavros Sachtouris
.. code-block:: console
44 fa479dc3 Stavros Sachtouris
45 fa479dc3 Stavros Sachtouris
    $ kamaki -V
46 fa479dc3 Stavros Sachtouris
47 fa382f9e Stavros Sachtouris
Existing kamaki users should convert their configuration files to v9. To do
48 fa382f9e Stavros Sachtouris
that, kamaki 0.9 can inspect the configuration file and suggests a list of
49 2bd23362 Stavros Sachtouris
config file transformations, which are performed automatically after users'
50 2bd23362 Stavros Sachtouris
permission. This mechanism is invoked when an API-related kamaki command is
51 2bd23362 Stavros Sachtouris
fired. On example 2.1 we suggest using the `user authenticate` command to start
52 2bd23362 Stavros Sachtouris
the conversion mechanism for the configuration file.
53 fa479dc3 Stavros Sachtouris
54 fa479dc3 Stavros Sachtouris
.. code-block:: console
55 fa479dc3 Stavros Sachtouris
    :emphasize-lines: 1
56 fa479dc3 Stavros Sachtouris
57 904091dd Stavros Sachtouris
    Example 2.1: Convert config file while authenticating user "exampleuser"
58 fa479dc3 Stavros Sachtouris
59 fa479dc3 Stavros Sachtouris
    $ kamaki user authenticate
60 fa382f9e Stavros Sachtouris
    Config file format version >= 9.0 is required
61 fa382f9e Stavros Sachtouris
    Configuration file: "/home/exampleuser/.kamakirc"
62 fa479dc3 Stavros Sachtouris
    but kamaki can fix this:
63 fa479dc3 Stavros Sachtouris
    Calculating changes while preserving information
64 fa382f9e Stavros Sachtouris
    ... rescue global.token => cloud.default.token
65 fa479dc3 Stavros Sachtouris
    ... rescue config.cli => global.config_cli
66 fa479dc3 Stavros Sachtouris
    ... rescue history.file => global.history_file
67 fa479dc3 Stavros Sachtouris
    ... DONE
68 fa479dc3 Stavros Sachtouris
    The following information will NOT be preserved:
69 abfaa6d9 Vangelis Koukis
        global.account =
70 fa479dc3 Stavros Sachtouris
        global.data_log = on
71 fa479dc3 Stavros Sachtouris
        user.account = exampleuser@example.com
72 fa479dc3 Stavros Sachtouris
        user.url = https://accounts.okeanos.grnet.gr
73 fa479dc3 Stavros Sachtouris
        compute.url = https://cyclades.okeanos.grnet.gr/api/v1.1
74 fa479dc3 Stavros Sachtouris
        file.url = https://pithos.okeanos.grnet.gr/v1
75 fa479dc3 Stavros Sachtouris
        image.url = https://cyclades.okeanos.grnet.gr/plankton
76 fa479dc3 Stavros Sachtouris
77 fa382f9e Stavros Sachtouris
    Kamaki is ready to convert the config file to version 9.0
78 fa479dc3 Stavros Sachtouris
    Overwrite file /home/exampleuser/.kamakirc ? [Y, y]
79 fa479dc3 Stavros Sachtouris
80 fa479dc3 Stavros Sachtouris
At this point, we should examine the kamaki output. Most options are renamed to
81 2bd23362 Stavros Sachtouris
match the latest configuration file version specifications.
82 fa479dc3 Stavros Sachtouris
83 fa479dc3 Stavros Sachtouris
Let's take a look at the discarded options:
84 fa479dc3 Stavros Sachtouris
85 904091dd Stavros Sachtouris
* `global.account` and `user.account` are not used anymore.
86 904091dd Stavros Sachtouris
    The same is true for the synonyms `store.account` and `pithos.account`.
87 904091dd Stavros Sachtouris
    These options were used to explicitly set a user account or uuid to a
88 904091dd Stavros Sachtouris
    pithos call. In the latest Synnefo version (>= 0.14), these features are
89 904091dd Stavros Sachtouris
    meaningless and therefore omitted.
90 fa479dc3 Stavros Sachtouris
91 904091dd Stavros Sachtouris
* `global.data_log` option has never been a valid kamaki config option.
92 2bd23362 Stavros Sachtouris
    In this scenario, the user wanted to set the `log_data` option, but he or
93 2bd23362 Stavros Sachtouris
    she typed `data_log` instead. To fix this, the user should manually set the
94 2bd23362 Stavros Sachtouris
    correct option after the conversion is complete (Example 2.2).
95 fa479dc3 Stavros Sachtouris
96 2bd23362 Stavros Sachtouris
Users should press *y* when they are ready, which will cause the default config
97 2bd23362 Stavros Sachtouris
file to be modified so that it conforms with the latest version.
98 fa479dc3 Stavros Sachtouris
99 fa479dc3 Stavros Sachtouris
.. code-block:: console
100 fa479dc3 Stavros Sachtouris
    :emphasize-lines: 1
101 fa479dc3 Stavros Sachtouris
102 fa479dc3 Stavros Sachtouris
    Example 2.2: Rescue misspelled log_data option
103 fa479dc3 Stavros Sachtouris
104 fa479dc3 Stavros Sachtouris
    $ kamaki config set log_data on
105 fa479dc3 Stavros Sachtouris
106 904091dd Stavros Sachtouris
In order to convert more files, users may run kamaki with the -c option, which
107 904091dd Stavros Sachtouris
runs kamaki with a different configuration file (Example 2.3) and apply the
108 904091dd Stavros Sachtouris
steps described above.
109 d6737e18 Stavros Sachtouris
110 c52d1b08 Stavros Sachtouris
.. code-block:: console
111 c52d1b08 Stavros Sachtouris
    :emphasize-lines: 1
112 c52d1b08 Stavros Sachtouris
113 fa479dc3 Stavros Sachtouris
    Example 2.3: Use kamaki to update a configuration file called ".myfilerc"
114 c52d1b08 Stavros Sachtouris
115 fa479dc3 Stavros Sachtouris
    $ kamaki -c .myfilerc user authenticate
116 c52d1b08 Stavros Sachtouris
117 fa382f9e Stavros Sachtouris
Multiple clouds
118 fa382f9e Stavros Sachtouris
---------------
119 904091dd Stavros Sachtouris
120 904091dd Stavros Sachtouris
The following refers to users of multiple Synnefo and/or Open Stack
121 904091dd Stavros Sachtouris
deployments. In the following, a Synnefo or Open Stack cloud deployment will
122 2bd23362 Stavros Sachtouris
be called **a cloud**.
123 904091dd Stavros Sachtouris
124 2bd23362 Stavros Sachtouris
Multiple clouds can be configured and manager in a single  kamaki setup, since
125 2bd23362 Stavros Sachtouris
version 0.9. Each cloud corresponds to a Synnefo (or Open Stack) cloud
126 2bd23362 Stavros Sachtouris
deployment, with each deployment offering a single point of authentication (an
127 2bd23362 Stavros Sachtouris
**authentication URL** and **token** pair). Users can retrieve this information
128 2bd23362 Stavros Sachtouris
through the cloud UI.
129 904091dd Stavros Sachtouris
130 fa382f9e Stavros Sachtouris
Once a user has retrieved one URL/token pair per cloud, it is time to assign a
131 2bd23362 Stavros Sachtouris
name to each cloud and configure kamaki accordingly.
132 904091dd Stavros Sachtouris
133 fa382f9e Stavros Sachtouris
For example, let the user have access to two clouds with the following authentication information ::
134 904091dd Stavros Sachtouris
135 904091dd Stavros Sachtouris
    cloud alias: devel
136 904091dd Stavros Sachtouris
    authentication URL: https://devel.example.com/astakos/identity/v2.0/
137 904091dd Stavros Sachtouris
    authentication token: myd3v3170k3n==
138 904091dd Stavros Sachtouris
139 904091dd Stavros Sachtouris
    cloud alias: testing
140 904091dd Stavros Sachtouris
    autentication URL: https://testing.example.com/astakos/identity/v2.0/
141 904091dd Stavros Sachtouris
    authentication token: my73571ng70k3n==
142 904091dd Stavros Sachtouris
143 904091dd Stavros Sachtouris
.. note:: the cloud alias is arbitrary and decided by the user. It is just a
144 2bd23362 Stavros Sachtouris
    reference label for the cloud setup in the kamaki context.
145 904091dd Stavros Sachtouris
146 904091dd Stavros Sachtouris
The user should let kamaki know about these setups:
147 904091dd Stavros Sachtouris
148 904091dd Stavros Sachtouris
.. code-block:: console
149 904091dd Stavros Sachtouris
150 fa382f9e Stavros Sachtouris
    $ kamaki config set cloud.devel.url https://devel.example.com/astakos/identity/v2.0/
151 fa382f9e Stavros Sachtouris
    $ kamaki config set cloud.devel.token myd3v3170k3n==
152 904091dd Stavros Sachtouris
    $
153 fa382f9e Stavros Sachtouris
    $ kamaki config set cloud.testing.url https://testing.example.com/astakos/identity/v2.0/
154 fa382f9e Stavros Sachtouris
    $ kamaki config set cloud.testing.token my73571ng70k3n==
155 904091dd Stavros Sachtouris
    $
156 904091dd Stavros Sachtouris
157 fa382f9e Stavros Sachtouris
To check if all settings are loaded, a user may list all clouds, as shown
158 904091dd Stavros Sachtouris
bellow:
159 904091dd Stavros Sachtouris
160 904091dd Stavros Sachtouris
.. code-block:: console
161 904091dd Stavros Sachtouris
162 2bd23362 Stavros Sachtouris
    $ kamaki config get cloud
163 fa382f9e Stavros Sachtouris
     cloud.default.url = https://example.com/astakos.identity/v2.0/
164 2bd23362 Stavros Sachtouris
     cloud.default.token = myd3f4u1770k3n==
165 fa382f9e Stavros Sachtouris
     cloud.devel.url = https://devel.example.com/astakos/identity/v2.0/
166 fa382f9e Stavros Sachtouris
     cloud.devel.token = myd3v3170k3n==
167 fa382f9e Stavros Sachtouris
     cloud.testing.url = https://testing.example.com/astakos/identity/v2.0/
168 fa382f9e Stavros Sachtouris
     cloud.testing.token = my73571ng70k3n==
169 904091dd Stavros Sachtouris
    $
170 904091dd Stavros Sachtouris
171 fa382f9e Stavros Sachtouris
or query kamaki for a specific cloud:
172 904091dd Stavros Sachtouris
173 904091dd Stavros Sachtouris
.. code-block:: console
174 904091dd Stavros Sachtouris
175 fa382f9e Stavros Sachtouris
    $ kamaki config get cloud.devel
176 fa382f9e Stavros Sachtouris
     cloud.devel.url = https://devel.example.com/astakos/identity/v2.0/
177 fa382f9e Stavros Sachtouris
     cloud.devel.token = myd3v3170k3n==
178 904091dd Stavros Sachtouris
    $
179 904091dd Stavros Sachtouris
180 fa382f9e Stavros Sachtouris
Now kamaki can use any of these clouds, with the **- - cloud** attribute. If
181 fa382f9e Stavros Sachtouris
the **- - cloud** option is ommited, kamaki will query the `default` cloud.
182 904091dd Stavros Sachtouris
183 904091dd Stavros Sachtouris
One way to test this, is the `user athenticate` command:
184 904091dd Stavros Sachtouris
185 904091dd Stavros Sachtouris
.. code-block:: console
186 904091dd Stavros Sachtouris
187 904091dd Stavros Sachtouris
    $ kamaki --cloud=devel user authenticate
188 904091dd Stavros Sachtouris
     ...
189 abfaa6d9 Vangelis Koukis
     user          :
190 904091dd Stavros Sachtouris
        id         :  725d5de4-1bab-45ac-9e98-38a60a8c543c
191 904091dd Stavros Sachtouris
        name       :  Devel User
192 904091dd Stavros Sachtouris
    $
193 904091dd Stavros Sachtouris
    $ kamaki --cloud=testing user authenticate
194 904091dd Stavros Sachtouris
     ...
195 abfaa6d9 Vangelis Koukis
     user          :
196 904091dd Stavros Sachtouris
        id         :  4ed5d527-bab1-ca54-89e9-c345c8a06a83
197 904091dd Stavros Sachtouris
        name       :  Testing User
198 904091dd Stavros Sachtouris
    $
199 904091dd Stavros Sachtouris
    $ kamaki --cloud=default user authenticate
200 904091dd Stavros Sachtouris
     ...
201 abfaa6d9 Vangelis Koukis
     user          :
202 904091dd Stavros Sachtouris
        id         :  4d3f4u17-u53r-4u7h-451n-4u7h3n7ic473
203 904091dd Stavros Sachtouris
        name       :  Default User
204 904091dd Stavros Sachtouris
    $
205 904091dd Stavros Sachtouris
    $ kamaki user authenticate
206 904091dd Stavros Sachtouris
     ...
207 abfaa6d9 Vangelis Koukis
     user          :
208 904091dd Stavros Sachtouris
        id         :  4d3f4u17-u53r-4u7h-451n-4u7h3n7ic473
209 904091dd Stavros Sachtouris
        name       :  Default User
210 904091dd Stavros Sachtouris
    $
211 904091dd Stavros Sachtouris
212 2bd23362 Stavros Sachtouris
In interactive cell, the cloud can be picked when invoking the shell, with
213 904091dd Stavros Sachtouris
the **- - cloud** option.
214 904091dd Stavros Sachtouris
215 2bd23362 Stavros Sachtouris
.. code-block:: console
216 2bd23362 Stavros Sachtouris
217 2bd23362 Stavros Sachtouris
    $ kamaki --cloud=devel
218 2bd23362 Stavros Sachtouris
    kamaki v0.10 - Interactive Shell
219 2bd23362 Stavros Sachtouris
220 2bd23362 Stavros Sachtouris
    /exit       terminate kamaki
221 2bd23362 Stavros Sachtouris
    exit or ^D  exit context
222 2bd23362 Stavros Sachtouris
    ? or help   available commands
223 2bd23362 Stavros Sachtouris
    ?command    help on command
224 2bd23362 Stavros Sachtouris
    !<command>  execute OS shell command
225 2bd23362 Stavros Sachtouris
226 2bd23362 Stavros Sachtouris
    Session user is Devel User
227 2bd23362 Stavros Sachtouris
    (uuid: 725d5de4-1bab-45ac-9e98-38a60a8c543c)
228 2bd23362 Stavros Sachtouris
    [kamaki]: 
229 2bd23362 Stavros Sachtouris
230 2bd23362 Stavros Sachtouris
231 0c24b26b Stavros Sachtouris
Optional features
232 0c24b26b Stavros Sachtouris
-----------------
233 0c24b26b Stavros Sachtouris
234 fa479dc3 Stavros Sachtouris
For installing any or all of the following, consult the
235 fa479dc3 Stavros Sachtouris
`kamaki installation guide <installation.html#install-ansicolors>`_
236 961e6040 Stavros Sachtouris
237 0c24b26b Stavros Sachtouris
* ansicolors
238 fa382f9e Stavros Sachtouris
    * Add colors to command line / console output
239 fa382f9e Stavros Sachtouris
    * Can be switched on/off in kamaki configuration file: `colors = on/off`
240 4054c46d Stavros Sachtouris
    * Has not been tested on non unix / linux based platforms
241 0c24b26b Stavros Sachtouris
242 abfaa6d9 Vangelis Koukis
* mock
243 4054c46d Stavros Sachtouris
    * For kamaki contributors only
244 fa382f9e Stavros Sachtouris
    * Allow unit tests to run on kamaki.clients package
245 4054c46d Stavros Sachtouris
    * Needs mock version 1.X or better
246 0c24b26b Stavros Sachtouris
247 fa382f9e Stavros Sachtouris
Any of the above features can be installed at any time before or after kamaki
248 fa382f9e Stavros Sachtouris
installation.
249 0c24b26b Stavros Sachtouris
250 0c24b26b Stavros Sachtouris
Configuration options
251 0c24b26b Stavros Sachtouris
---------------------
252 0c24b26b Stavros Sachtouris
253 904091dd Stavros Sachtouris
There are two kinds of configuration options:
254 0c24b26b Stavros Sachtouris
255 904091dd Stavros Sachtouris
* kamaki-related (global)
256 abfaa6d9 Vangelis Koukis
    interface settings and constants of the kamaki internal mechanism, e.g.,
257 2bd23362 Stavros Sachtouris
    terminal colors, maximum threads per connection, custom logging, history
258 2bd23362 Stavros Sachtouris
    file path, etc.
259 0c24b26b Stavros Sachtouris
260 fa382f9e Stavros Sachtouris
* cloud-related
261 fa382f9e Stavros Sachtouris
    information needed to connect and use one or more clouds. There are some
262 abfaa6d9 Vangelis Koukis
    mandatory options (URL, token) and some advanced / optional (e.g.,
263 fa382f9e Stavros Sachtouris
    service-specific URL overrides or versions)
264 0c24b26b Stavros Sachtouris
265 904091dd Stavros Sachtouris
Kamaki comes with preset default values to all kamaki-releated configuration
266 904091dd Stavros Sachtouris
options. Cloud-related information is not included in presets and should be
267 fa382f9e Stavros Sachtouris
provided by the user. Kamaki-related options can also be modified.
268 0c24b26b Stavros Sachtouris
269 904091dd Stavros Sachtouris
There are two ways of managing configuration options: edit the config file or
270 904091dd Stavros Sachtouris
use the kamaki config command.
271 904091dd Stavros Sachtouris
272 904091dd Stavros Sachtouris
Using multiple configuration files
273 904091dd Stavros Sachtouris
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
274 904091dd Stavros Sachtouris
275 904091dd Stavros Sachtouris
Kamaki setups are stored in configuration files. By default, a Kamaki
276 904091dd Stavros Sachtouris
installation stores options in *.kamakirc* file located at the user home
277 904091dd Stavros Sachtouris
directory.
278 904091dd Stavros Sachtouris
279 904091dd Stavros Sachtouris
If a user needs to switch between different kamaki-related setups, Kamaki can
280 fa382f9e Stavros Sachtouris
explicitly load configuration files with the **- - config** (or **- c**) option
281 0c24b26b Stavros Sachtouris
282 03d661d8 Stavros Sachtouris
.. code-block:: console
283 03d661d8 Stavros Sachtouris
284 03d661d8 Stavros Sachtouris
    $ kamaki --config <custom_config_file_path> [other options]
285 0c24b26b Stavros Sachtouris
286 fa382f9e Stavros Sachtouris
.. note:: For accessing multiple clouds, users do NOT need to create multiple
287 fa382f9e Stavros Sachtouris
    configuration files. Instead, we suggest using a single configuration file
288 fa382f9e Stavros Sachtouris
    with multiple cloud setups. More details can be found at the
289 fa382f9e Stavros Sachtouris
    `multiple clouds guide <#multiple-clouds>`_.
290 0c24b26b Stavros Sachtouris
291 0c24b26b Stavros Sachtouris
Modifying options at runtime
292 0c24b26b Stavros Sachtouris
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
293 0c24b26b Stavros Sachtouris
294 2bd23362 Stavros Sachtouris
All kamaki commands can be used with the -o option in order to override configuration options at runtime. For example:
295 0c24b26b Stavros Sachtouris
296 03d661d8 Stavros Sachtouris
.. code-block:: console
297 03d661d8 Stavros Sachtouris
298 904091dd Stavros Sachtouris
    $ kamaki file list -o global.pithos_container=anothercontainer
299 0c24b26b Stavros Sachtouris
300 904091dd Stavros Sachtouris
will invoke *kamaki file list* with the specified options, but the initial
301 904091dd Stavros Sachtouris
global.pithos_container values will not be modified.
302 7ae842c2 Stavros Sachtouris
303 2bd23362 Stavros Sachtouris
304 0c24b26b Stavros Sachtouris
Editing options
305 0c24b26b Stavros Sachtouris
^^^^^^^^^^^^^^^
306 0c24b26b Stavros Sachtouris
307 0c24b26b Stavros Sachtouris
Kamaki config command allows users to see and manage all configuration options.
308 0c24b26b Stavros Sachtouris
309 0c24b26b Stavros Sachtouris
* kamaki config list
310 2bd23362 Stavros Sachtouris
    lists all configuration options of a kamaki setup
311 0c24b26b Stavros Sachtouris
312 0c24b26b Stavros Sachtouris
* kamaki config get <group.option>
313 904091dd Stavros Sachtouris
    show the value of a specific configuration option. Options must be of the
314 2bd23362 Stavros Sachtouris
    form *group.option*. A single *option* is equivalent to *global.option*,
315 2bd23362 Stavros Sachtouris
    with the exception of the term *cloud* (see bellow)
316 0c24b26b Stavros Sachtouris
317 0c24b26b Stavros Sachtouris
* kamaki config set <group.option> <value>
318 2bd23362 Stavros Sachtouris
    set the group.option to value. If no group is given, it defaults to
319 fa382f9e Stavros Sachtouris
    *global*.
320 0c24b26b Stavros Sachtouris
321 329753ae Stavros Sachtouris
* kamaki config delete <group.option>
322 2bd23362 Stavros Sachtouris
    delete a configuration option. If no group is given, it defaults to
323 904091dd Stavros Sachtouris
    *global*
324 0c24b26b Stavros Sachtouris
325 0c24b26b Stavros Sachtouris
The above commands cause option values to be permanently stored in the Kamaki configuration file.
326 0c24b26b Stavros Sachtouris
327 fa382f9e Stavros Sachtouris
The commands above can also be used for **clouds** handling, using the `cloud.`
328 fa382f9e Stavros Sachtouris
prefix. The cloud handling cases are similar but with slightly different
329 fa382f9e Stavros Sachtouris
semantics:
330 fa382f9e Stavros Sachtouris
331 fa382f9e Stavros Sachtouris
* kamaki config get cloud[.<cloud alias>[.option]]
332 abfaa6d9 Vangelis Koukis
    * cloud
333 fa382f9e Stavros Sachtouris
        list all clouds and their settings
334 fa382f9e Stavros Sachtouris
    * cloud.<cloud alias>
335 fa382f9e Stavros Sachtouris
        list settings of the cloud aliased as <cloud alias>. If no
336 fa382f9e Stavros Sachtouris
        special is configured, use the term `cloud.default`
337 fa382f9e Stavros Sachtouris
    * cloud.<cloud alias>.<option>
338 904091dd Stavros Sachtouris
        show the value of the specified option. If no special alias is
339 fa382f9e Stavros Sachtouris
        configured, use `cloud.default.<option>`
340 904091dd Stavros Sachtouris
341 fa382f9e Stavros Sachtouris
* kamaki config set cloud.<cloud alias>.<option> <value>
342 fa382f9e Stavros Sachtouris
    If the cloud alias <cloud alias> does not exist, create it. Then, create
343 fa382f9e Stavros Sachtouris
    (or update) the option <option> of this cloud, by setting its value
344 904091dd Stavros Sachtouris
    to <value>.
345 904091dd Stavros Sachtouris
346 fa382f9e Stavros Sachtouris
* kamaki config delete cloud.<cloud alias>[.<option>]
347 fa382f9e Stavros Sachtouris
    * cloud.<cloud alias>
348 904091dd Stavros Sachtouris
        delete the cloud alias <cloud alias> and all its options
349 fa382f9e Stavros Sachtouris
    * cloud.<cloud alias>.<option>
350 fa382f9e Stavros Sachtouris
        delete the <option> and its value from the cloud cloud aliased as
351 904091dd Stavros Sachtouris
        <cloud alias>
352 904091dd Stavros Sachtouris
353 2bd23362 Stavros Sachtouris
To see if a default cloud is configured, get the default_cloud value
354 fa382f9e Stavros Sachtouris
355 fa382f9e Stavros Sachtouris
    .. code-block:: console
356 fa382f9e Stavros Sachtouris
357 fa382f9e Stavros Sachtouris
        $ kamaki config get default_cloud
358 fa382f9e Stavros Sachtouris
359 2bd23362 Stavros Sachtouris
If no default_cloud value is set, the first cloud alias is picked as default.
360 2bd23362 Stavros Sachtouris
To pick a cloud alias as default:
361 2bd23362 Stavros Sachtouris
362 2bd23362 Stavros Sachtouris
    .. code-block:: console
363 2bd23362 Stavros Sachtouris
364 2bd23362 Stavros Sachtouris
        $ kamaki config set default_cloud <cloud alias>
365 2bd23362 Stavros Sachtouris
366 2bd23362 Stavros Sachtouris
367 0c24b26b Stavros Sachtouris
Editing the configuration file
368 0c24b26b Stavros Sachtouris
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
369 0c24b26b Stavros Sachtouris
370 329753ae Stavros Sachtouris
The configuration file is a simple text file that can be created by the user.
371 0c24b26b Stavros Sachtouris
372 2bd23362 Stavros Sachtouris
.. note:: users of kamaki < 0.9 can use the latest versions to automatically
373 2bd23362 Stavros Sachtouris
    convert their old configuration files to the new configuration file(s).
374 2bd23362 Stavros Sachtouris
    See `these instructions <#migrating-from-kamaki-0-8-x-to-0-9-or-better>`_
375 2bd23362 Stavros Sachtouris
    for more.
376 abfaa6d9 Vangelis Koukis
377 904091dd Stavros Sachtouris
A simple way to create the configuration file is to set a configuration option
378 904091dd Stavros Sachtouris
using the kamaki config command. For example:
379 03d661d8 Stavros Sachtouris
380 03d661d8 Stavros Sachtouris
.. code-block:: console
381 0c24b26b Stavros Sachtouris
382 904091dd Stavros Sachtouris
    $ kamaki config set global.log_file /home/exampleuser/logs/kamaki.log
383 0c24b26b Stavros Sachtouris
384 904091dd Stavros Sachtouris
In the above example, if the kamaki configuration file does not exist, it will
385 904091dd Stavros Sachtouris
be created with all the default values plus the *global.log_file* option set to
386 904091dd Stavros Sachtouris
`/home/exampleuser/logs/kamaki.log`
387 0c24b26b Stavros Sachtouris
388 7536c9bf Stavros Sachtouris
The configuration file is formatted so that it can be parsed by the python ConfigParser module. It consists of command sections that are denoted with brackets. Every section contains variables with values. For example::
389 0c24b26b Stavros Sachtouris
390 904091dd Stavros Sachtouris
    [global]
391 904091dd Stavros Sachtouris
    log_file = /home/exampleuser/logs/kamaki.log
392 904091dd Stavros Sachtouris
    max_threads = 7
393 904091dd Stavros Sachtouris
    colors = off
394 904091dd Stavros Sachtouris
395 fa382f9e Stavros Sachtouris
    [cloud "default"]
396 904091dd Stavros Sachtouris
    url =
397 904091dd Stavros Sachtouris
    token =
398 904091dd Stavros Sachtouris
399 2bd23362 Stavros Sachtouris
In this scenario, a bunch of configuration options are created and set to their
400 2bd23362 Stavros Sachtouris
default options, except the log_file option which is set to whatever the
401 2bd23362 Stavros Sachtouris
specified value.
402 904091dd Stavros Sachtouris
403 2bd23362 Stavros Sachtouris
The *[cloud "default"]* section is special and is used to configure the default
404 2bd23362 Stavros Sachtouris
cloud. Kamaki will not be able to do anything useful without proper url and
405 2bd23362 Stavros Sachtouris
token values set in the cloud section.
406 0c24b26b Stavros Sachtouris
407 0c24b26b Stavros Sachtouris
Available options
408 0c24b26b Stavros Sachtouris
^^^^^^^^^^^^^^^^^
409 0c24b26b Stavros Sachtouris
410 2bd23362 Stavros Sachtouris
The [*global*] group is treated by kamaki as a generic group for kamaki
411 904091dd Stavros Sachtouris
settings, namely command cli specifications, the thread limit, console colors,
412 904091dd Stavros Sachtouris
history and log files, log detail options and pithos-specific options.
413 0c24b26b Stavros Sachtouris
414 0c24b26b Stavros Sachtouris
* global.colors <on|off>
415 7536c9bf Stavros Sachtouris
    enable / disable colors in command line based uis. Requires ansicolors, otherwise it is ignored
416 0c24b26b Stavros Sachtouris
417 31a30991 Stavros Sachtouris
* global.log_file <logfile full path>
418 9e87e4bb Stavros Sachtouris
    set a custom location for kamaki logging. Default value is ~/.kamaki.log
419 31a30991 Stavros Sachtouris
420 31a30991 Stavros Sachtouris
* global.log_token <on|off>
421 31a30991 Stavros Sachtouris
    allow kamaki to log user tokens
422 31a30991 Stavros Sachtouris
423 31a30991 Stavros Sachtouris
* global.log_data <on|off>
424 904091dd Stavros Sachtouris
    allow kamaki to log http data (by default, it logs only method, URL and
425 904091dd Stavros Sachtouris
    headers)
426 0c24b26b Stavros Sachtouris
427 2bd23362 Stavros Sachtouris
* global.log_pid <on|off>
428 2bd23362 Stavros Sachtouris
    attach the process name and id that produces each log line. Useful for
429 2bd23362 Stavros Sachtouris
    resolving race condition problems.
430 2bd23362 Stavros Sachtouris
431 904091dd Stavros Sachtouris
* global.file_cli <UI command specifications for file>
432 904091dd Stavros Sachtouris
    a special package that is used to load storage commands to kamaki UIs.
433 904091dd Stavros Sachtouris
    Don't touch this unless if you know what you are doing.
434 0c24b26b Stavros Sachtouris
435 904091dd Stavros Sachtouris
* global.cyclades_cli <UI command specifications for cyclades>
436 904091dd Stavros Sachtouris
    a special package that is used to load cyclades commands to kamaki UIs.
437 904091dd Stavros Sachtouris
    Don't touch this unless you know what you are doing.
438 f5d9bc54 Stavros Sachtouris
439 904091dd Stavros Sachtouris
* global.flavor_cli <UI command specifications for VM flavors>
440 904091dd Stavros Sachtouris
    a special package that is used to load cyclades VM flavor commands to
441 904091dd Stavros Sachtouris
    kamaki UIs. Don't touch this unless you know what you are doing.
442 0c24b26b Stavros Sachtouris
443 904091dd Stavros Sachtouris
* global.network_cli <UI command specifications for virtual networks>
444 904091dd Stavros Sachtouris
    a special package that is used to load cyclades virtual network commands to
445 904091dd Stavros Sachtouris
    kamaki UIs. Don't touch this unless you know what you are doing.
446 0c24b26b Stavros Sachtouris
447 904091dd Stavros Sachtouris
* global.image_cli <UI command specs for Plankton or Compute image service>
448 0c24b26b Stavros Sachtouris
    a special package that is used to load image-related commands to kamaki UIs. Don't touch this unless you know what you are doing.
449 0c24b26b Stavros Sachtouris
450 904091dd Stavros Sachtouris
* global.user_cli <UI command specs for Astakos authentication service>
451 904091dd Stavros Sachtouris
    a special package that is used to load astakos-related commands to kamaki
452 904091dd Stavros Sachtouris
    UIs. Don't touch this unless you know what you are doing.
453 329753ae Stavros Sachtouris
454 904091dd Stavros Sachtouris
* global.history_file <history file path>
455 904091dd Stavros Sachtouris
    the path of a simple file for inter-session kamaki history. Make sure
456 904091dd Stavros Sachtouris
    kamaki is executed in a context where this file is accessible for reading
457 904091dd Stavros Sachtouris
    and writing. Kamaki automatically creates the file if it doesn't exist
458 a6370d73 Stavros Sachtouris
459 c5b9380c Stavros Sachtouris
Additional features
460 c5b9380c Stavros Sachtouris
^^^^^^^^^^^^^^^^^^^
461 c5b9380c Stavros Sachtouris
462 2bd23362 Stavros Sachtouris
Functional tests
463 2bd23362 Stavros Sachtouris
""""""""""""""""
464 329753ae Stavros Sachtouris
465 2bd23362 Stavros Sachtouris
Kamaki contains a set of functional tests for *kamaki.clients*, called
466 2bd23362 Stavros Sachtouris
"livetest". The term "live" means that the tests are performed against an
467 2bd23362 Stavros Sachtouris
on-line functional cloud deployment. The package is accessible as
468 2bd23362 Stavros Sachtouris
*kamaki.clients.livetest* .
469 329753ae Stavros Sachtouris
470 2bd23362 Stavros Sachtouris
The livetest commands can be activated by setting the following option in the
471 2bd23362 Stavros Sachtouris
configuration file::
472 f5d9bc54 Stavros Sachtouris
473 904091dd Stavros Sachtouris
    [global]
474 904091dd Stavros Sachtouris
    livetest_cli=livetest
475 904091dd Stavros Sachtouris
476 904091dd Stavros Sachtouris
or with this kamaki command::
477 f5f2dc53 Stavros Sachtouris
478 2bd23362 Stavros Sachtouris
    $ kamaki config set livetest_cli livetest
479 f5f2dc53 Stavros Sachtouris
480 2bd23362 Stavros Sachtouris
In most cases, it is enough to have the default cloud configured correctly.
481 2bd23362 Stavros Sachtouris
Some commands, though, require some extra settings specific to actual contents
482 2bd23362 Stavros Sachtouris
of the cloud or the example files used in kamaki.
483 f5f2dc53 Stavros Sachtouris
484 904091dd Stavros Sachtouris
Here is a list of settings needed:
485 f5f2dc53 Stavros Sachtouris
486 904091dd Stavros Sachtouris
* for all tests::
487 fa382f9e Stavros Sachtouris
    * livetest.testcloud = <the cloud alias this test will run against>
488 f5f2dc53 Stavros Sachtouris
489 904091dd Stavros Sachtouris
* for astakos client::
490 904091dd Stavros Sachtouris
    * livetest.astakos_details = <A file with an authentication output>
491 904091dd Stavros Sachtouris
        To create this file, pipeline the output of an authentication command
492 2bd23362 Stavros Sachtouris
        with the -j option for raw json output
493 f5f2dc53 Stavros Sachtouris
494 904091dd Stavros Sachtouris
        .. code-block:: console
495 f5f2dc53 Stavros Sachtouris
496 904091dd Stavros Sachtouris
            $ kamaki user authenticate -j > astakos.details
497 f5f2dc53 Stavros Sachtouris
498 2bd23362 Stavros Sachtouris
    * livetest.astakos_name = <The exact "real" name of the testing user>
499 904091dd Stavros Sachtouris
    * livetest.astakos_id = <The valid unique user id of the testing user>
500 f5f2dc53 Stavros Sachtouris
501 904091dd Stavros Sachtouris
* for image client:
502 2bd23362 Stavros Sachtouris
    * livetest.image_details = <A file with the image metadata>
503 904091dd Stavros Sachtouris
        To create this file, pipeline the output of an image metadata command
504 2bd23362 Stavros Sachtouris
        with the -j option for raw json output
505 f5f2dc53 Stavros Sachtouris
506 904091dd Stavros Sachtouris
        .. code-block:: console
507 f5f2dc53 Stavros Sachtouris
508 82cc4b8f Stavros Sachtouris
            $ kamaki image info <img id> -j > img.details
509 f5f2dc53 Stavros Sachtouris
510 904091dd Stavros Sachtouris
    * livetest.image_id = <A valid image id used for testing>
511 904091dd Stavros Sachtouris
    * livetest.image_local_path = <The local path of the testing image>
512 f5f2dc53 Stavros Sachtouris
513 904091dd Stavros Sachtouris
* for flavors (part of the compute client):
514 904091dd Stavros Sachtouris
    * livetest.flavor_details = <A file with the flavor details>
515 904091dd Stavros Sachtouris
        To create this file, pipeline the output of a flavor info command
516 2bd23362 Stavros Sachtouris
        with the -j option for raw json output
517 f5f2dc53 Stavros Sachtouris
518 904091dd Stavros Sachtouris
        .. code-block:: console
519 f5f2dc53 Stavros Sachtouris
520 904091dd Stavros Sachtouris
            $ kamaki flavor info <flavor id> -j > flavor.details
521 f5f2dc53 Stavros Sachtouris
522 f5f2dc53 Stavros Sachtouris
523 f5f2dc53 Stavros Sachtouris
After setup, kamaki can run all tests::
524 f5f2dc53 Stavros Sachtouris
525 f5f2dc53 Stavros Sachtouris
    $ kamaki livetest all
526 f5f2dc53 Stavros Sachtouris
527 2bd23362 Stavros Sachtouris
a specific test (e.g., pithos scenario)::
528 2bd23362 Stavros Sachtouris
529 2bd23362 Stavros Sachtouris
    $ kamaki livetest pithos
530 f5f2dc53 Stavros Sachtouris
531 2bd23362 Stavros Sachtouris
or a specific method from a service (e.g., create_server @ cyclades)::
532 f5f2dc53 Stavros Sachtouris
533 2bd23362 Stavros Sachtouris
    $ kamaki livetest cyclades create_server
534 f5f2dc53 Stavros Sachtouris
535 f5f2dc53 Stavros Sachtouris
536 4054c46d Stavros Sachtouris
The unit testing system
537 4054c46d Stavros Sachtouris
"""""""""""""""""""""""
538 4054c46d Stavros Sachtouris
539 904091dd Stavros Sachtouris
Kamaki container a set of finegrained unit tests for the kamaki.clients
540 904091dd Stavros Sachtouris
package. This set is not used when kamaki is running. Instead, it is aimed to
541 2bd23362 Stavros Sachtouris
developers who debug or extent kamaki. For more information, check the
542 904091dd Stavros Sachtouris
`Going Agile <developers/extending-clients-api.html#going-agile>`_ entry at the
543 904091dd Stavros Sachtouris
`developers section <developers/extending-clients-api.html>`_.