RAPI_GROUP = _autoconf.RAPI_GROUP
CONFD_USER = _autoconf.CONFD_USER
CONFD_GROUP = _autoconf.CONFD_GROUP
+LUXID_USER = _autoconf.LUXID_USER
+LUXID_GROUP = _autoconf.LUXID_GROUP
NODED_USER = _autoconf.NODED_USER
NODED_GROUP = _autoconf.NODED_GROUP
+MOND_USER = _autoconf.MOND_USER
+MOND_GROUP = _autoconf.MOND_GROUP
SSH_LOGIN_USER = _autoconf.SSH_LOGIN_USER
SSH_CONSOLE_USER = _autoconf.SSH_CONSOLE_USER
SECURE_DIR_MODE = 0700
SECURE_FILE_MODE = 0600
ADOPTABLE_BLOCKDEV_ROOT = "/dev/disk/"
-ENABLE_FILE_STORAGE = _autoconf.ENABLE_FILE_STORAGE
-ENABLE_SHARED_FILE_STORAGE = _autoconf.ENABLE_SHARED_FILE_STORAGE
ENABLE_CONFD = _autoconf.ENABLE_CONFD
+ENABLE_MOND = _autoconf.ENABLE_MOND
ENABLE_SPLIT_QUERY = _autoconf.ENABLE_SPLIT_QUERY
ENABLE_RESTRICTED_COMMANDS = _autoconf.ENABLE_RESTRICTED_COMMANDS
+# SSH constants
+SSH = "ssh"
+SCP = "scp"
+
NODED = "ganeti-noded"
CONFD = "ganeti-confd"
+LUXID = "ganeti-luxid"
RAPI = "ganeti-rapi"
MASTERD = "ganeti-masterd"
+MOND = "ganeti-mond"
+
+DAEMONS = compat.UniqueFrozenset([
+ NODED,
+ CONFD,
+ LUXID,
+ RAPI,
+ MASTERD,
+ MOND,
+ ])
DAEMONS_PORTS = {
# daemon-name: ("proto", "default-port")
NODED: ("tcp", 1811),
CONFD: ("udp", 1814),
+ MOND: ("tcp", 1815),
RAPI: ("tcp", 5080),
- "ssh": ("tcp", 22),
+ SSH: ("tcp", 22),
}
+
DEFAULT_NODED_PORT = DAEMONS_PORTS[NODED][1]
DEFAULT_CONFD_PORT = DAEMONS_PORTS[CONFD][1]
+DEFAULT_MOND_PORT = DAEMONS_PORTS[MOND][1]
DEFAULT_RAPI_PORT = DAEMONS_PORTS[RAPI][1]
FIRST_DRBD_PORT = 11000
DAEMONS_LOGBASE = {
NODED: "node-daemon",
CONFD: "conf-daemon",
+ LUXID: "luxi-daemon",
RAPI: "rapi-daemon",
MASTERD: "master-daemon",
+ MOND: "monitoring-daemon",
}
DAEMONS_LOGFILES = \
dict((daemon, pathutils.GetLogFilename(DAEMONS_LOGBASE[daemon]))
for daemon in DAEMONS_LOGBASE)
+# Some daemons might require more than one logfile.
+# Specifically, right now only the Haskell http library "snap", used by the
+# monitoring daemon, requires multiple log files.
+
+# These are the only valid reasons for having an extra logfile
+EXTRA_LOGREASON_ACCESS = "access"
+EXTRA_LOGREASON_ERROR = "error"
+
+VALID_EXTRA_LOGREASONS = compat.UniqueFrozenset([
+ EXTRA_LOGREASON_ACCESS,
+ EXTRA_LOGREASON_ERROR,
+ ])
+
+# These are the extra logfiles, grouped by daemon
+DAEMONS_EXTRA_LOGBASE = {
+ MOND: {
+ EXTRA_LOGREASON_ACCESS: "monitoring-daemon-access",
+ EXTRA_LOGREASON_ERROR: "monitoring-daemon-error",
+ }
+ }
+
+DAEMONS_EXTRA_LOGFILES = \
+ dict((daemon, dict((extra,
+ pathutils.GetLogFilename(DAEMONS_EXTRA_LOGBASE[daemon][extra]))
+ for extra in DAEMONS_EXTRA_LOGBASE[daemon]))
+ for daemon in DAEMONS_EXTRA_LOGBASE)
+
DEV_CONSOLE = "/dev/console"
PROC_MOUNTS = "/proc/mounts"
# Local UniX Interface related constants
-LUXI_EOM = "\3"
+LUXI_EOM = chr(3)
LUXI_VERSION = CONFIG_VERSION
+#: Environment variable for the luxi override socket
+LUXI_OVERRIDE = "FORCE_LUXI_SOCKET"
+LUXI_OVERRIDE_MASTER = "master"
+LUXI_OVERRIDE_QUERY = "query"
+LUXI_SOCKET_PERMS = 0660
# one of "no", "yes", "only"
SYSLOG_USAGE = _autoconf.SYSLOG_USAGE
XEN_INITRD = _autoconf.XEN_INITRD
XEN_CMD_XM = "xm"
XEN_CMD_XL = "xl"
-# FIXME: This will be made configurable using hvparams in Ganeti 2.7
-XEN_CMD = _autoconf.XEN_CMD
+
+KNOWN_XEN_COMMANDS = compat.UniqueFrozenset([
+ XEN_CMD_XM,
+ XEN_CMD_XL,
+ ])
+
# When the Xen toolstack used is "xl", live migration requires the source host
# to connect to the target host via ssh (xl runs this command). We need to pass
# the command xl runs some extra info so that it can use Ganeti's key
HKR_SUCCESS = 2
# Storage types
+ST_BLOCK = "blockdev"
+ST_DISKLESS = "diskless"
+ST_EXT = "ext"
ST_FILE = "file"
ST_LVM_PV = "lvm-pv"
ST_LVM_VG = "lvm-vg"
+ST_RADOS = "rados"
+
+STORAGE_TYPES = compat.UniqueFrozenset([
+ ST_BLOCK,
+ ST_DISKLESS,
+ ST_EXT,
+ ST_FILE,
+ ST_LVM_PV,
+ ST_LVM_VG,
+ ST_RADOS,
+ ])
+
+# the set of storage types for which storage reporting is available
+# FIXME: Remove this, once storage reporting is available for all types.
+STS_REPORT = compat.UniqueFrozenset([ST_FILE, ST_LVM_PV, ST_LVM_VG])
# Storage fields
# first two are valid in LU context only, not passed to backend
SF_ALLOCATABLE,
])
-VALID_STORAGE_TYPES = compat.UniqueFrozenset([
- ST_FILE,
- ST_LVM_PV,
- ST_LVM_VG,
- ])
-
MODIFIABLE_STORAGE_FIELDS = {
ST_LVM_PV: frozenset([SF_ALLOCATABLE]),
}
LDS_UNKNOWN,
LDS_FAULTY) = range(1, 4)
+LDS_NAMES = {
+ LDS_OKAY: "ok",
+ LDS_UNKNOWN: "unknown",
+ LDS_FAULTY: "faulty",
+}
+
# disk template types
+DT_BLOCK = "blockdev"
DT_DISKLESS = "diskless"
-DT_PLAIN = "plain"
DT_DRBD8 = "drbd"
+DT_EXT = "ext"
DT_FILE = "file"
-DT_SHARED_FILE = "sharedfile"
-DT_BLOCK = "blockdev"
+DT_PLAIN = "plain"
DT_RBD = "rbd"
-DT_EXT = "ext"
+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_BLOCK,
+ DT_DISKLESS,
+ DT_DRBD8,
+ DT_EXT,
+ DT_FILE,
+ DT_PLAIN,
+ DT_RBD,
+ DT_SHARED_FILE,
+ ]
+
+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
+MAP_DISK_TEMPLATE_STORAGE_TYPE = {
+ DT_BLOCK: ST_BLOCK,
+ DT_DISKLESS: ST_DISKLESS,
+ DT_DRBD8: ST_LVM_VG,
+ DT_EXT: ST_EXT,
+ DT_FILE: ST_FILE,
+ DT_PLAIN: ST_LVM_VG,
+ DT_RBD: ST_RADOS,
+ DT_SHARED_FILE: ST_FILE,
+ }
# the set of network-mirrored disk templates
DTS_INT_MIRROR = compat.UniqueFrozenset([DT_DRBD8])
# the set of externally-mirrored disk templates (e.g. SAN, NAS)
DTS_EXT_MIRROR = compat.UniqueFrozenset([
+ DT_DISKLESS, # 'trivially' externally mirrored
DT_SHARED_FILE,
DT_BLOCK,
DT_RBD,
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])
DT_EXT,
])
-# logical disk types
-LD_LV = "lvm"
-LD_DRBD8 = "drbd8"
-LD_FILE = "file"
-LD_BLOCKDEV = "blockdev"
-LD_RBD = "rbd"
-LD_EXT = "ext"
-LOGICAL_DISK_TYPES = compat.UniqueFrozenset([
- LD_LV,
- LD_DRBD8,
- LD_FILE,
- LD_BLOCKDEV,
- LD_RBD,
- LD_EXT,
+DTS_BLOCK = compat.UniqueFrozenset([
+ DT_PLAIN,
+ DT_DRBD8,
+ DT_BLOCK,
+ DT_RBD,
+ DT_EXT,
])
-LDS_BLOCK = compat.UniqueFrozenset([
- LD_LV,
- LD_DRBD8,
- LD_BLOCKDEV,
- LD_RBD,
- LD_EXT,
- ])
+# the set of drbd-like disk types
+DTS_DRBD = compat.UniqueFrozenset([DT_DRBD8])
# drbd constants
DRBD_HMAC_ALG = "md5"
-DRBD_NET_PROTOCOL = "C"
+DRBD_DEFAULT_NET_PROTOCOL = "C"
+DRBD_MIGRATION_NET_PROTOCOL = "C"
DRBD_STATUS_FILE = "/proc/drbd"
#: Size of DRBD meta block device
# file backend driver
FD_LOOP = "loop"
FD_BLKTAP = "blktap"
-
-# the set of drbd-like disk types
-LDS_DRBD = compat.UniqueFrozenset([LD_DRBD8])
+FD_BLKTAP2 = "blktap2"
+FD_DEFAULT = FD_LOOP
# disk access mode
DISK_RDONLY = "ro"
#: 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])
+FILE_DRIVER = compat.UniqueFrozenset([FD_LOOP, FD_BLKTAP, FD_BLKTAP2])
# import/export config options
INISECT_EXP = "export"
ES_PARAMETERS_FILE = "parameters.list"
-# ssh constants
-SSH = "ssh"
-SCP = "scp"
-
# reboot types
INSTANCE_REBOOT_SOFT = "soft"
INSTANCE_REBOOT_HARD = "hard"
HV_KVM_EXTRA = "kvm_extra"
HV_KVM_MACHINE_VERSION = "machine_version"
HV_KVM_PATH = "kvm_path"
+HV_VIF_TYPE = "vif_type"
+HV_VIF_SCRIPT = "vif_script"
+HV_XEN_CMD = "xen_cmd"
+HV_VNET_HDR = "vnet_hdr"
+HV_VIRIDIAN = "viridian"
HVS_PARAMETER_TYPES = {
HV_VGA: VTYPE_STRING,
HV_KVM_EXTRA: VTYPE_STRING,
HV_KVM_MACHINE_VERSION: VTYPE_STRING,
+ HV_VIF_TYPE: VTYPE_STRING,
+ HV_VIF_SCRIPT: VTYPE_STRING,
+ HV_XEN_CMD: VTYPE_STRING,
+ HV_VNET_HDR: VTYPE_BOOL,
+ HV_VIRIDIAN: VTYPE_BOOL,
}
HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys())
}
DSS_PARAMETERS = frozenset(DSS_PARAMETER_TYPES.keys())
-DS_VALID_TYPES = compat.UniqueFrozenset([LD_LV])
+DS_VALID_TYPES = compat.UniqueFrozenset([DT_PLAIN])
# Backend parameter names
BE_MEMORY = "memory" # deprecated and replaced by max and min mem
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"
LDP_DEFAULT_METAVG = "default-metavg"
LDP_DISK_CUSTOM = "disk-custom"
LDP_NET_CUSTOM = "net-custom"
+LDP_PROTOCOL = "protocol"
LDP_DYNAMIC_RESYNC = "dynamic-resync"
LDP_PLAN_AHEAD = "c-plan-ahead"
LDP_FILL_TARGET = "c-fill-target"
LDP_DEFAULT_METAVG: VTYPE_STRING,
LDP_DISK_CUSTOM: VTYPE_STRING,
LDP_NET_CUSTOM: VTYPE_STRING,
+ LDP_PROTOCOL: VTYPE_STRING,
LDP_DYNAMIC_RESYNC: VTYPE_BOOL,
LDP_PLAN_AHEAD: VTYPE_INT,
LDP_FILL_TARGET: VTYPE_INT,
DRBD_DEFAULT_METAVG = "metavg"
DRBD_DISK_CUSTOM = "disk-custom"
DRBD_NET_CUSTOM = "net-custom"
+DRBD_PROTOCOL = "protocol"
DRBD_DYNAMIC_RESYNC = "dynamic-resync"
DRBD_PLAN_AHEAD = "c-plan-ahead"
DRBD_FILL_TARGET = "c-fill-target"
DRBD_DEFAULT_METAVG: VTYPE_STRING,
DRBD_DISK_CUSTOM: VTYPE_STRING,
DRBD_NET_CUSTOM: VTYPE_STRING,
+ DRBD_PROTOCOL: VTYPE_STRING,
DRBD_DYNAMIC_RESYNC: VTYPE_BOOL,
DRBD_PLAN_AHEAD: VTYPE_INT,
DRBD_FILL_TARGET: VTYPE_INT,
# IDISK_* constants are used in opcodes, to create/change disks
IDISK_SIZE = "size"
+IDISK_SPINDLES = "spindles"
IDISK_MODE = "mode"
IDISK_ADOPT = "adopt"
IDISK_VG = "vg"
IDISK_METAVG = "metavg"
IDISK_PROVIDER = "provider"
+IDISK_NAME = "name"
IDISK_PARAMS_TYPES = {
IDISK_SIZE: VTYPE_SIZE,
+ IDISK_SPINDLES: VTYPE_INT,
IDISK_MODE: VTYPE_STRING,
IDISK_ADOPT: 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())
+MODIFIABLE_IDISK_PARAMS_TYPES = {
+ IDISK_MODE: VTYPE_STRING,
+ IDISK_NAME: VTYPE_STRING,
+ }
+MODIFIABLE_IDISK_PARAMS = frozenset(MODIFIABLE_IDISK_PARAMS_TYPES.keys())
+
# INIC_* constants are used in opcodes, to create/change nics
INIC_MAC = "mac"
INIC_IP = "ip"
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())
HT_NIC_PARAVIRTUAL,
])
+# Vif types
+# default vif type in xen-hvm
+HT_HVM_VIF_IOEMU = "ioemu"
+HT_HVM_VIF_VIF = "vif"
+HT_HVM_VALID_VIF_TYPES = compat.UniqueFrozenset([
+ HT_HVM_VIF_IOEMU,
+ HT_HVM_VIF_VIF,
+ ])
+
# Disk types
HT_DISK_IOEMU = "ioemu"
HT_DISK_IDE = "ide"
CV_EINSTANCEUNSUITABLENODE = \
(CV_TINSTANCE, "EINSTANCEUNSUITABLENODE",
"Instance running on nodes that are not suitable for it")
+CV_EINSTANCEMISSINGCFGPARAMETER = \
+ (CV_TINSTANCE, "EINSTANCEMISSINGCFGPARAMETER",
+ "A configuration parameter for an instance is missing")
CV_ENODEDRBD = \
(CV_TNODE, "ENODEDRBD", "Error parsing the DRBD status file")
+CV_ENODEDRBDVERSION = \
+ (CV_TNODE, "ENODEDRBDVERSION", "DRBD version mismatch within a node group")
CV_ENODEDRBDHELPER = \
(CV_TNODE, "ENODEDRBDHELPER", "Error caused by the DRBD helper")
CV_ENODEFILECHECK = \
(CV_TNODE, "ENODEUSERSCRIPTS", "User scripts not present or not executable")
CV_ENODEFILESTORAGEPATHS = \
(CV_TNODE, "ENODEFILESTORAGEPATHS", "Detected bad file storage paths")
+CV_ENODEFILESTORAGEPATHUNUSABLE = \
+ (CV_TNODE, "ENODEFILESTORAGEPATHUNUSABLE", "File storage path unusable")
+CV_ENODESHAREDFILESTORAGEPATHUNUSABLE = \
+ (CV_TNODE, "ENODESHAREDFILESTORAGEPATHUNUSABLE",
+ "Shared file storage path unusable")
CV_ALL_ECODES = compat.UniqueFrozenset([
CV_ECLUSTERCFG,
CV_ENODEOOBPATH,
CV_ENODEUSERSCRIPTS,
CV_ENODEFILESTORAGEPATHS,
+ CV_ENODEFILESTORAGEPATHUNUSABLE,
+ CV_ENODESHAREDFILESTORAGEPATHUNUSABLE,
])
CV_ALL_ECODES_STRINGS = \
# Node verify constants
NV_BRIDGES = "bridges"
NV_DRBDHELPER = "drbd-helper"
+NV_DRBDVERSION = "drbd-version"
NV_DRBDLIST = "drbd-list"
NV_EXCLUSIVEPVS = "exclusive-pvs"
NV_FILELIST = "filelist"
-NV_FILE_STORAGE_PATHS = "file-storage-paths"
+NV_ACCEPTED_STORAGE_PATHS = "allowed-file-storage-paths"
+NV_FILE_STORAGE_PATH = "file-storage-path"
+NV_SHARED_FILE_STORAGE_PATH = "shared-file-storage-path"
NV_HVINFO = "hvinfo"
NV_HVPARAMS = "hvparms"
NV_HYPERVISOR = "hypervisor"
# 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)
SS_NODEGROUPS = "nodegroups"
SS_NETWORKS = "networks"
+# This is not a complete SSCONF key, but the prefix for the hypervisor keys
+SS_HVPARAMS_PREF = "hvparams_"
+
+# Hvparams keys:
+SS_HVPARAMS_XEN_PVM = SS_HVPARAMS_PREF + HT_XEN_PVM
+SS_HVPARAMS_XEN_FAKE = SS_HVPARAMS_PREF + HT_FAKE
+SS_HVPARAMS_XEN_HVM = SS_HVPARAMS_PREF + HT_XEN_HVM
+SS_HVPARAMS_XEN_KVM = SS_HVPARAMS_PREF + HT_KVM
+SS_HVPARAMS_XEN_CHROOT = SS_HVPARAMS_PREF + HT_CHROOT
+SS_HVPARAMS_XEN_LXC = SS_HVPARAMS_PREF + HT_LXC
+
+VALID_SS_HVPARAMS_KEYS = compat.UniqueFrozenset([
+ SS_HVPARAMS_XEN_PVM,
+ SS_HVPARAMS_XEN_FAKE,
+ SS_HVPARAMS_XEN_HVM,
+ SS_HVPARAMS_XEN_KVM,
+ SS_HVPARAMS_XEN_CHROOT,
+ SS_HVPARAMS_XEN_LXC,
+ ])
+
SS_FILE_PERMS = 0444
# cluster wide default parameters
HV_CPU_MASK: CPU_PINNING_ALL,
HV_CPU_CAP: 0,
HV_CPU_WEIGHT: 256,
+ HV_VIF_SCRIPT: "",
+ HV_XEN_CMD: XEN_CMD_XM,
},
HT_XEN_HVM: {
HV_BOOT_ORDER: "cd",
HV_CPU_MASK: CPU_PINNING_ALL,
HV_CPU_CAP: 0,
HV_CPU_WEIGHT: 256,
+ HV_VIF_TYPE: HT_HVM_VIF_IOEMU,
+ HV_VIF_SCRIPT: "",
+ HV_VIRIDIAN: False,
+ HV_XEN_CMD: XEN_CMD_XM,
},
HT_KVM: {
HV_KVM_PATH: KVM_PATH,
HV_VGA: "",
HV_KVM_EXTRA: "",
HV_KVM_MACHINE_VERSION: "",
+ HV_VNET_HDR: True,
},
- HT_FAKE: {},
+ HT_FAKE: {
+ HV_MIGRATION_MODE: HT_MIGRATION_LIVE,
+ },
HT_CHROOT: {
HV_INIT_SCRIPT: "/ganeti-chroot",
},
HV_MIGRATION_PORT,
HV_MIGRATION_BANDWIDTH,
HV_MIGRATION_MODE,
+ HV_XEN_CMD,
])
BEC_DEFAULTS = {
])
DISK_LD_DEFAULTS = {
- LD_DRBD8: {
+ DT_DRBD8: {
LDP_RESYNC_RATE: CLASSIC_DRBD_SYNC_SPEED,
LDP_BARRIERS: _autoconf.DRBD_BARRIERS,
LDP_NO_META_FLUSH: _autoconf.DRBD_NO_META_FLUSH,
LDP_DEFAULT_METAVG: DEFAULT_VG,
LDP_DISK_CUSTOM: "",
LDP_NET_CUSTOM: "",
+ LDP_PROTOCOL: DRBD_DEFAULT_NET_PROTOCOL,
LDP_DYNAMIC_RESYNC: False,
- # The default values for the DRBD dynamic resync speed algorithm are taken
- # from the drbsetup 8.3.11 man page, except for c-plan-ahead (that we
- # don't need to set to 0, because we have a separate option to enable it)
- # and for c-max-rate, that we cap to the default value for the static resync
- # rate.
+ # The default values for the DRBD dynamic resync speed algorithm
+ # are taken from the drbsetup 8.3.11 man page, except for
+ # c-plan-ahead (that we don't need to set to 0, because we have a
+ # separate option to enable it) and for c-max-rate, that we cap to
+ # the default value for the static resync rate.
LDP_PLAN_AHEAD: 20, # ds
LDP_FILL_TARGET: 0, # sectors
LDP_DELAY_TARGET: 1, # ds
LDP_MAX_RATE: CLASSIC_DRBD_SYNC_SPEED, # KiB/s
LDP_MIN_RATE: 4 * 1024, # KiB/s
},
- LD_LV: {
+ DT_PLAIN: {
LDP_STRIPES: _autoconf.LVM_STRIPECOUNT
},
- LD_FILE: {},
- LD_BLOCKDEV: {},
- LD_RBD: {
+ DT_FILE: {},
+ DT_SHARED_FILE: {},
+ DT_BLOCK: {},
+ DT_RBD: {
LDP_POOL: "rbd"
},
- LD_EXT: {},
+ DT_EXT: {},
}
# readability shortcuts
-_LV_DEFAULTS = DISK_LD_DEFAULTS[LD_LV]
-_DRBD_DEFAULTS = DISK_LD_DEFAULTS[LD_DRBD8]
+_LV_DEFAULTS = DISK_LD_DEFAULTS[DT_PLAIN]
+_DRBD_DEFAULTS = DISK_LD_DEFAULTS[DT_DRBD8]
DISK_DT_DEFAULTS = {
DT_PLAIN: {
- LV_STRIPES: DISK_LD_DEFAULTS[LD_LV][LDP_STRIPES],
+ LV_STRIPES: DISK_LD_DEFAULTS[DT_PLAIN][LDP_STRIPES],
},
DT_DRBD8: {
DRBD_RESYNC_RATE: _DRBD_DEFAULTS[LDP_RESYNC_RATE],
DRBD_DEFAULT_METAVG: _DRBD_DEFAULTS[LDP_DEFAULT_METAVG],
DRBD_DISK_CUSTOM: _DRBD_DEFAULTS[LDP_DISK_CUSTOM],
DRBD_NET_CUSTOM: _DRBD_DEFAULTS[LDP_NET_CUSTOM],
+ DRBD_PROTOCOL: _DRBD_DEFAULTS[LDP_PROTOCOL],
DRBD_DYNAMIC_RESYNC: _DRBD_DEFAULTS[LDP_DYNAMIC_RESYNC],
DRBD_PLAN_AHEAD: _DRBD_DEFAULTS[LDP_PLAN_AHEAD],
DRBD_FILL_TARGET: _DRBD_DEFAULTS[LDP_FILL_TARGET],
DT_SHARED_FILE: {},
DT_BLOCK: {},
DT_RBD: {
- RBD_POOL: DISK_LD_DEFAULTS[LD_RBD][LDP_POOL]
+ RBD_POOL: DISK_LD_DEFAULTS[DT_RBD][LDP_POOL]
},
DT_EXT: {},
}
# 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,
ISPEC_NIC_COUNT: 1,
ISPEC_SPINDLE_USE: 1,
},
- IPOLICY_DTS: DISK_TEMPLATES,
+ IPOLICY_DTS: list(DISK_TEMPLATES),
IPOLICY_VCPU_RATIO: 4.0,
IPOLICY_SPINDLE_RATIO: 32.0,
}
CONFD_REQ_MC_PIP_LIST = 5
CONFD_REQ_INSTANCES_IPS_LIST = 6
CONFD_REQ_NODE_DRBD = 7
+CONFD_REQ_NODE_INSTANCES = 8
# Confd request query fields. These are used to narrow down queries.
# These must be strings rather than integers, because json-encoding
# The version identifier for builtin data collectors
BUILTIN_DATA_COLLECTOR_VERSION = "B"
+# The reason trail opcode parameter name
+OPCODE_REASON = "reason"
+
+# 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"
+
+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,
+ ])
+
+DISKSTATS_FILE = "/proc/diskstats"
+
# Do not re-export imported modules
del re, _vcsversion, _autoconf, socket, pathutils, compat