Revision fa382f9e docs/setup.rst

b/docs/setup.rst
11 11
Existing kamaki users should consult the
12 12
`migration guide <#migrating-from-kamaki-0-8-x-to-0-9>`_ first.
13 13

  
14
Kamaki has to be configured to use a specific Synnefo deployment url and a user
15
token.
14
Kamaki has to be configured for a specific Synnefo deployment, with an
15
authentication url and user token pair. Users should also pick an alias to name
16
the cloud configuration. This can be any single word, e.g. "default", "mycloud"
17
or whatever suits kamaki users.
16 18

  
17 19
.. code-block:: console
18 20
    
19
    $ kamaki config set remote.default.url <cloud-authentication-URL>
20
    $ kamaki config set remote.default.token myt0k3n==
21
    $ kamaki config set cloud.<cloud alias>.url <cloud-authentication-URL>
22
    $ kamaki config set cloud.<cloud alias>.token myt0k3n==
21 23

  
22
Since Synnefo version 0.14, a synnefo cloud remote UI offers a single
23
authentication URL, which can to be set as the default URL for kamaki. All
24
service-specific URLs are now retrieved and handled automatically. Users of
25
synnefo clouds >= 0.14 are advised against using any service-specific URLs.
24
If only one cloud is configured, kamaki automatically picks it as the default.
25
Otherwise, a default cloud should be specified:
26

  
27
.. code-block:: console
28

  
29
    $ kamaki config set default_cloud <cloud alias>
30

  
31
Since Synnefo version 0.14, a synnefo cloud UI offers a single authentication
32
URL, which should be set as the cloud URL for kamaki. All service-specific URLs
33
are retrieved and handled automatically by kamaki, through this URL. Users of
34
synnefo clouds >=0.14 are advised against using any service-specific URLs.
26 35

  
27 36
Migrating from kamaki 0.8.X to 0.9
28 37
----------------------------------
29 38

  
30
This section refers to running installations of kamaki version <= 0.8.X
31
To check the current kamaki version:
39
This section refers to running installations of kamaki version <= 0.8.X To
40
check the current kamaki version:
32 41

  
33 42
.. code-block:: console
34 43

  
35 44
    $ kamaki -V
36 45

  
37
Existing kamaki users should convert their configuration files to v3. To do
38
that, kamaki 0.9 inspects the configuration file and suggests a list of config
39
file transformations, which are performed automatically on user permission.
40
This mechanism is invoked when the first API-related kamaki command is fired.
41
We suggest the `user authenticate` command, as shown on example 2.1.
46
Existing kamaki users should convert their configuration files to v9. To do
47
that, kamaki 0.9 can inspect the configuration file and suggests a list of
48
config file transformations, which are performed automatically (after users'
49
permission). This mechanism is invoked when an API-related kamaki command is
50
fired. On example 2.1 we suggest using the `user authenticate` command to fire
51
the kamaki config file conversion mechanism.
42 52

  
43 53
.. code-block:: console
44 54
    :emphasize-lines: 1
......
46 56
    Example 2.1: Convert config file while authenticating user "exampleuser"
47 57

  
48 58
    $ kamaki user authenticate
49
    Config file format version >= 3.0 is required
50
    Configuration file "/home/exampleuser/.kamakirc" format is not up to date
59
    Config file format version >= 9.0 is required
60
    Configuration file: "/home/exampleuser/.kamakirc"
51 61
    but kamaki can fix this:
52 62
    Calculating changes while preserving information
53
    ... rescue global.token => remote.default.token
63
    ... rescue global.token => cloud.default.token
54 64
    ... rescue config.cli => global.config_cli
55 65
    ... rescue history.file => global.history_file
56 66
    ... DONE
......
63 73
        file.url = https://pithos.okeanos.grnet.gr/v1
64 74
        image.url = https://cyclades.okeanos.grnet.gr/plankton
65 75

  
66
    Kamaki is ready to convert the config file to version 3.0
76
    Kamaki is ready to convert the config file to version 9.0
67 77
    Overwrite file /home/exampleuser/.kamakirc ? [Y, y]
68 78

  
69 79
At this point, we should examine the kamaki output. Most options are renamed to
......
78 88
    meaningless and therefore omitted.
79 89

  
80 90
* `global.data_log` option has never been a valid kamaki config option.
81
    In this example, the user accidentally misspelled the terms `log_data`
91
    In this example, the user accidentally misspelled the term `log_data`
82 92
    (which is a valid kamaki config option) as `data_log`. To fix this, the
83 93
    user should set the correct option after the conversion is complete
84 94
    (Example 2.2).
......
105 115

  
106 116
    $ kamaki -c .myfilerc user authenticate
107 117

  
108
Multiple cloud remotes
109
----------------------
118
Multiple clouds
119
---------------
110 120

  
111 121
The following refers to users of multiple Synnefo and/or Open Stack
112 122
deployments. In the following, a Synnefo or Open Stack cloud deployment will
113
frequently be called as a **remote** or a **cloud remote**.
123
frequently be called as a **cloud**.
114 124

  
115
Kamaki supports accessing multiple cloud remotes from the same kamaki setup.
116
Bofore kamaki 0.9, this was possible only by using multiple config files. Since
117
0.9, kamaki supports multiple cloud remotes in the same configuration.
125
Kamaki supports accessing multiple clouds from the same kamaki setup. Before
126
kamaki 0.9, this was possible only by using multiple config files. Since 0.9,
127
kamaki supports multiple clouds in the same configuration.
118 128

  
119
Each cloud remote corresponds to a Synnefo (or Open Stack) cloud deployment.
129
Each cloud corresponds to a Synnefo (or Open Stack) cloud deployment.
120 130
Since Synnefo version 0.14, each deployment offers a single point of
121 131
authentication, as an **authentication URL** and **token** pair. Users can
122 132
retrieve this information through the cloud UI.
123 133

  
124
Once a user has retrieved one URL/token pair per cloud remote, it is time to
125
assign a name to each cloud and let kamaki know about them.
134
Once a user has retrieved one URL/token pair per cloud, it is time to assign a
135
name to each cloud and let kamaki know about them.
126 136

  
127
For example, let the user have access to two remote clouds with the following authentication information ::
137
For example, let the user have access to two clouds with the following authentication information ::
128 138

  
129 139
    cloud alias: devel
130 140
    authentication URL: https://devel.example.com/astakos/identity/v2.0/
......
141 151

  
142 152
.. code-block:: console
143 153

  
144
    $ kamaki config set remote.devel.url https://devel.example.com/astakos/identity/v2.0/
145
    $ kamaki config set remote.devel.token myd3v3170k3n==
154
    $ kamaki config set cloud.devel.url https://devel.example.com/astakos/identity/v2.0/
155
    $ kamaki config set cloud.devel.token myd3v3170k3n==
146 156
    $
147
    $ kamaki config set remote.testing.url https://testing.example.com/astakos/identity/v2.0/
148
    $ kamaki config set remote.testing.token my73571ng70k3n==
157
    $ kamaki config set cloud.testing.url https://testing.example.com/astakos/identity/v2.0/
158
    $ kamaki config set cloud.testing.token my73571ng70k3n==
149 159
    $
150 160

  
151
To check if all settings are loaded, a user may list all remotes, as shown
161
To check if all settings are loaded, a user may list all clouds, as shown
152 162
bellow:
153 163

  
154 164
.. code-block:: console
155 165

  
156
    $ kamaki config get remote
157
     remote.default.url = https://example.com/astakos.identity/v2.0/
158
     remote.default.url = myd3f4u1770k3n==
159
     remote.devel.url = https://devel.example.com/astakos/identity/v2.0/
160
     remote.devel.token = myd3v3170k3n==
161
     remote.testing.url = https://testing.example.com/astakos/identity/v2.0/
162
     remote.testing.token = my73571ng70k3n==
166
    $ kamaki config getcloud 
167
     cloud.default.url = https://example.com/astakos.identity/v2.0/
168
     cloud.default.url = myd3f4u1770k3n==
169
     cloud.devel.url = https://devel.example.com/astakos/identity/v2.0/
170
     cloud.devel.token = myd3v3170k3n==
171
     cloud.testing.url = https://testing.example.com/astakos/identity/v2.0/
172
     cloud.testing.token = my73571ng70k3n==
163 173
    $
164 174

  
165
or query kamaki for a specific cloud remote:
175
or query kamaki for a specific cloud:
166 176

  
167 177
.. code-block:: console
168 178

  
169
    $ kamaki config get remote.devel
170
     remote.devel.url = https://devel.example.com/astakos/identity/v2.0/
171
     remote.devel.token = myd3v3170k3n==
179
    $ kamaki config get cloud.devel
180
     cloud.devel.url = https://devel.example.com/astakos/identity/v2.0/
181
     cloud.devel.token = myd3v3170k3n==
172 182
    $
173 183

  
174
Now kamaki can use any of there remotes, with the **- - cloud** attribute. If
175
the **- - cloud** option is ommited, kamaki will query the `default` cloud remote.
184
Now kamaki can use any of these clouds, with the **- - cloud** attribute. If
185
the **- - cloud** option is ommited, kamaki will query the `default` cloud.
176 186

  
177 187
One way to test this, is the `user athenticate` command:
178 188

  
......
203 213
        name       :  Default User
204 214
    $
205 215

  
206
In interactive cell, the cloud remote is picked when invoking the shell, with
216
In interactive cell, the cloud is picked when invoking the shell, with
207 217
the **- - cloud** option.
208 218

  
209 219
Optional features
......
213 223
`kamaki installation guide <installation.html#install-ansicolors>`_
214 224

  
215 225
* ansicolors
216
    * Make command line / console user interface responses prettier with text formating (colors, bold, etc.)
217
    * Can be switched on/off in kamaki configuration file: colors=on/off
226
    * Add colors to command line / console output
227
    * Can be switched on/off in kamaki configuration file: `colors = on/off`
218 228
    * Has not been tested on non unix / linux based platforms
219 229

  
220 230
* mock 
221 231
    * For kamaki contributors only
222
    * Allow unittests to run on kamaki.clients package
232
    * Allow unit tests to run on kamaki.clients package
223 233
    * Needs mock version 1.X or better
224 234

  
225 235
* astakosclient
226 236
    * For advanced users mostly
227 237
    * Allows the use of a full astakos command line client
228 238

  
229
Any of the above features can be installed at any time before or after kamaki installation.
239
Any of the above features can be installed at any time before or after kamaki
240
installation.
230 241

  
231 242
Configuration options
232 243
---------------------
......
238 249
    colors in the output, maximum threads per connection, custom logging or
239 250
    history files, etc.
240 251

  
241
* cloud-related (remote.XXX)
242
    information needed to connect and use one or more remote clouds. There are
243
    some mandatory options (url, token) and some advanced / optional (e.g.
244
    service-specific url overrides or versions)
252
* cloud-related
253
    information needed to connect and use one or more clouds. There are some
254
    mandatory options (URL, token) and some advanced / optional (e.g.
255
    service-specific URL overrides or versions)
245 256

  
246 257
Kamaki comes with preset default values to all kamaki-releated configuration
247 258
options. Cloud-related information is not included in presets and should be
248
provided. Kamaki-related options can also be modified.
259
provided by the user. Kamaki-related options can also be modified.
249 260

  
250 261
There are two ways of managing configuration options: edit the config file or
251 262
use the kamaki config command.
......
257 268
installation stores options in *.kamakirc* file located at the user home
258 269
directory.
259 270

  
260

  
261 271
If a user needs to switch between different kamaki-related setups, Kamaki can
262
explicitly load configuration files with the **- - config** (or **- c**)
263
option:
272
explicitly load configuration files with the **- - config** (or **- c**) option
264 273

  
265 274
.. code-block:: console
266 275

  
267 276
    $ kamaki --config <custom_config_file_path> [other options]
268 277

  
269
.. note:: For access to multiple cloud remotes, users do NOT need to create
270
    multiple configuration files. Instead, we suggest using a single
271
    configuration file with multiple remote setups. More details can be found
272
    at the `multiple remotes guide <#multiple-cloud-remotes>`_.
278
.. note:: For accessing multiple clouds, users do NOT need to create multiple
279
    configuration files. Instead, we suggest using a single configuration file
280
    with multiple cloud setups. More details can be found at the
281
    `multiple clouds guide <#multiple-clouds>`_.
273 282

  
274 283
Modifying options at runtime
275 284
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
......
297 306

  
298 307
* kamaki config set <group.option> <value>
299 308
    set the group.option to value. If no group is given, the defaults to
300
    *global*
309
    *global*.
301 310

  
302 311
* kamaki config delete <group.option>
303 312
    delete a configuration option. If no group is given, the defaults to
......
305 314

  
306 315
The above commands cause option values to be permanently stored in the Kamaki configuration file.
307 316

  
308
The commands above can also be used for **cloud remotes** handling, using the
309
`remote.` prefix. The remote handling cases are similar but with slightly
310
different semantics:
311

  
312
* kamaki config get remote[.<cloud alias>[.option]]
313
    * remote
314
        list all cloud remotes (including `default`) and their settings
315
    * remote.<cloud alias>
316
        list settings of the cloud remote aliased as <cloud alias>. If no
317
        special is configured, use the term `remote.default`
318
    * remote.<cloud alias>.<option>
317
The commands above can also be used for **clouds** handling, using the `cloud.`
318
prefix. The cloud handling cases are similar but with slightly different
319
semantics:
320

  
321
* kamaki config get cloud[.<cloud alias>[.option]]
322
    * cloud 
323
        list all clouds and their settings
324
    * cloud.<cloud alias>
325
        list settings of the cloud aliased as <cloud alias>. If no
326
        special is configured, use the term `cloud.default`
327
    * cloud.<cloud alias>.<option>
319 328
        show the value of the specified option. If no special alias is
320
        configured, use `remote.default.<option>`
329
        configured, use `cloud.default.<option>`
321 330

  
322
* kamaki config set remote.<cloud alias>.<option> <value>
323
    If the remote alias <cloud alias> does not exist, create it. Then, create
324
    (or update) the option <option> of this cloud remote, by setting its value
331
* kamaki config set cloud.<cloud alias>.<option> <value>
332
    If the cloud alias <cloud alias> does not exist, create it. Then, create
333
    (or update) the option <option> of this cloud, by setting its value
325 334
    to <value>.
326 335

  
327
* kamaki config delete remote.<cloud alias>[.<option>]
328
    * remote.<cloud alias>
336
* kamaki config delete cloud.<cloud alias>[.<option>]
337
    * cloud.<cloud alias>
329 338
        delete the cloud alias <cloud alias> and all its options
330
    * remote.<cloud alias>.<option>
331
        delete the <option> and its value from the cloud remote aliased as
339
    * cloud.<cloud alias>.<option>
340
        delete the <option> and its value from the cloud cloud aliased as
332 341
        <cloud alias>
333 342

  
343
.. note:: To see if a default cloud is configured, get the default_cloud value
344

  
345
    .. code-block:: console
346

  
347
        $ kamaki config get default_cloud
348

  
334 349
Editing the configuration file
335 350
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
336 351

  
......
358 373
    max_threads = 7
359 374
    colors = off
360 375

  
361
    [remote "default"]
376
    [cloud "default"]
362 377
    url =
363 378
    token =
364 379

  
365 380
A bunch of configuration options are created and set to their default options,
366 381
except the log_file option which is set to whatever the specified value.
367 382

  
368
The [remote "default"] section is special and is used to configure the default
369
cloud remote. Kamaki will not be able to run without setting the url and token
383
The [cloud "default"] section is special and is used to configure the default
384
cloud cloud. Kamaki will not be able to run without setting the url and token
370 385
values to that section.
371 386

  
372
More cloud remotes can be created  on the side of the default remote, e.g
373
using the examples at the `multiple remotes guide <#multiple-cloud-remotes>`_::
387
More clouds can be created  on the side of the default cloud, e.g using the
388
examples at the `multiple clouds guide <#multiple-clouds>`_ ::
374 389

  
375
    [remote "devel"]
390
    [cloud "devel"]
376 391
    url = https://devel.example.com/astakos/identity/v2.0/
377 392
    token = myd3v3170k3n==
378 393

  
379
    [remote "testing"]
394
    [cloud "testing"]
380 395
    url = https://testing.example.com/astakos/identity/v2.0/
381 396
    token = my73571ng70k3n==
382 397

  
......
449 464

  
450 465
    kamaki config set livetest_cli livetest
451 466

  
452
In most tests, livetest will run as long as the default remote is configured
467
In most tests, livetest will run as long as the default cloud is configured
453 468
correctly. Some commands, though, need some extra settings related to the cloud
454 469
the test is performed against, or the example files used in kamaki.
455 470

  
456 471
Here is a list of settings needed:
457 472

  
458 473
* for all tests::
459
    * livetest.testremote = <the cloud alias this test will run against>
474
    * livetest.testcloud = <the cloud alias this test will run against>
460 475

  
461 476
* for astakos client::
462 477
    * livetest.astakos_details = <A file with an authentication output>

Also available in: Unified diff