This will represent the instance (count) per spindle_count of their
node(s). Debatable whether we need to add a per-instance
spindle_weight.
---
doc/rapi.rst | 5 ++++-
lib/constants.py | 5 +++++
2 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/doc/rapi.rst b/doc/rapi.rst
index 313364c..17dc560 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 f88233e..2fd5432 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
--
1.7.7.3