CRYPTO_KEYS_DIR_MODE = SECURE_DIR_MODE
IMPORT_EXPORT_DIR = RUN_GANETI_DIR + "/import-export"
IMPORT_EXPORT_DIR_MODE = 0755
+ADOPTABLE_BLOCKDEV_ROOT = "/dev/disk/"
# keep RUN_GANETI_DIR first here, to make sure all get created when the node
# daemon is started (this takes care of RUN_DIR being tmpfs)
SUB_RUN_DIRS = [ RUN_GANETI_DIR, BDEV_CACHE_DIR, DISK_LINKS_DIR ]
KVM_IFUP = _autoconf.PKGLIBDIR + "/kvm-ifup"
ETC_HOSTS = "/etc/hosts"
DEFAULT_FILE_STORAGE_DIR = _autoconf.FILE_STORAGE_DIR
+DEFAULT_SHARED_FILE_STORAGE_DIR = _autoconf.SHARED_FILE_STORAGE_DIR
ENABLE_FILE_STORAGE = _autoconf.ENABLE_FILE_STORAGE
+ENABLE_SHARED_FILE_STORAGE = _autoconf.ENABLE_SHARED_FILE_STORAGE
SYSCONFDIR = _autoconf.SYSCONFDIR
TOOLSDIR = _autoconf.TOOLSDIR
CONF_DIR = SYSCONFDIR + "/ganeti"
DT_PLAIN = "plain"
DT_DRBD8 = "drbd"
DT_FILE = "file"
+DT_SHARED_FILE = "sharedfile"
+DT_BLOCK = "blockdev"
# the set of network-mirrored disk templates
-DTS_NET_MIRROR = frozenset([DT_DRBD8])
+DTS_INT_MIRROR = frozenset([DT_DRBD8])
+
+# the set of externally-mirrored disk templates (e.g. SAN, NAS)
+DTS_EXT_MIRROR = frozenset([DT_SHARED_FILE, DT_BLOCK])
# the set of non-lvm-based disk templates
-DTS_NOT_LVM = frozenset([DT_DISKLESS, DT_FILE])
+DTS_NOT_LVM = frozenset([DT_DISKLESS, DT_FILE, DT_SHARED_FILE, DT_BLOCK])
# the set of disk templates which can be grown
-DTS_GROWABLE = frozenset([DT_PLAIN, DT_DRBD8, DT_FILE])
+DTS_GROWABLE = frozenset([DT_PLAIN, DT_DRBD8, DT_FILE, DT_SHARED_FILE])
# the set of disk templates that allow adoption
-DTS_MAY_ADOPT = frozenset([DT_PLAIN])
+DTS_MAY_ADOPT = frozenset([DT_PLAIN, DT_BLOCK])
+
+# the set of disk templates that *must* use adoption
+DTS_MUST_ADOPT = frozenset([DT_BLOCK])
+
+# the set of disk templates that allow migrations
+DTS_MIRRORED = frozenset.union(DTS_INT_MIRROR, DTS_EXT_MIRROR)
+
# logical disk types
LD_LV = "lvm"
LD_DRBD8 = "drbd8"
LD_FILE = "file"
-LDS_BLOCK = frozenset([LD_LV, LD_DRBD8])
+LD_BLOCKDEV = "blockdev"
+LDS_BLOCK = frozenset([LD_LV, LD_DRBD8, LD_BLOCKDEV])
# drbd constants
DRBD_HMAC_ALG = "md5"
#: Give child process up to 5 seconds to exit after sending a signal
CHILD_LINGER_TIMEOUT = 5.0
-DISK_TEMPLATES = frozenset([DT_DISKLESS, DT_PLAIN,
- DT_DRBD8, DT_FILE])
+DISK_TEMPLATES = frozenset([DT_DISKLESS, DT_PLAIN, DT_DRBD8,
+ DT_FILE, DT_SHARED_FILE, DT_BLOCK])
FILE_DRIVER = frozenset([FD_LOOP, FD_BLKTAP])
# tags
TAG_CLUSTER = "cluster"
+TAG_NODEGROUP = "nodegroup"
TAG_NODE = "node"
TAG_INSTANCE = "instance"
VALID_TAG_TYPES = frozenset([
TAG_CLUSTER,
+ TAG_NODEGROUP,
TAG_NODE,
TAG_INSTANCE,
])
# Disk index separator
DISK_SEPARATOR = _autoconf.DISK_SEPARATOR
+#: Key for job IDs in opcode result
+JOB_IDS_KEY = "jobs"
+
# runparts results
(RUNPARTS_SKIP,
RUNPARTS_RUN,
OOB_POWER_STATUS_POWERED = "powered"
OOB_TIMEOUT = 60 # 60 seconds
+OOB_POWER_DELAY = 2.0 # 2 seconds
OOB_STATUS_OK = "OK"
OOB_STATUS_WARNING = "WARNING"
# Instance Parameters Profile
PP_DEFAULT = "default"
+# NIC_* constants are used inside the ganeti config
NIC_MODE = "mode"
NIC_LINK = "link"
NICS_PARAMETERS = frozenset(NICS_PARAMETER_TYPES.keys())
+# IDISK_* constants are used in opcodes, to create/change disks
IDISK_SIZE = "size"
IDISK_MODE = "mode"
IDISK_ADOPT = "adopt"
}
IDISK_PARAMS = frozenset(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_BRIDGE = "bridge"
INIC_PARAMS_TYPES = {
- INIC_BRIDGE: VTYPE_STRING,
INIC_IP: VTYPE_MAYBE_STRING,
INIC_LINK: VTYPE_STRING,
INIC_MAC: VTYPE_STRING,
NV_OOB_PATHS = "oob-paths"
NV_BRIDGES = "bridges"
+# Instance status
+INSTST_RUNNING = "running"
+INSTST_ADMINDOWN = "ADMIN_down"
+INSTST_NODEOFFLINE = "ERROR_nodeoffline"
+INSTST_NODEDOWN = "ERROR_nodedown"
+INSTST_WRONGNODE = "ERROR_wrongnode"
+INSTST_ERRORUP = "ERROR_up"
+INSTST_ERRORDOWN = "ERROR_down"
+INSTST_ALL = frozenset([
+ INSTST_RUNNING,
+ INSTST_ADMINDOWN,
+ INSTST_NODEOFFLINE,
+ INSTST_NODEDOWN,
+ INSTST_WRONGNODE,
+ INSTST_ERRORUP,
+ INSTST_ERRORDOWN,
+ ])
+
+# Node roles
+NR_REGULAR = "R"
+NR_MASTER = "M"
+NR_MCANDIDATE = "C"
+NR_DRAINED = "D"
+NR_OFFLINE = "O"
+NR_ALL = frozenset([
+ NR_REGULAR,
+ NR_MASTER,
+ NR_MCANDIDATE,
+ NR_DRAINED,
+ NR_OFFLINE,
+ ])
+
# SSL certificate check constants (in days)
SSL_CERT_EXPIRATION_WARN = 30
SSL_CERT_EXPIRATION_ERROR = 7
IALLOCATOR_MODE_ALLOC = "allocate"
IALLOCATOR_MODE_RELOC = "relocate"
IALLOCATOR_MODE_MEVAC = "multi-evacuate"
+IALLOCATOR_MODE_MRELOC = "multi-relocate"
VALID_IALLOCATOR_MODES = frozenset([
IALLOCATOR_MODE_ALLOC,
IALLOCATOR_MODE_RELOC,
IALLOCATOR_MODE_MEVAC,
+ IALLOCATOR_MODE_MRELOC,
])
IALLOCATOR_SEARCH_PATH = _autoconf.IALLOCATOR_SEARCH_PATH
+IALLOCATOR_MRELOC_ANY = "any_group"
+IALLOCATOR_MRELOC_CHANGE = "change_group"
+IALLOCATOR_MRELOC_KEEP = "keep_group"
+IALLOCATOR_MRELOC_MODES = frozenset([
+ IALLOCATOR_MRELOC_ANY,
+ IALLOCATOR_MRELOC_CHANGE,
+ IALLOCATOR_MRELOC_KEEP,
+ ])
+
# Job queue
JOB_QUEUE_VERSION = 1
JOB_QUEUE_LOCK_FILE = QUEUE_DIR + "/lock"
QR_NODE = "node"
QR_LOCK = "lock"
QR_GROUP = "group"
+QR_OS = "os"
#: List of resources which can be queried using L{opcodes.OpQuery}
-QR_OP_QUERY = frozenset([QR_INSTANCE, QR_NODE, QR_GROUP])
+QR_VIA_OP = frozenset([QR_INSTANCE, QR_NODE, QR_GROUP, QR_OS])
#: List of resources which can be queried using Local UniX Interface
-QR_OP_LUXI = QR_OP_QUERY.union([
+QR_VIA_LUXI = QR_VIA_OP.union([
QR_LOCK,
])
+#: List of resources which can be queried using RAPI
+QR_VIA_RAPI = QR_VIA_LUXI
+
# Query field types
QFT_UNKNOWN = "unknown"
QFT_TEXT = "text"
SS_CLUSTER_NAME = "cluster_name"
SS_CLUSTER_TAGS = "cluster_tags"
SS_FILE_STORAGE_DIR = "file_storage_dir"
+SS_SHARED_FILE_STORAGE_DIR = "shared_file_storage_dir"
SS_MASTER_CANDIDATES = "master_candidates"
SS_MASTER_CANDIDATES_IPS = "master_candidates_ips"
SS_MASTER_IP = "master_ip"
ALLOC_POLICY_LAST_RESORT,
ALLOC_POLICY_UNALLOCABLE,
]
+
+# Temporary external/shared storage parameters
+BLOCKDEV_DRIVER_MANUAL = "manual"
+
+# Whether htools was enabled at compilation time
+HTOOLS = _autoconf.HTOOLS
+# The hail iallocator
+IALLOC_HAIL = "hail"