# user separation
DAEMONS_GROUP = _autoconf.DAEMONS_GROUP
+ADMIN_GROUP = _autoconf.ADMIN_GROUP
MASTERD_USER = _autoconf.MASTERD_USER
+MASTERD_GROUP = _autoconf.MASTERD_GROUP
RAPI_USER = _autoconf.RAPI_USER
+RAPI_GROUP = _autoconf.RAPI_GROUP
+CONFD_USER = _autoconf.CONFD_USER
+CONFD_GROUP = _autoconf.CONFD_GROUP
+NODED_USER = _autoconf.NODED_USER
# file paths
DATA_DIR = _autoconf.LOCALSTATEDIR + "/lib/ganeti"
RAPI_USERS_FILE = DATA_DIR + "/rapi_users"
QUEUE_DIR = DATA_DIR + "/queue"
DAEMON_UTIL = _autoconf.PKGLIBDIR + "/daemon-util"
+SETUP_SSH = _autoconf.TOOLSDIR + "/setup-ssh"
ETC_HOSTS = "/etc/hosts"
DEFAULT_FILE_STORAGE_DIR = _autoconf.FILE_STORAGE_DIR
ENABLE_FILE_STORAGE = _autoconf.ENABLE_FILE_STORAGE
# Digest used to sign certificates ("openssl x509" uses SHA1 by default)
X509_CERT_SIGN_DIGEST = "SHA1"
+# Default validity of certificates in days
+X509_CERT_DEFAULT_VALIDITY = 365 * 5
+
+# commonName (CN) used in certificates
+X509_CERT_CN = "ganeti.example.com"
+
X509_CERT_SIGNATURE_HEADER = "X-Ganeti-Signature"
IMPORT_EXPORT_DAEMON = _autoconf.PKGLIBDIR + "/import-export"
INISECT_OSP = "os"
# dynamic device modification
-DDM_ADD = 'add'
-DDM_REMOVE = 'remove'
+DDM_ADD = "add"
+DDM_REMOVE = "remove"
+DDMS_VALUES = frozenset([DDM_ADD, DDM_REMOVE])
# common exit codes
EXIT_SUCCESS = 0
IP4_ADDRESS_ANY = "0.0.0.0"
IP6_ADDRESS_LOCALHOST = "::1"
IP6_ADDRESS_ANY = "::"
+IP4_VERSION = 4
+IP6_VERSION = 6
TCP_PING_TIMEOUT = 10
GANETI_RUNAS = "root"
DEFAULT_VG = "xenvg"
INSTANCE_REBOOT_FULL])
VTYPE_STRING = 'string'
+VTYPE_MAYBE_STRING = "maybe-string"
VTYPE_BOOL = 'bool'
VTYPE_SIZE = 'size' # size, in MiBs
VTYPE_INT = 'int'
ENFORCEABLE_TYPES = frozenset([
VTYPE_STRING,
+ VTYPE_MAYBE_STRING,
VTYPE_BOOL,
VTYPE_SIZE,
VTYPE_INT,
HV_MIGRATION_PORT = "migration_port"
HV_MIGRATION_BANDWIDTH = "migration_bandwidth"
HV_MIGRATION_DOWNTIME = "migration_downtime"
-HV_MIGRATION_TYPE = "migration_type"
+HV_MIGRATION_MODE = "migration_mode"
HV_USE_LOCALTIME = "use_localtime"
HV_DISK_CACHE = "disk_cache"
HV_SECURITY_MODEL = "security_model"
HV_VHOST_NET = "vhost_net"
HV_KVM_USE_CHROOT = "use_chroot"
HV_CPU_MASK = "cpu_mask"
+HV_MEM_PATH = "mem_path"
HVS_PARAMETER_TYPES = {
HV_BOOT_ORDER: VTYPE_STRING,
HV_MIGRATION_PORT: VTYPE_INT,
HV_MIGRATION_BANDWIDTH: VTYPE_INT,
HV_MIGRATION_DOWNTIME: VTYPE_INT,
- HV_MIGRATION_TYPE: VTYPE_STRING,
+ HV_MIGRATION_MODE: VTYPE_STRING,
HV_USE_LOCALTIME: VTYPE_BOOL,
HV_DISK_CACHE: VTYPE_STRING,
HV_SECURITY_MODEL: VTYPE_STRING,
HV_VHOST_NET: VTYPE_BOOL,
HV_KVM_USE_CHROOT: VTYPE_BOOL,
HV_CPU_MASK: VTYPE_STRING,
+ HV_MEM_PATH: VTYPE_STRING,
}
HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys())
IDISK_SIZE = "size"
IDISK_MODE = "mode"
IDISK_ADOPT = "adopt"
-IDISK_PARAMS = frozenset([IDISK_SIZE, IDISK_MODE, IDISK_ADOPT])
IDISK_PARAMS_TYPES = {
IDISK_SIZE: VTYPE_SIZE,
IDISK_MODE: VTYPE_STRING,
IDISK_ADOPT: VTYPE_STRING,
}
+IDISK_PARAMS = frozenset(IDISK_PARAMS_TYPES.keys())
+
INIC_MAC = "mac"
INIC_IP = "ip"
INIC_MODE = "mode"
INIC_LINK = "link"
INIC_BRIDGE = "bridge"
-INIC_PARAMS = frozenset([INIC_MAC, INIC_IP, INIC_MODE, INIC_LINK, INIC_BRIDGE])
-INIC_PARAMS_TYPES = dict([(name, VTYPE_STRING) for name in INIC_PARAMS])
+INIC_PARAMS_TYPES = {
+ INIC_BRIDGE: VTYPE_STRING,
+ INIC_IP: VTYPE_MAYBE_STRING,
+ INIC_LINK: VTYPE_STRING,
+ INIC_MAC: VTYPE_STRING,
+ INIC_MODE: VTYPE_STRING,
+ }
+INIC_PARAMS = frozenset(INIC_PARAMS_TYPES.keys())
# Hypervisor constants
HT_XEN_PVM = "xen-pvm"
# Migration type
HT_MIGRATION_LIVE = "live"
HT_MIGRATION_NONLIVE = "non-live"
-HT_MIGRATION_TYPES = frozenset([HT_MIGRATION_LIVE, HT_MIGRATION_NONLIVE])
+HT_MIGRATION_MODES = frozenset([HT_MIGRATION_LIVE, HT_MIGRATION_NONLIVE])
# Cluster Verify steps
VERIFY_NPLUSONE_MEM = 'nplusone_mem'
JOB_STATUS_SUCCESS,
JOB_STATUS_ERROR,
])
+JOB_STATUS_ALL = frozenset([
+ JOB_STATUS_QUEUED,
+ JOB_STATUS_WAITLOCK,
+ JOB_STATUS_CANCELING,
+ JOB_STATUS_RUNNING,
+ ]) | JOBS_FINALIZED
# OpCode status
# not yet finalized
OP_STATUS_SUCCESS,
OP_STATUS_ERROR])
+# OpCode priority
+OP_PRIO_LOWEST = +19
+OP_PRIO_HIGHEST = -20
+
+OP_PRIO_LOW = +10
+OP_PRIO_NORMAL = 0
+OP_PRIO_HIGH = -10
+
+OP_PRIO_SUBMIT_VALID = frozenset([
+ OP_PRIO_LOW,
+ OP_PRIO_NORMAL,
+ OP_PRIO_HIGH,
+ ])
+
+OP_PRIO_DEFAULT = OP_PRIO_NORMAL
+
# Execution log types
ELOG_MESSAGE = "message"
ELOG_PROGRESS = "progress"
ELOG_REMOTE_IMPORT = "remote-import"
ELOG_JQUEUE_TEST = "jqueue-test"
+# /etc/hosts modification
+ETC_HOSTS_ADD = "add"
+ETC_HOSTS_REMOVE = "remove"
+
# Job queue test
JQT_MSGPREFIX = "TESTMSG="
JQT_EXPANDNAMES = "expandnames"
JQT_EXEC = "exec"
JQT_LOGMSG = "logmsg"
+JQT_STARTMSG = "startmsg"
JQT_ALL = frozenset([
JQT_EXPANDNAMES,
JQT_EXEC,
JQT_LOGMSG,
+ JQT_STARTMSG,
])
# max dynamic devices
SS_NODE_SECONDARY_IPS = "node_secondary_ips"
SS_OFFLINE_NODES = "offline_nodes"
SS_ONLINE_NODES = "online_nodes"
+SS_PRIMARY_IP_FAMILY = "primary_ip_family"
SS_INSTANCE_LIST = "instance_list"
SS_RELEASE_VERSION = "release_version"
SS_HYPERVISOR_LIST = "hypervisor_list"
SS_MAINTAIN_NODE_HEALTH = "maintain_node_health"
SS_UID_POOL = "uid_pool"
+SS_NODEGROUPS = "nodegroups"
# cluster wide default parameters
DEFAULT_ENABLED_HYPERVISOR = HT_XEN_PVM
HV_ROOT_PATH: '/dev/sda1',
HV_KERNEL_ARGS: 'ro',
HV_MIGRATION_PORT: 8002,
- HV_MIGRATION_TYPE: HT_MIGRATION_LIVE,
+ HV_MIGRATION_MODE: HT_MIGRATION_LIVE,
},
HT_XEN_HVM: {
HV_BOOT_ORDER: "cd",
HV_KERNEL_PATH: "/usr/lib/xen/boot/hvmloader",
HV_DEVICE_MODEL: "/usr/lib/xen/bin/qemu-dm",
HV_MIGRATION_PORT: 8002,
- HV_MIGRATION_TYPE: HT_MIGRATION_NONLIVE,
+ HV_MIGRATION_MODE: HT_MIGRATION_NONLIVE,
HV_USE_LOCALTIME: False,
},
HT_KVM: {
HV_MIGRATION_PORT: 8102,
HV_MIGRATION_BANDWIDTH: 32, # MiB/s
HV_MIGRATION_DOWNTIME: 30, # ms
- HV_MIGRATION_TYPE: HT_MIGRATION_LIVE,
+ HV_MIGRATION_MODE: HT_MIGRATION_LIVE,
HV_USE_LOCALTIME: False,
HV_DISK_CACHE: HT_CACHE_DEFAULT,
HV_SECURITY_MODEL: HT_SM_NONE,
HV_KVM_FLAG: "",
HV_VHOST_NET: False,
HV_KVM_USE_CHROOT: False,
+ HV_MEM_PATH: "",
},
HT_FAKE: {
},
HVC_GLOBALS = frozenset([
HV_MIGRATION_PORT,
HV_MIGRATION_BANDWIDTH,
- HV_MIGRATION_TYPE,
+ HV_MIGRATION_MODE,
])
BEC_DEFAULTS = {