WATCHER_PAUSEFILE = DATA_DIR + "/watcher.pause"
INSTANCE_UPFILE = RUN_GANETI_DIR + "/instance-status"
SSH_KNOWN_HOSTS_FILE = DATA_DIR + "/known_hosts"
-RAPI_USERS_FILE = DATA_DIR + "/rapi_users"
+RAPI_USERS_FILE = DATA_DIR + "/rapi/users"
QUEUE_DIR = DATA_DIR + "/queue"
DAEMON_UTIL = _autoconf.PKGLIBDIR + "/daemon-util"
SETUP_SSH = _autoconf.TOOLSDIR + "/setup-ssh"
# Ciphers allowed for SSL connections. For the format, see ciphers(1). A better
# way to disable ciphers would be to use the exclamation mark (!), but socat
# versions below 1.5 can't parse exclamation marks in options properly. When
-# modifying the ciphers, ensure to not accidentially add something after it's
+# modifying the ciphers, ensure not to accidentially add something after it's
# been removed. Use the "openssl" utility to check the allowed ciphers, e.g.
# "openssl ciphers -v HIGH:-DES".
OPENSSL_CIPHERS = "HIGH:-DES:-3DES:-EXPORT:-ADH"
# hooks subject type (what object type does the LU deal with)
HTYPE_CLUSTER = "CLUSTER"
HTYPE_NODE = "NODE"
+HTYPE_GROUP = "GROUP"
HTYPE_INSTANCE = "INSTANCE"
HKR_SKIP = 0
EXIT_NODESETUP_ERROR = 12
EXIT_CONFIRMATION = 13 # need user confirmation
+#: Exit code for query operations with unknown fields
+EXIT_UNKNOWN_FIELD = 14
+
# tags
TAG_CLUSTER = "cluster"
TAG_NODE = "node"
NODE_MAX_CLOCK_SKEW = 150
# Time for an intra-cluster disk transfer to wait for a connection
DISK_TRANSFER_CONNECT_TIMEOUT = 30
+# Disk index separator
+DISK_SEPARATOR = _autoconf.DISK_SEPARATOR
# runparts results
(RUNPARTS_SKIP,
HV_KVM_USE_CHROOT = "use_chroot"
HV_CPU_MASK = "cpu_mask"
HV_MEM_PATH = "mem_path"
+HV_BLOCKDEV_PREFIX = "blockdev_prefix"
HVS_PARAMETER_TYPES = {
HV_BOOT_ORDER: VTYPE_STRING,
HV_KVM_USE_CHROOT: VTYPE_BOOL,
HV_CPU_MASK: VTYPE_STRING,
HV_MEM_PATH: VTYPE_STRING,
+ HV_BLOCKDEV_PREFIX: VTYPE_STRING,
}
HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys())
NDS_PARAMETERS = frozenset(NDS_PARAMETER_TYPES.keys())
+# OOB supported commands
+OOB_POWER_ON = "power-on"
+OOB_POWER_OFF = "power-off"
+OOB_POWER_CYCLE = "power-cycle"
+OOB_POWER_STATUS = "power-status"
+OOB_HEALTH = "health"
+
+OOB_COMMANDS = frozenset([OOB_POWER_ON, OOB_POWER_OFF, OOB_POWER_CYCLE,
+ OOB_POWER_STATUS, OOB_HEALTH])
+
+OOB_POWER_STATUS_POWERED = "powered"
+
+OOB_TIMEOUT = 60 # 60 seconds
+
+OOB_STATUS_OK = "OK"
+OOB_STATUS_WARNING = "WARNING"
+OOB_STATUS_CRITICAL = "CRITICAL"
+OOB_STATUS_UNKNOWN = "UNKNOWN"
+
+OOB_STATUSES = frozenset([
+ OOB_STATUS_OK,
+ OOB_STATUS_WARNING,
+ OOB_STATUS_CRITICAL,
+ OOB_STATUS_UNKNOWN,
+ ])
+
# Instance Parameters Profile
PP_DEFAULT = "default"
NV_VERSION = "version"
NV_VGLIST = "vglist"
NV_VMNODES = "vmnodes"
+NV_OOB_PATHS = "oob-paths"
# SSL certificate check constants (in days)
SSL_CERT_EXPIRATION_WARN = 30
JQT_STARTMSG,
])
+# Query resources
+QR_INSTANCE = "instance"
+QR_NODE = "node"
+QR_LOCK = "lock"
+
+#: List of resources which can be queried using L{opcodes.OpQuery}
+QR_OP_QUERY = frozenset([QR_INSTANCE, QR_NODE])
+
+#: List of resources which can be queried using LUXI
+QR_OP_LUXI = QR_OP_QUERY.union([
+ QR_LOCK,
+ ])
+
+# Query field types
+QFT_UNKNOWN = "unknown"
+QFT_TEXT = "text"
+QFT_BOOL = "bool"
+QFT_NUMBER = "number"
+QFT_UNIT = "unit"
+QFT_TIMESTAMP = "timestamp"
+QFT_OTHER = "other"
+
+#: All query field types
+QFT_ALL = frozenset([
+ QFT_UNKNOWN,
+ QFT_TEXT,
+ QFT_BOOL,
+ QFT_NUMBER,
+ QFT_UNIT,
+ QFT_TIMESTAMP,
+ QFT_OTHER,
+ ])
+
+# Query result field status (don't change or reuse values as they're used by
+# clients)
+#: Normal field status
+QRFS_NORMAL = 0
+#: Unknown field
+QRFS_UNKNOWN = 1
+#: No data (e.g. RPC error), can be used instead of L{QRFS_OFFLINE}
+QRFS_NODATA = 2
+#: Value unavailable for item
+QRFS_UNAVAIL = 3
+#: Resource marked offline
+QRFS_OFFLINE = 4
+
+QRFS_ALL = frozenset([
+ QRFS_NORMAL,
+ QRFS_UNKNOWN,
+ QRFS_NODATA,
+ QRFS_UNAVAIL,
+ QRFS_OFFLINE,
+ ])
+
# max dynamic devices
MAX_NICS = 8
MAX_DISKS = 16
HV_KERNEL_ARGS: 'ro',
HV_MIGRATION_PORT: 8002,
HV_MIGRATION_MODE: HT_MIGRATION_LIVE,
+ HV_BLOCKDEV_PREFIX: "sd",
},
HT_XEN_HVM: {
HV_BOOT_ORDER: "cd",
HV_MIGRATION_PORT: 8002,
HV_MIGRATION_MODE: HT_MIGRATION_NONLIVE,
HV_USE_LOCALTIME: False,
+ HV_BLOCKDEV_PREFIX: "hd",
},
HT_KVM: {
HV_KERNEL_PATH: "/boot/vmlinuz-2.6-kvmU",
# Name or path of the pgrep command
PGREP = "pgrep"
+
+# Name of the node group that gets created at cluster init or upgrade
+INITIAL_NODE_GROUP_NAME = "default"
+
+# Possible values for NodeGroup.alloc_policy
+ALLOC_POLICY_PREFERRED = "preferred"
+ALLOC_POLICY_LAST_RESORT = "last_resort"
+ALLOC_POLICY_UNALLOCABLE = "unallocable"
+VALID_ALLOC_POLICIES = [
+ ALLOC_POLICY_PREFERRED,
+ ALLOC_POLICY_LAST_RESORT,
+ ALLOC_POLICY_UNALLOCABLE,
+ ]