Commit a194dc28 authored by Iustin Pop's avatar Iustin Pop

Add ipolicy parameter spindle_ratio

This will represent the instance (count) per spindle_count of their
node(s). Debatable whether we need to add a per-instance
spindle_weight.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 432e8e2f
......@@ -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
--------------
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment