# various versions
PROTOCOL_VERSION = 13
RELEASE_VERSION = _autoconf.PACKAGE_VERSION
-OS_API_VERSION = 5
+OS_API_VERSION = 10
EXPORT_VERSION = 0
RAPI_VERSION = 2
SSL_CERT_FILE = DATA_DIR + "/server.pem"
WATCHER_STATEFILE = DATA_DIR + "/watcher.data"
SSH_KNOWN_HOSTS_FILE = DATA_DIR + "/known_hosts"
+CLUSTER_PASSWORD_FILE = DATA_DIR + "/ssconf_node_pass"
QUEUE_DIR = DATA_DIR + "/queue"
ETC_HOSTS = "/etc/hosts"
DEFAULT_FILE_STORAGE_DIR = _autoconf.FILE_STORAGE_DIR
-MASTER_SOCKET = RUN_GANETI_DIR + "/master.sock"
+
+# Quoting unix(7) on Linux:
+# Linux also supports an abstract namespace which is independent of the file
+# system. [...] If sun_path starts with a null byte ('\0'), then it refers to
+# the abstract namespace maintained by the Unix protocol module. The socket's
+# address in this namespace is given by the rest of the bytes in sun_path.
+#
+# By using this Linux-specific way we don't have to care about removing the
+# socket file when quitting or starting (after an unclean shutdown).
+#
+# Sample output for "netstat -nlp":
+# unix 2 [ ACC ] STREAM LISTENING 247919 1234/python @ganeti-master
+MASTER_SOCKET = "\0ganeti-master"
# PID files
MASTERD_PID = "ganeti-masterd"
LOG_WATCHER = LOG_DIR + "watcher.log"
LOG_MASTERDAEMON = LOG_DIR + "master-daemon.log"
LOG_RAPISERVER = LOG_DIR + "rapi-daemon.log"
-LOG_RAPIACCESS = LOG_DIR + "rapi-access.log"
LOG_COMMANDS = LOG_DIR + "commands.log"
+LOG_BURNIN = LOG_DIR + "burnin.log"
OS_SEARCH_PATH = _autoconf.OS_SEARCH_PATH
EXPORT_DIR = _autoconf.EXPORT_DIR
XEN_KERNEL = _autoconf.XEN_KERNEL
XEN_INITRD = _autoconf.XEN_INITRD
+KVM_PATH = _autoconf.KVM_PATH
+
VALUE_DEFAULT = "default"
+VALUE_AUTO = "auto"
+VALUE_GENERATE = "generate"
VALUE_NONE = "none"
# hooks-related constants
LD_LV = "lvm"
LD_DRBD8 = "drbd8"
LD_FILE = "file"
+LDS_BLOCK = frozenset([LD_LV, LD_DRBD8])
+
+# drbd constants
+DRBD_HMAC_ALG = "md5"
+DRBD_NET_PROTOCOL = "C"
# file backend driver
FD_LOOP = "loop"
REPLACE_DISK_SEC = "replace_secondary"
REPLACE_DISK_ALL = "replace_all"
+# lock recalculate mode
+LOCKS_REPLACE = 'replace'
+LOCKS_APPEND = 'append'
+
# instance creation modes
INSTANCE_CREATE = "create"
INSTANCE_IMPORT = "import"
BIND_ADDRESS_GLOBAL = "0.0.0.0"
MIN_VG_SIZE = 20480
-# valid os status
+# os related constants
OS_VALID_STATUS = "VALID"
+OS_SCRIPT_CREATE = 'create'
+OS_SCRIPT_IMPORT = 'import'
+OS_SCRIPT_EXPORT = 'export'
+OS_SCRIPT_RENAME = 'rename'
+OS_SCRIPTS = frozenset([OS_SCRIPT_CREATE, OS_SCRIPT_IMPORT,
+ OS_SCRIPT_EXPORT, OS_SCRIPT_RENAME])
# ssh constants
SSH_INITD_SCRIPT = _autoconf.SSH_INITD_SCRIPT
INSTANCE_REBOOT_HARD = "hard"
INSTANCE_REBOOT_FULL = "full"
+# HV parameter names (global namespace)
+HV_BOOT_ORDER = "boot_order"
+HV_CDROM_IMAGE_PATH = "cdrom_image_path"
+HV_NIC_TYPE = "nic_type"
+HV_DISK_TYPE = "disk_type"
+HV_VNC_BIND_ADDRESS = "vnc_bind_address"
+HV_ACPI = "acpi"
+HV_PAE = "pae"
+HV_KERNEL_PATH = "kernel_path"
+HV_INITRD_PATH = "initrd_path"
+
+HVS_PARAMETERS = frozenset([
+ HV_BOOT_ORDER,
+ HV_CDROM_IMAGE_PATH,
+ HV_NIC_TYPE,
+ HV_DISK_TYPE,
+ HV_VNC_BIND_ADDRESS,
+ HV_ACPI,
+ HV_PAE,
+ HV_KERNEL_PATH,
+ HV_INITRD_PATH,
+ ])
+
+# BE parameter names
+BE_MEMORY = "memory"
+BE_VCPUS = "vcpus"
+BE_AUTO_BALANCE = "auto_balance"
+
+BES_PARAMETERS = frozenset([
+ BE_MEMORY,
+ BE_VCPUS,
+ BE_AUTO_BALANCE,
+ ])
+
+# BE GROUP
+BEGR_DEFAULT = "default"
+
# Hypervisor constants
-HT_XEN_PVM30 = "xen-3.0"
+HT_XEN_PVM = "xen-pvm"
HT_FAKE = "fake"
-HT_XEN_HVM31 = "xen-hvm-3.1"
-HYPER_TYPES = frozenset([HT_XEN_PVM30, HT_FAKE, HT_XEN_HVM31])
-HTS_REQ_PORT = frozenset([HT_XEN_HVM31])
+HT_XEN_HVM = "xen-hvm"
+HT_KVM = "kvm"
+HYPER_TYPES = frozenset([HT_XEN_PVM, HT_FAKE, HT_XEN_HVM, HT_KVM])
+HTS_REQ_PORT = frozenset([HT_XEN_HVM])
HT_HVM_VNC_BASE_PORT = 5900
HT_HVM_DEFAULT_BOOT_ORDER = 'dc'
VNC_PASSWORD_FILE = _autoconf.SYSCONFDIR + "/ganeti/vnc-cluster-password"
VNC_DEFAULT_BIND_ADDRESS = '0.0.0.0'
+# HVM NIC types
+HT_HVM_NIC_RTL8139 = "rtl8139"
+HT_HVM_NIC_NE2K_PCI = "ne2k_pci"
+HT_HVM_NIC_NE2K_ISA = "ne2k_isa"
+HT_HVM_DEV_PARAVIRTUAL = "paravirtual"
+HT_HVM_DEV_IOEMU = "ioemu"
+HT_HVM_VALID_NIC_TYPES = frozenset([HT_HVM_NIC_RTL8139, HT_HVM_NIC_NE2K_PCI,
+ HT_HVM_NIC_NE2K_ISA,
+ HT_HVM_DEV_PARAVIRTUAL])
+HT_HVM_VALID_DISK_TYPES = frozenset([HT_HVM_DEV_PARAVIRTUAL, HT_HVM_DEV_IOEMU])
+
# Cluster Verify steps
VERIFY_NPLUSONE_MEM = 'nplusone_mem'
VERIFY_OPTIONAL_CHECKS = frozenset([VERIFY_NPLUSONE_MEM])
JOB_QUEUE_VERSION_FILE = QUEUE_DIR + "/version"
JOB_QUEUE_SERIAL_FILE = QUEUE_DIR + "/serial"
JOB_QUEUE_ARCHIVE_DIR = QUEUE_DIR + "/archive"
+JOB_QUEUE_DRAIN_FILE = QUEUE_DIR + "/drain"
JOB_ID_TEMPLATE = r"\d+"
+# unchanged job return
+JOB_NOTCHANGED = "nochange"
+
# Job status
JOB_STATUS_QUEUED = "queued"
+JOB_STATUS_WAITLOCK = "waiting"
JOB_STATUS_RUNNING = "running"
JOB_STATUS_CANCELED = "canceled"
JOB_STATUS_SUCCESS = "success"
JOB_STATUS_ERROR = "error"
OP_STATUS_QUEUED = "queued"
+OP_STATUS_WAITLOCK = "waiting"
OP_STATUS_RUNNING = "running"
OP_STATUS_CANCELED = "canceled"
OP_STATUS_SUCCESS = "success"
# Temporary RAPI constants until we have cluster parameters
RAPI_ENABLE = True
RAPI_PORT = 5080
+
+# cluster wide default parameters
+DEFAULT_ENABLED_HYPERVISOR = HT_XEN_PVM
+
+HVC_DEFAULTS = {
+ HT_XEN_PVM: {
+ HV_KERNEL_PATH: "/boot/vmlinuz-2.6-xenU",
+ HV_INITRD_PATH: None,
+ },
+ HT_XEN_HVM: {
+ HV_BOOT_ORDER: "cd",
+ HV_CDROM_IMAGE_PATH: None,
+ HV_NIC_TYPE: HT_HVM_NIC_RTL8139,
+ HV_DISK_TYPE: HT_HVM_DEV_PARAVIRTUAL,
+ HV_VNC_BIND_ADDRESS: '0.0.0.0',
+ HV_ACPI: True,
+ HV_PAE: True,
+ },
+ HT_KVM: {
+ HV_KERNEL_PATH: "/boot/vmlinuz-2.6-xenU",
+ HV_INITRD_PATH: None,
+ HV_ACPI: True,
+ },
+ HT_FAKE: {
+ },
+ }
+
+BEC_DEFAULTS = {
+ BE_MEMORY: 128,
+ BE_VCPUS: 1,
+ BE_AUTO_BALANCE: True,
+ }