Statistics
| Branch: | Tag: | Revision:

root / docs / design / resource-defaults.rst @ 111adca0

History | View | Annotate | Download (4.1 kB)

1
Resource default limits and visibility
2
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3

    
4
We wish to keep track of resources which are not visible to the user or
5
resources that we don't care to impose a certain limit on. For example, we
6
wish to know the total number of CPUs per user without checking a limit and
7
without the user needing to specify a value when applying for a new project.
8
However, the administrator should be able at any time to change either of
9
these parameters.
10

    
11
Resource registration
12
=====================
13

    
14
A new resource will be registered with an infinite base quota limit (denoted
15
by 2**63-1). A holding is created in the quotaholder for each accepted user
16
with the said limit. This means that the resource is ready to be used in a
17
commission, but we are not interested in checking a senseful limit.
18

    
19
Resource ``cyclades.cpu`` will from now on denote the number of active cpus.
20
Its description will change to explain this. A new resource,
21
``cyclades.total_cpu``, will also be registered in the system, with the
22
semantics ``cyclades.cpu`` used to have. The reason for this change is that
23
(in our default policy) we would like to control the number of active CPUs
24
but not the total CPUs (the latter would have an infinite limit). However,
25
existing projects have specified a value for the resource ``cyclades.cpu``.
26
If we don't reinterpret it as active CPUs, then this grant will be
27
useless: It will add a value to infinite total CPUs, but provide no active
28
CPUs. Likewise we will change ``cyclades.ram`` and register
29
``cyclades.total_ram``.
30

    
31
There now exists attribute ``allow_in_projects`` in resource definitions,
32
which controls whether a resource appears in a project application in the
33
UI. Currently, this is set to False only for resource
34
``astakos.pending_app``. This will be renamed to ``ui_visible`` and affect
35
also the appearance in the Usage page. A new attribute ``api_visible`` will
36
also be included in resource definition (True by default), to control
37
whether the resource can appear in related API calls: GET /resources, GET
38
/quotas, POST /projects (applying for a project), etc. ``ui_visible`` will
39
entail ``api_visible``. Both attributes will be adjustable through
40
``snf-manage resource-modify``.
41

    
42
Resources ``cyclades.total_cpu`` and ``cyclades.total_ram`` will be marked
43
with ``ui_visible=False`` and ``api_visible=False``.
44

    
45
Changing base quota
46
===================
47

    
48
Base quota for a certain user is currently determined by looking up
49
the default base quota that is registered for the resource, unless there
50
exists a custom limit for the user/resource pair in the model
51
AstakosUserQuota. Resource limit can change with::
52

    
53
  snf-manage resource-modify <resource_name> --limit <value>
54

    
55
This not only changes the quota scheme for future users but also affects all
56
existing users that have no custom limit for this resource. This is
57
troublesome, because it doesn't allow simply changing the future quota
58
scheme. One is forced to rather set custom quota for new users, just in
59
order to express the new default.
60

    
61
This behavior will change: we will discard the distinction between users
62
having default or custom quota. Resource default limits will be viewed
63
as a skeleton for determining base quota for new users. When a new user
64
is accepted, resource defaults will be consulted in order to fill the
65
user-specific entries in AstakosUserQuota. When a resource default
66
changes, this will not affect quota of existing users.
67

    
68
For clarity, option ``--limit`` will be renamed ``--default-quota``.
69

    
70
We can currently change a user's base quota with::
71

    
72
     snf-manage user-modify <id> --set-base-quota <resource_name> <value>
73

    
74
This command will be extended with option ``--all`` to allow changing base
75
quota for multiple users; option ``--exclude`` will allow introducing
76
exceptions.
77

    
78
Inspecting base quota
79
=====================
80

    
81
Management command ``quota`` will split into ``quota-list`` and
82
``quota-verify``. The former will be used to list quota and will provide
83
various filters. Option ``--with-custom`` will allow filtering quota that
84
differ from the default or equal to it. Option ``--filter-by`` will enable
85
filtering specified values, e.g. ``--filter-by "usage>1G"``