Revision 1b01390b

b/doc/rapi.rst
166 166
Force operation to continue even if it will cause the cluster to become
167 167
inconsistent (e.g. because there are not enough master candidates).
168 168

  
169
Parameter details
170
-----------------
171

  
172
Some parameters are not straight forward, so we describe them in details
173
here.
174

  
175
.. _rapi-ipolicy:
176

  
177
``ipolicy``
178
+++++++++++
179

  
180
The instance policy specification is a dict with the following fields:
181

  
182
.. pyassert::
183

  
184
  constants.IPOLICY_ALL_KEYS == set([constants.ISPECS_MIN,
185
                                     constants.ISPECS_MAX,
186
                                     constants.ISPECS_STD,
187
                                     constants.IPOLICY_DTS,
188
                                     constants.IPOLICY_VCPU_RATIO])
189

  
190

  
191
.. pyassert::
192

  
193
  (set(constants.ISPECS_PARAMETER_TYPES.keys()) ==
194
   set([constants.ISPEC_MEM_SIZE,
195
        constants.ISPEC_DISK_SIZE,
196
        constants.ISPEC_DISK_COUNT,
197
        constants.ISPEC_CPU_COUNT,
198
        constants.ISPEC_NIC_COUNT]))
199

  
200
.. |ispec-min| replace:: :pyeval:`constants.ISPECS_MIN`
201
.. |ispec-max| replace:: :pyeval:`constants.ISPECS_MAX`
202
.. |ispec-std| replace:: :pyeval:`constants.ISPECS_STD`
203

  
204

  
205
|ispec-min|, |ispec-max|, |ispec-std|
206
  A sub- `dict` with the following fields, which sets the limit and standard
207
  values of the instances:
208

  
209
  :pyeval:`constants.ISPEC_MEM_SIZE`
210
    The size in MiB of the memory used
211
  :pyeval:`constants.ISPEC_DISK_SIZE`
212
    The size in MiB of the disk used
213
  :pyeval:`constants.ISPEC_DISK_COUNT`
214
    The numbers of disks used
215
  :pyeval:`constants.ISPEC_CPU_COUNT`
216
    The numbers of cpus used
217
  :pyeval:`constants.ISPEC_NIC_COUNT`
218
    The numbers of nics used
219
:pyeval:`constants.IPOLICY_DTS`
220
  A `list` of disk templates allowed for instances using this policy
221
:pyeval:`constants.IPOLICY_VCPU_RATIO`
222
  Maximum ratio of virtual to physical CPUs (`float`)
223

  
169 224
Usage examples
170 225
--------------
171 226

  
b/lib/opcodes.py
803 803
     "Whether to wipe disks before allocating them to instances"),
804 804
    ("nicparams", None, ht.TMaybeDict, "Cluster-wide NIC parameter defaults"),
805 805
    ("ndparams", None, ht.TMaybeDict, "Cluster-wide node parameter defaults"),
806
    ("ipolicy", None, ht.TMaybeDict, "Cluster-wide instance policy specs"),
806
    ("ipolicy", None, ht.TMaybeDict,
807
     "Cluster-wide :ref:`instance policy <rapi-ipolicy>` specs"),
807 808
    ("drbd_helper", None, ht.TOr(ht.TString, ht.TNone), "DRBD helper program"),
808 809
    ("default_iallocator", None, ht.TOr(ht.TString, ht.TNone),
809 810
     "Default iallocator for cluster"),
......
1438 1439
    _PDiskParams,
1439 1440
    _PHvState,
1440 1441
    _PDiskState,
1441
    ("ipolicy", None, ht.TMaybeDict, "Group-wide instance policy specs"),
1442
    ("ipolicy", None, ht.TMaybeDict,
1443
     "Group-wide :ref:`instance policy <rapi-ipolicy>` specs"),
1442 1444
    ]
1443 1445

  
1444 1446

  

Also available in: Unified diff