diff --git a/doc/rapi.rst b/doc/rapi.rst index 313364cae3b0890b687ea481dc3c9180efc5028a..17dc56029cb4003c275a62db912cd23263494cce 100644 --- a/doc/rapi.rst +++ b/doc/rapi.rst @@ -185,7 +185,8 @@ The instance policy specification is a dict with the following fields: constants.ISPECS_MAX, constants.ISPECS_STD, constants.IPOLICY_DTS, - constants.IPOLICY_VCPU_RATIO]) + constants.IPOLICY_VCPU_RATIO, + constants.IPOLICY_SPINDLE_RATIO]) .. pyassert:: @@ -220,6 +221,8 @@ The instance policy specification is a dict with the following fields: A `list` of disk templates allowed for instances using this policy :pyeval:`constants.IPOLICY_VCPU_RATIO` Maximum ratio of virtual to physical CPUs (`float`) +:pyeval:`constants.IPOLICY_SPINDLE_RATIO` + Maximum ratio of instances to their node's ``spindle_count`` (`float`) Usage examples -------------- diff --git a/lib/constants.py b/lib/constants.py index f88233edb984ca5ebf68fead0a956d834a6b0fd6..2fd54327212d74fb1d5c8e2a2b27265eadfb636f 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -956,6 +956,7 @@ ISPECS_MAX = "max" ISPECS_STD = "std" IPOLICY_DTS = "disk-templates" IPOLICY_VCPU_RATIO = "vcpu-ratio" +IPOLICY_SPINDLE_RATIO = "spindle-ratio" IPOLICY_ISPECS = frozenset([ ISPECS_MIN, @@ -965,6 +966,7 @@ IPOLICY_ISPECS = frozenset([ IPOLICY_PARAMETERS = frozenset([ IPOLICY_VCPU_RATIO, + IPOLICY_SPINDLE_RATIO, ]) IPOLICY_ALL_KEYS = (IPOLICY_ISPECS | @@ -1900,6 +1902,8 @@ NICC_DEFAULTS = { NIC_LINK: DEFAULT_BRIDGE, } +# All of the following values are quite arbitrarily - there are no +# "good" defaults, these must be customised per-site IPOLICY_DEFAULTS = { ISPECS_MIN: { ISPEC_MEM_SIZE: 128, @@ -1924,6 +1928,7 @@ IPOLICY_DEFAULTS = { }, IPOLICY_DTS: DISK_TEMPLATES, IPOLICY_VCPU_RATIO: 4.0, + IPOLICY_SPINDLE_RATIO: 32.0, } MASTER_POOL_SIZE_DEFAULT = 10