Debian Codegraph @

doc/source/admin/admin_usage.rst

raw
1 =====
2 Usage
3 =====
4
5 **Before** reading this page, **it's recommended** to go through `User Guide`_
6 first as the content on this site is more advanced and uses knowledge gained
7 from the `User Guide`_.
8
9 .. _User Guide: ../user/usage.html
10
11 This page shows examples of usage of ``python-tempestconf`` where **admin
12 credentials** are **required**. That means, only users with admin credentials
13 will run :command:`discover-tempest-config` with arguments described on this
14 page successfully.
15
16 Why admin credentials? It's because ``python-tempestconf`` can create resources
17 **necessary** for tempest execution in order to make user's life easier.
18
19 The following resources are created **only when** ``--create`` argument is
20 used:
21
22 * flavors, to see what flavors are created, see User Guide, `Flavors`_
23 section
24 * users, to see what users are created, see User Guide, `Users`_ section
25
26 .. _Flavors: ../user/usage.html#flavors
27 .. _Users: ../user/usage.html#users
28
29
30 Examples
31 --------
32
33 In the following example, ``python-tempestconf`` will create all necessary
34 resources (`Flavors`_ and `Users`_) if they don't exist already:
35
36 .. code-block:: shell-session
37
38 $ discover-tempest-config \
39 --os-cloud devstack-admin \
40 --create
41
42 If a user wants to use a custom image (instead of the default cirros one),
43 a minimum memory and disk size for new flavors can be defined by
44 ``--flavor-min-mem`` and ``--flavor-min-disk`` arguments.
45
46 .. code-block:: shell-session
47
48 $ discover-tempest-config \
49 --image <path/url to custom image> \
50 --flavor-min-mem 1024 \
51 --flavor-min-disk 10
52
53 In the example above ``python-tempestconf`` will create *custom* flavor with
54 1024 MB of RAM and 10 GB of disk size and *custom_alt** flavor with 1024 + 1 MB
55 of RAM and 10 GB of disk size.
56
57
58 ``python-tempestconf`` can also create a minimal accounts file when
59 ``--create-accounts-file`` is used. It can be useful when a user doesn't have
60 any ``accounts.yaml`` and wants to create it. It can be done with one call:
61
62 .. code-block:: shell-session
63
64 $ discover-tempest-config \
65 --os-cloud devstack-admin \
66 --create \
67 --create-accounts-file ~/accounts.yaml
68
69 The call above will behave the same as if ``--test-accounts`` argument was
70 used, `see here`_. The generated accounts file will look similarly to this one:
71
72 .. _see here: ../user/usage.html#usage-with-tempest-accounts-file
73
74 .. code-block::
75
76 $ cat ~/accounts.yaml
77 # A minimal accounts.yaml file
78 # Will likely not work with swift, since additional
79 # roles are required. For more documentation see:
80 # https://opendev.org/openstack/tempest/src/branch/master/etc/accounts.yaml.sample
81
82 - password: password
83 project_name: admin
84 username: admin
85
86 .. note::
87 More about accounts file can be found in our documentation about
88 `Usage with tempest accounts file`_
89
90 .. _Usage with tempest accounts file: ../user/usage.html#usage-with-tempest-accounts-file
91
92
93