#
#
-# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google Inc.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# dynamic device modification
DDM_ADD = "add"
+DDM_MODIFY = "modify"
DDM_REMOVE = "remove"
DDMS_VALUES = frozenset([DDM_ADD, DDM_REMOVE])
+DDMS_VALUES_WITH_MODIFY = (DDMS_VALUES | frozenset([
+ DDM_MODIFY,
+ ]))
+# TODO: DDM_SWAP, DDM_MOVE?
# common exit codes
EXIT_SUCCESS = 0
ISPECS_MIN = "min"
ISPECS_MAX = "max"
ISPECS_STD = "std"
-ISPECS_DTS = "disk_templates"
+IPOLICY_DTS = "disk-templates"
+IPOLICY_VCPU_RATIO = "vcpu-ratio"
-IPOLICY_PARAMETERS = frozenset([
+IPOLICY_ISPECS = frozenset([
ISPECS_MIN,
ISPECS_MAX,
ISPECS_STD,
])
-IPOLICY_ALL_KEYS = IPOLICY_PARAMETERS.union([ISPECS_DTS])
+
+IPOLICY_PARAMETERS = frozenset([
+ IPOLICY_VCPU_RATIO,
+ ])
+
+IPOLICY_ALL_KEYS = (IPOLICY_ISPECS |
+ IPOLICY_PARAMETERS |
+ frozenset([IPOLICY_DTS]))
# Node parameter names
ND_OOB_PROGRAM = "oob_program"
+ND_SPINDLE_COUNT = "spindle_count"
NDS_PARAMETER_TYPES = {
ND_OOB_PROGRAM: VTYPE_MAYBE_STRING,
+ ND_SPINDLE_COUNT: VTYPE_INT,
}
NDS_PARAMETERS = frozenset(NDS_PARAMETER_TYPES.keys())
NDC_DEFAULTS = {
ND_OOB_PROGRAM: None,
+ ND_SPINDLE_COUNT: 1,
}
DISK_LD_DEFAULTS = {
ISPEC_DISK_SIZE: 1024,
ISPEC_NIC_COUNT: 1,
},
- ISPECS_DTS: DISK_TEMPLATES,
+ IPOLICY_DTS: DISK_TEMPLATES,
+ IPOLICY_VCPU_RATIO: 4.0,
}
MASTER_POOL_SIZE_DEFAULT = 10