SSCONF_LOCK_FILE = LOCK_DIR + "/ganeti-ssconf.lock"
CLUSTER_CONF_FILE = DATA_DIR + "/config.data"
SSL_CERT_FILE = DATA_DIR + "/server.pem"
+RAPI_CERT_FILE = DATA_DIR + "/rapi.pem"
WATCHER_STATEFILE = DATA_DIR + "/watcher.data"
SSH_KNOWN_HOSTS_FILE = DATA_DIR + "/known_hosts"
+RAPI_USERS_FILE = DATA_DIR + "/rapi_users"
QUEUE_DIR = DATA_DIR + "/queue"
ETC_HOSTS = "/etc/hosts"
DEFAULT_FILE_STORAGE_DIR = _autoconf.FILE_STORAGE_DIR
XEN_INITRD = _autoconf.XEN_INITRD
KVM_PATH = _autoconf.KVM_PATH
+SOCAT_PATH = _autoconf.SOCAT_PATH
+KVM_MIGRATION_PORT = _autoconf.KVM_MIGRATION_PORT
VALUE_DEFAULT = "default"
VALUE_AUTO = "auto"
VALUE_GENERATE = "generate"
VALUE_NONE = "none"
+VALUE_TRUE = "true"
+VALUE_FALSE = "false"
# hooks-related constants
HOOKS_BASE_DIR = _autoconf.SYSCONFDIR + "/ganeti/hooks"
DISK_ACCESS_SET = frozenset([DISK_RDONLY, DISK_RDWR])
# disk replacement mode
-REPLACE_DISK_PRI = "replace_primary"
-REPLACE_DISK_SEC = "replace_secondary"
-REPLACE_DISK_ALL = "replace_all"
+REPLACE_DISK_PRI = "replace_on_primary" # replace disks on primary
+REPLACE_DISK_SEC = "replace_on_secondary" # replace disks on secondary
+REPLACE_DISK_CHG = "replace_new_secondary" # change secondary node
# lock recalculate mode
LOCKS_REPLACE = 'replace'
# others
DEFAULT_BRIDGE = "xen-br0"
-SYNC_SPEED = 30 * 1024
+SYNC_SPEED = 60 * 1024
LOCALHOST_IP_ADDRESS = "127.0.0.1"
TCP_PING_TIMEOUT = 10
GANETI_RUNAS = "root"
DEFAULT_VG = "xenvg"
BIND_ADDRESS_GLOBAL = "0.0.0.0"
MIN_VG_SIZE = 20480
+DEFAULT_MAC_PREFIX = "aa:00:00"
+
+# RPC constants
+(RPC_ENCODING_NONE,
+ RPC_ENCODING_ZLIB_BASE64) = range(2)
# os related constants
OS_VALID_STATUS = "VALID"
INSTANCE_REBOOT_HARD = "hard"
INSTANCE_REBOOT_FULL = "full"
+REBOOT_TYPES = frozenset([INSTANCE_REBOOT_SOFT,
+ INSTANCE_REBOOT_HARD,
+ INSTANCE_REBOOT_FULL])
+
# HV parameter names (global namespace)
HV_BOOT_ORDER = "boot_order"
HV_CDROM_IMAGE_PATH = "cdrom_image_path"
HV_PAE = "pae"
HV_KERNEL_PATH = "kernel_path"
HV_INITRD_PATH = "initrd_path"
+HV_ROOT_PATH = "root_path"
+HV_SERIAL_CONSOLE = "serial_console"
HVS_PARAMETERS = frozenset([
HV_BOOT_ORDER,
HV_PAE,
HV_KERNEL_PATH,
HV_INITRD_PATH,
+ HV_ROOT_PATH,
+ HV_SERIAL_CONSOLE,
])
# BE parameter names
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])
+HTS_REQ_PORT = frozenset([HT_XEN_HVM, HT_KVM])
+HTS_USE_VNC = frozenset([HT_XEN_HVM, HT_KVM])
HT_HVM_VNC_BASE_PORT = 5900
HT_HVM_DEFAULT_BOOT_ORDER = 'dc'
VERIFY_NPLUSONE_MEM = 'nplusone_mem'
VERIFY_OPTIONAL_CHECKS = frozenset([VERIFY_NPLUSONE_MEM])
+# Node verify constants
+NV_FILELIST = "filelist"
+NV_HVINFO = "hvinfo"
+NV_HYPERVISOR = "hypervisor"
+NV_INSTANCELIST = "instancelist"
+NV_LVLIST = "lvlist"
+NV_NODELIST = "nodelist"
+NV_NODENETTEST = "node-net-test"
+NV_VERSION = "version"
+NV_VGLIST = "vglist"
+NV_DRBDLIST = "drbd-list"
+
# Allocator framework constants
IALLOCATOR_DIR_IN = "in"
IALLOCATOR_DIR_OUT = "out"
JOB_QUEUE_SERIAL_FILE = QUEUE_DIR + "/serial"
JOB_QUEUE_ARCHIVE_DIR = QUEUE_DIR + "/archive"
JOB_QUEUE_DRAIN_FILE = QUEUE_DIR + "/drain"
+JOB_QUEUE_SIZE_HARD_LIMIT = 5000
+JOB_QUEUE_SIZE_SOFT_LIMIT = JOB_QUEUE_SIZE_HARD_LIMIT * 0.8
JOB_ID_TEMPLATE = r"\d+"
RAPI_ENABLE = True
RAPI_PORT = 5080
-# max dynamnic devices
+# max dynamic devices
MAX_NICS = 8
MAX_DISKS = 16
# SSCONF keys
SS_CLUSTER_NAME = "cluster_name"
SS_FILE_STORAGE_DIR = "file_storage_dir"
+SS_MASTER_CANDIDATES = "master_candidates"
SS_MASTER_IP = "master_ip"
SS_MASTER_NETDEV = "master_netdev"
SS_MASTER_NODE = "master_node"
SS_NODE_LIST = "node_list"
+SS_OFFLINE_NODES = "offline_nodes"
+SS_RELEASE_VERSION = "release_version"
# 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: {
- },
- }
+ HT_XEN_PVM: {
+ HV_KERNEL_PATH: "/boot/vmlinuz-2.6-xenU",
+ HV_INITRD_PATH: None,
+ HV_ROOT_PATH: '/dev/sda',
+ },
+ 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-kvmU",
+ HV_INITRD_PATH: None,
+ HV_ROOT_PATH: '/dev/vda',
+ HV_ACPI: True,
+ HV_SERIAL_CONSOLE: True,
+ HV_VNC_BIND_ADDRESS: None,
+ },
+ HT_FAKE: {
+ },
+ }
BEC_DEFAULTS = {
- BE_MEMORY: 128,
- BE_VCPUS: 1,
- BE_AUTO_BALANCE: True,
- }
+ BE_MEMORY: 128,
+ BE_VCPUS: 1,
+ BE_AUTO_BALANCE: True,
+ }
+
+MASTER_POOL_SIZE_DEFAULT = 10