ST_LVM_PV = "lvm-pv"
ST_LVM_VG = "lvm-vg"
ST_RADOS = "rados"
-ST_SHARED_FILE = "sharedfile"
VALID_STORAGE_TYPES = compat.UniqueFrozenset([
ST_BLOCK,
ST_LVM_PV,
ST_LVM_VG,
ST_RADOS,
- ST_SHARED_FILE,
])
-# Per default, only lvm is enabled.
-DEFAULT_ENABLED_STORAGE_TYPES = compat.UniqueFrozenset([
- ST_LVM_VG,
- ])
-
-# This is used to order determine the default storage type when the list
-# of enabled storage types is inferred from the current state of the cluster.
-# This only happens on an upgrade from a version of Ganeti that did not
-# support the 'enabled_storage_methods' so far.
-STORAGE_TYPES_PREFERENCE = [
- ST_LVM_VG,
- ST_FILE,
- ST_SHARED_FILE,
- ST_RADOS,
- ST_BLOCK,
- ]
-
# Storage fields
# first two are valid in LU context only, not passed to backend
SF_NODE = "node"
DT_RBD = "rbd"
DT_SHARED_FILE = "sharedfile"
+# This is used to order determine the default disk template when the list
+# of enabled disk templates is inferred from the current state of the cluster.
+# This only happens on an upgrade from a version of Ganeti that did not
+# support the 'enabled_disk_templates' so far.
+DISK_TEMPLATE_PREFERENCE = [
+ DT_DRBD8,
+ DT_PLAIN,
+ DT_FILE,
+ DT_SHARED_FILE,
+ DT_RBD,
+ DT_BLOCK,
+ DT_DISKLESS,
+ DT_EXT
+ ]
+
+DISK_TEMPLATES = compat.UniqueFrozenset([
+ DT_DISKLESS,
+ DT_PLAIN,
+ DT_DRBD8,
+ DT_FILE,
+ DT_SHARED_FILE,
+ DT_BLOCK,
+ DT_RBD,
+ DT_EXT
+ ])
+
+# disk templates that are enabled by default
+DEFAULT_ENABLED_DISK_TEMPLATES = [
+ DT_DRBD8,
+ DT_PLAIN,
+ ]
+
# mapping of disk templates to storage types
DISK_TEMPLATES_STORAGE_TYPE = {
DT_BLOCK: ST_BLOCK,
DT_FILE: ST_FILE,
DT_PLAIN: ST_LVM_VG,
DT_RBD: ST_RADOS,
- DT_SHARED_FILE: ST_SHARED_FILE,
+ DT_SHARED_FILE: ST_FILE,
}
# the set of network-mirrored disk templates
DT_SHARED_FILE,
])
+# the set of disk templates that can be moved by copying
+# Note: a requirement is that they're not accessed externally or shared between
+# nodes; in particular, sharedfile is not suitable.
+DTS_COPYABLE = compat.UniqueFrozenset([
+ DT_FILE,
+ DT_PLAIN,
+ ])
+
# the set of disk templates that are supported by exclusive_storage
DTS_EXCL_STORAGE = compat.UniqueFrozenset([DT_PLAIN])
#: Give child process up to 5 seconds to exit after sending a signal
CHILD_LINGER_TIMEOUT = 5.0
-DISK_TEMPLATES = compat.UniqueFrozenset([
- DT_DISKLESS,
- DT_PLAIN,
- DT_DRBD8,
- DT_FILE,
- DT_SHARED_FILE,
- DT_BLOCK,
- DT_RBD,
- DT_EXT
- ])
-
FILE_DRIVER = compat.UniqueFrozenset([FD_LOOP, FD_BLKTAP])
# import/export config options
ISPECS_PARAMETERS = frozenset(ISPECS_PARAMETER_TYPES.keys())
+ISPECS_MINMAX = "minmax"
ISPECS_MIN = "min"
ISPECS_MAX = "max"
ISPECS_STD = "std"
IPOLICY_VCPU_RATIO = "vcpu-ratio"
IPOLICY_SPINDLE_RATIO = "spindle-ratio"
-IPOLICY_ISPECS = compat.UniqueFrozenset([
+ISPECS_MINMAX_KEYS = compat.UniqueFrozenset([
ISPECS_MIN,
ISPECS_MAX,
- ISPECS_STD,
])
IPOLICY_PARAMETERS = compat.UniqueFrozenset([
IPOLICY_SPINDLE_RATIO,
])
-IPOLICY_ALL_KEYS = (IPOLICY_ISPECS |
- IPOLICY_PARAMETERS |
- frozenset([IPOLICY_DTS]))
+IPOLICY_ALL_KEYS = (IPOLICY_PARAMETERS |
+ frozenset([ISPECS_MINMAX, ISPECS_STD, IPOLICY_DTS]))
# Node parameter names
ND_OOB_PROGRAM = "oob_program"
IDISK_VG = "vg"
IDISK_METAVG = "metavg"
IDISK_PROVIDER = "provider"
+IDISK_NAME = "name"
IDISK_PARAMS_TYPES = {
IDISK_SIZE: VTYPE_SIZE,
IDISK_MODE: VTYPE_STRING,
IDISK_VG: VTYPE_STRING,
IDISK_METAVG: VTYPE_STRING,
IDISK_PROVIDER: VTYPE_STRING,
+ IDISK_NAME: VTYPE_MAYBE_STRING,
}
IDISK_PARAMS = frozenset(IDISK_PARAMS_TYPES.keys())
INIC_MODE = "mode"
INIC_LINK = "link"
INIC_NETWORK = "network"
+INIC_NAME = "name"
INIC_PARAMS_TYPES = {
INIC_IP: VTYPE_MAYBE_STRING,
INIC_LINK: VTYPE_STRING,
INIC_MAC: VTYPE_STRING,
INIC_MODE: VTYPE_STRING,
INIC_NETWORK: VTYPE_MAYBE_STRING,
+ INIC_NAME: VTYPE_MAYBE_STRING,
}
INIC_PARAMS = frozenset(INIC_PARAMS_TYPES.keys())
# Job queue
JOB_QUEUE_VERSION = 1
JOB_QUEUE_SIZE_HARD_LIMIT = 5000
+JOB_QUEUE_FILES_PERMS = 0640
JOB_ID_TEMPLATE = r"\d+"
JOB_FILE_RE = re.compile(r"^job-(%s)$" % JOB_ID_TEMPLATE)
# All of the following values are quite arbitrarily - there are no
# "good" defaults, these must be customised per-site
-IPOLICY_DEFAULTS = {
+ISPECS_MINMAX_DEFAULTS = {
ISPECS_MIN: {
ISPEC_MEM_SIZE: 128,
ISPEC_CPU_COUNT: 1,
ISPEC_NIC_COUNT: MAX_NICS,
ISPEC_SPINDLE_USE: 12,
},
+ }
+IPOLICY_DEFAULTS = {
+ ISPECS_MINMAX: [ISPECS_MINMAX_DEFAULTS],
ISPECS_STD: {
ISPEC_MEM_SIZE: 128,
ISPEC_CPU_COUNT: 1,
# The version identifier for builtin data collectors
BUILTIN_DATA_COLLECTOR_VERSION = "B"
-# The source reasons for the change of state of an instance
-INSTANCE_REASON_SOURCE_CLI = "cli"
-INSTANCE_REASON_SOURCE_RAPI = "rapi"
-INSTANCE_REASON_SOURCE_UNKNOWN = "unknown"
+# The reason trail opcode parameter name
+OPCODE_REASON = "reason"
-INSTANCE_REASON_SOURCES = compat.UniqueFrozenset([
- INSTANCE_REASON_SOURCE_CLI,
- INSTANCE_REASON_SOURCE_RAPI,
- INSTANCE_REASON_SOURCE_UNKNOWN,
- ])
+# The source reasons for the execution of an OpCode
+OPCODE_REASON_SRC_CLIENT = "gnt:client"
+OPCODE_REASON_SRC_NODED = "gnt:daemon:noded"
+OPCODE_REASON_SRC_OPCODE = "gnt:opcode"
+OPCODE_REASON_SRC_RLIB2 = "gnt:library:rlib2"
+OPCODE_REASON_SRC_USER = "gnt:user"
-# The default reasons for the change of state of an instance
-INSTANCE_REASON_REBOOT = "reboot"
+OPCODE_REASON_SOURCES = compat.UniqueFrozenset([
+ OPCODE_REASON_SRC_CLIENT,
+ OPCODE_REASON_SRC_NODED,
+ OPCODE_REASON_SRC_OPCODE,
+ OPCODE_REASON_SRC_RLIB2,
+ OPCODE_REASON_SRC_USER,
+ ])
# Do not re-export imported modules
del re, _vcsversion, _autoconf, socket, pathutils, compat