Revision d3cf0b89 docs/quick-install-admin-guide.rst

b/docs/quick-install-admin-guide.rst
2284 2284
We will use the `kamaki <http://www.synnefo.org/docs/kamaki/latest/index.html>`_
2285 2285
command line client to do the uploading and registering of the Image.
2286 2286

  
2287
Installation of `kamaki`
2288
~~~~~~~~~~~~~~~~~~~~~~~~
2289

  
2290
You can install `kamaki` anywhere you like, since it is a standalone client of
2291
the APIs and talks to the installation over `http`. For the purpose of this
2292
guide we will assume that we have downloaded the `Debian Squeeze Base Image
2293
<https://pithos.okeanos.grnet.gr/public/9epgb>`_ and stored it under node1's
2294
``/srv/images`` directory. For that reason we will install `kamaki` on node1,
2295
too. We do this by running:
2296

  
2297
.. code-block:: console
2298

  
2299
   # apt-get install kamaki
2300

  
2301
Configuration of kamaki
2302
~~~~~~~~~~~~~~~~~~~~~~~
2303

  
2304
Now we need to setup kamaki, by adding the appropriate URLs and tokens of our
2305
installation. We do this by running:
2306

  
2307
.. code-block:: console
2308

  
2309
   $ kamaki config set cloud.default.url \
2310
       "https://node1.example.com/astakos/identity/v2.0"
2311
   $ kamaki config set cloud.default.token USER_TOKEN
2312

  
2313
Both the Authentication URL and the USER_TOKEN appear on the user's
2314
`API access` web page on the Astakos Web UI.
2315

  
2316
You can see that the new configuration options have been applied correctly,
2317
either by checking the editable file ``~/.kamakirc`` or by running:
2318

  
2319
.. code-block:: console
2320

  
2321
   $ kamaki config list
2322

  
2323
A quick test to check that kamaki is configured correctly, is to try to
2324
authenticate a user based on his/her token (in this case the user is you):
2325

  
2326
.. code-block:: console
2327

  
2328
  $ kamaki user authenticate
2329

  
2330
The above operation provides various user information, e.g. UUID (the unique
2331
user id) which might prove useful in some operations.
2332

  
2333
Upload an Image file to Pithos
2334
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2335

  
2336
Now, that we have set up `kamaki` we will upload the Image that we have
2337
downloaded and stored under ``/srv/images/``. Although we can upload the Image
2338
under the root ``Pithos`` container (as you may have done when uploading the
2339
Image from the Pithos Web UI), we will create a new container called ``images``
2340
and store the Image under that container. We do this for two reasons:
2341

  
2342
a) To demonstrate how to create containers other than the default ``Pithos``.
2343
   This can be done only with the `kamaki` client and not through the Web UI.
2344

  
2345
b) As a best organization practise, so that you won't have your Image files
2346
   tangled along with all your other Pithos files and directory structures.
2347

  
2348
We create the new ``images`` container by running:
2349

  
2350
.. code-block:: console
2351

  
2352
   $ kamaki container create images
2353

  
2354
To check if the container has been created, list all containers of your
2355
account:
2356

  
2357
.. code-block:: console
2358

  
2359
  $ kamaki file list /images
2360

  
2361
Then, we upload the Image file to that container:
2362

  
2363
.. code-block:: console
2364

  
2365
   $ kamaki file upload /srv/images/debian_base-6.0-7-x86_64.diskdump /images
2366

  
2367
The first is the local path and the second is the remote container on Pithos.
2368
Check if the file has been uploaded, by listing the container contents:
2369

  
2370
.. code-block:: console
2371

  
2372
  $ kamaki file list /images
2373

  
2374
Alternatively check if the new container and file appear on the Pithos Web UI.
2375

  
2287 2376
Register an existing Image file to Cyclades
2288 2377
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2289 2378

  
......
2296 2385

  
2297 2386
.. code-block:: console
2298 2387

  
2299
   $ kamaki image register "Debian Base" pithos:debian_base-6.0-x86_64 \
2300
     --metafile debian_base-6.0-x86_64.diskdump.meta --public
2388
   $ kamaki image register --name "Debian Base" \
2389
                           --location /images/debian_base-6.0-11-x86_64.diskdump \
2390
                           --public \
2391
                           --disk-format=diskdump \
2392
                           --property OSFAMILY=linux --property ROOT_PARTITION=1 \
2393
                           --property description="Debian Squeeze Base System" \
2394
                           --property size=451 --property kernel=2.6.32 --property GUI="No GUI" \
2395
                           --property sortorder=1 --property USERS=root --property OS=debian
2301 2396

  
2302 2397
This command registers a Pithos file as an Image in Cyclades. This Image will
2303 2398
be public (``--public``), so all users will be able to spawn VMs from it.

Also available in: Unified diff