Statistics
| Branch: | Tag: | Revision:

root / docs / setup.rst @ f5f2dc53

History | View | Annotate | Download (10.8 kB)

1
Setup
2
=====
3

    
4
Kamaki is easy to install from source or as a package. Some ui features are optional and can be install separately. Kamaki behavior can be configured in the kamaki config file.
5

    
6
Quick Setup
7
-----------
8

    
9
Kamaki interfaces rely on a list of configuration options. Be default, they are configured to communicate with the `Okeanos IaaS <http://okeanos.grnet.gr>`_.
10

    
11
.. note:: It is essential for users to get a configuration token (okeanos.grnet.gr users go `here <https://accounts.okeanos.grnet.gr/im/>`_) and provide it to kamaki:
12

    
13

    
14
.. code-block:: console
15
    :emphasize-lines: 1
16

    
17
    Example 1.1: Set user token to myt0k3n==
18

    
19
    $ kamaki set token myt0k3n==
20

    
21
Optional features
22
-----------------
23

    
24
For installing any all of the following, consult the `kamaki installation guide <installation.html#install-progress-and-or-ansicolors-optional>`_
25

    
26
* ansicolors
27
    * Make command line / console user interface responses prettier with text formating (colors, bold, etc.)
28
    * Can be switched on/off in kamaki configuration file: colors=on/off
29

    
30
* progress 
31
    * Attach progress bars to various kamaki commands (e.g. kamaki store upload)
32
    * If desired, progress version should be 1.0.2 or better
33

    
34
Any of the above features can be installed at any time before or after kamaki installation.
35

    
36
Configuration options
37
---------------------
38

    
39
Kamaki comes with preset default values to all configuration options. All vital configuration options are set to use the okeanos.grnet.gr cloud services. User information is not included and should be provided either through the kamaki config command or by editing the configuration file.
40

    
41
Kamaki configuration options are vital for correct Kamaki behavior. An incorrect option may render some command groups dysfunctional. There are two ways of managing configuration options: edit the config file or use the kamaki config command.
42

    
43
Using multiple setups
44
^^^^^^^^^^^^^^^^^^^^^
45

    
46
Kamaki setups are stored in configuration files. By default, a Kamaki installation stores options in *.kamakirc* file located at the user home directory.
47

    
48
If a user needs to switch between different setups, Kamaki can explicitly load configuration files with the --config option:
49

    
50
.. code-block:: console
51

    
52
    $ kamaki --config <custom_config_file_path> [other options]
53

    
54
Using many different configuration files for different cloud services is encouraged.
55

    
56
Modifying options at runtime
57
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
58

    
59
All kamaki commands can be used with the -o option in order to override configuration options at runtime. For example::
60

    
61
.. code-block:: console
62

    
63
    $ kamaki store list -o global.account=anotheraccount -o global.token=aT0k3n==
64

    
65
will invoke *kamaki store list* with the specified options, but the initial global.account and global.token values will be restored to initial values afterwards.
66

    
67
.. note:: on-the-fly calls to store require users to explicetely provide the account uuid corresponding to this token. The account is actually the uuid field at the response of the following call::
68

    
69
    $kamaki astakos authenticate aT0k3n==
70

    
71
Editing options
72
^^^^^^^^^^^^^^^
73

    
74
Kamaki config command allows users to see and manage all configuration options.
75

    
76
* kamaki config list
77
    lists all configuration options currently used by a Kamaki installation
78

    
79
* kamaki config get <group.option>
80
    show the value of a specific configuration option. Options must be of the form group.option
81

    
82
* kamaki config set <group.option> <value>
83
    set the group.option to value
84

    
85
* kamaki config delete <group.option>
86
    delete a configuration option
87

    
88
The above commands cause option values to be permanently stored in the Kamaki configuration file.
89

    
90
Editing the configuration file
91
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
92

    
93
The configuration file is a simple text file that can be created by the user.
94

    
95
A simple way to create the configuration file is to set a configuration option using the kamaki config command. For example:
96

    
97
.. code-block:: console
98

    
99
    $ kamaki config set token myT0k3N==
100

    
101
In the above example, if the kamaki configuration file does not exist, it will be created with all the default values plus the *global.token* option set to *myT0k3n==* value.
102

    
103
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::
104

    
105
    [store]
106
    url=https://okeanos.grnet.gr/pithos
107
    token=my0th3rT0k3n==
108

    
109
two configuration options are created: *store.url* and *store.token*. These values will be loaded at every future kamaki execution.
110

    
111
Available options
112
^^^^^^^^^^^^^^^^^
113

    
114
The [global] group is treated by kamaki as a generic group for arbitrary options, and it is used as a super-group for vital Kamaki options, namely token, url, cli. In case of conflict, the most specific options overrides the global ones.
115

    
116
* global.colors <on|off>
117
    enable / disable colors in command line based uis. Requires ansicolors, otherwise it is ignored
118

    
119
* global.token <user authentication token>
120

    
121
* store.cli <UI command specifications for store>
122
    a special package that is used to load storage commands to kamaki UIs. Don't touch this unless if you know what you are doing.
123

    
124
* store.url <OOS storage or Pithos+ service url>
125
    the url of the OOS storage or Pithos+ service. Set to Okeanos.grnet.gr Pithos+ storage service by default. Users should set a different value if they need to use a different storage service.
126

    
127
* store.token <token>
128
    it set, it overrides possible global.token option for store level commands
129

    
130
* compute.url <OOS compute or Cyclades service url>
131
    the url of the OOS compute or Cyclades service. Set to Okeanos.grnet.gr Cyclades IaaS service by default. Users should set a different value if they need to use a different IaaS service.
132

    
133
* cyclades.cli <UI command specifications for cyclades>
134
    a special package that is used to load cyclades commands to kamaki UIs. Don't touch this unless you know what you are doing.
135

    
136
* flavor.cli <UI command specifications for VM flavors>
137
    a special package that is used to load cyclades VM flavor commands to kamaki UIs. Don't touch this unless you know what you are doing.
138

    
139
* network.cli <UI command specifications for virtual networks>
140
    a special package that is used to load cyclades virtual network commands to kamaki UIs. Don't touch this unless you know what you are doing.
141

    
142
* image.url <Plankton image service url>
143
    the url of the Plankton service. Set to Okeanos.grnet.gr Plankton service be default. Users should set a different value if they need to use a different service.
144

    
145
* image.cli <UI command specifications for Plankton and Cyclades image service>
146
    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.
147

    
148
* astakos.url <Astakos authentication service url>
149
    the url of the Astakos authentication service. Set to the Okeanos.grnet.gr Astakos service by default. Users should set a different value if they need to use a different service.
150

    
151
* astakos.cli <UI command specifications for Astakos authentication service>
152
    a special package that is used to load astakos-related commands to kamaki UIs. Don't touch this unless you know what you are doing.
153

    
154
* history.file <history file path>
155
    the path of a simple file for inter-session kamaki history. Make sure kamaki is executed in a context where this file is accessible for reading and writing. Kamaki automatically creates the file if it doesn't exist
156

    
157
Hidden features
158
^^^^^^^^^^^^^^^
159

    
160
The livetest suite
161
""""""""""""""""""
162

    
163
Kamaki contains a live test suite for the kamaki.clients API, where "live" means that the tests are performed against active services that up and running. The live test package is named "livetest", it is accessible as kamaki.clients.livetest and it is designed to check the actual relation between kamaki and synnefo services.
164

    
165
The livetest suite can be activated with the following option on the configuration file::
166

    
167
    [livetest]
168
    cli=livetest_cli
169

    
170
In most tests, livetest will run as long as an Astakos identity manager service is accessible and kamaki is set up to authenticate a valid token on this server.
171

    
172
In specific, a setup file needs at least the following mandatory settings in the configuration file:
173

    
174
* If authentication information is used for default kamaki clients::
175

    
176
    [astakos]
177
    url=<Astakos Identity Manager URL>
178
    token=<A valid user token>
179

    
180
* else if this authentication information is only for testing add this under [livetest]::
181

    
182
    astakos_url=<Astakos Identity Manager URL>
183
    astakos_token=<A valid user token>
184

    
185
Each service tested in livetest might need some more options under the [livetest] label, as shown bellow:
186

    
187
* kamaki livetest astakos::
188

    
189
    astakos_email = <The valid email of testing user>
190
    astakos_name = <The exact "real" name of testing user>
191
    astakos_username = <The username of the testing user>
192
    astakos_uuid = <The valid unique user id of the testing user>
193

    
194
* kamaki livetest pithos::
195

    
196
    astakos_uuid = <The valid unique user id of the testing user>
197

    
198
* kamaki livetest cyclades / image::
199

    
200
    image_id = <A valid image id used for testing>
201
    image_local_path = <The local path of the testing image>
202
    image_details = <A text file containing testing image details in a python dict>
203

    
204
    - example image.details content:
205
    {
206
        u'id': u'b3e68235-3abd-4d60-adfe-1379a4f8d3fe',
207
        u'metadata': {
208
            u'values': {
209
                u'description': u'Debian 6.0.6 (Squeeze) Base System',
210
                u'gui': u'No GUI',
211
                u'kernel': u'2.6.32',
212
                u'os': u'debian',
213
                u'osfamily': u'linux',
214
                u'root_partition': u'1',
215
                u'sortorder': u'1',
216
                u'users': u'root'
217
            }
218
        },
219
        u'name': u'Debian Base',
220
        u'progress': u'100',
221
        u'status': u'ACTIVE',
222
        u'created': u'2012-11-19T14:54:57+00:00',
223
        u'updated': u'2012-11-19T15:29:51+00:00'
224
    }
225

    
226
    flavor_details = <A text file containing the testing images' flavor details in a python dict>
227

    
228
    - example flavor.details content:
229
    {
230
        u'name': u'C1R1drbd',
231
        u'ram': 1024,
232
        u'id': 1,
233
        u'SNF:disk_template': u'drbd',
234
        u'disk': 20,
235
        u'cpu': 1
236
    }
237

    
238
After setup, kamaki can run all tests::
239

    
240
    $ kamaki livetest all
241

    
242
a specific test (e.g. astakos)::
243

    
244
    $ kamaki livetest astakos
245

    
246
or a specific method from a service (e.g. astakos authenticate)::
247

    
248
    $ kamaki livetest astakos authenticate
249

    
250
The quotaholder client
251
""""""""""""""""""""""
252

    
253
A quotaholder client is introduced as an advanced feature. Quotaholder client is mostly used as a client library for accessing a synnefo quota service, but it can also be allowed as a kamaki command set, but setting the quotaholder.cli and quotaholder.url methods::
254

    
255
    [quotaholder]
256
    cli=quotaholder_cli
257
    url=<URL of quotaholder service>
258

    
259
Quotaholder is not tested in livetest