Revision 111adca0

b/docs/design/resource-defaults.rst
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"``
b/docs/design/resource-pool-projects.rst
120 120
  cyclades.vm   project:uuid   None           5       1
121 121
  cyclades.vm   user:uuid      project:uuid   5       1
122 122

  
123
System default base quota
124
-------------------------
123
System default quota
124
--------------------
125 125

  
126 126
Each resource registered in the system is assigned a default quota limit.
127
A newly-activated user is given these limits as their base quota. Up to now,
128
a change in a default quota limit propagates to all users' base quota
129
(except if they have been customized). Since all users' base quota will be
130
controlled through their base projects, the default behavior of
131
``resource-modify`` will change to affect only future users (i.e.
132
construction of new base projects). However, new option
133
``--update-existing-base-projects`` will allow setting the limits to
134
existing base projects, too. This is useful, for example, when setting a
135
newly registered resource.
127
A newly-activated user is given these limits as their base quota. This is
128
till now done by copying the default limits as user's entries in
129
AstakosUserQuota. Default limits will from now on be copied into the base
130
project's resource definitions.
131

  
132
Conventional projects are created through a project application, which
133
may not specify limits for all resources registered in the system. In
134
fact, it may even be impossible to specify a resource, if it is set
135
``api_visible=False``. We have to somehow specify these limits. Defaulting
136
to zero is not appropriate: if we don't want to control a resource, we
137
would like it set to infinite. We thus need an extra skeleton, like the
138
one specifying the default base quota, in order to fill in missing limits
139
for conventional projects. It will be controled by a new option
140
``--project-default`` of command ``resource-modify``.
136 141

  
137 142
Private projects
138 143
----------------
......
392 397
  ------------------------
393 398
  cyclades.vm 100    50
394 399

  
395
``snf-manage quota`` will be removed; checking the integrity of the
396
Quotaholder will be provided by a new command ``reconcile-quota``.
397

  
398 400
A new command ``snf-manage project-modify`` will automate the process of
399 401
applying/approving applications in order to modify some project settings,
400 402
such as the quota limits.
......
402 404
Currently, the administrator can change the user base quota with:
403 405
``snf-manage user-modify <id> --set-base-quota <resource> <capacity>``.
404 406
This will be removed in favor of the ``project-modify`` command, so that all
405
quota are handled in a uniform way.
407
quota are handled in a uniform way. Similar to ``user-modify --all``,
408
``project-modify`` will get options ``--all-base`` and ``--all-non-base`` to
409
allow updating quota in bulk.
406 410

  
407 411
Migration steps
408 412
===============
b/docs/index.rst
150 150

  
151 151
   Sample design <design/sample>
152 152
   Resource-pool projects design <design/resource-pool-projects>
153
   Resource defaults design <design/resource-defaults>
153 154

  
154 155

  
155 156
Contact

Also available in: Unified diff