# various versions
CONFIG_VERSION = 3
-PROTOCOL_VERSION = 3
+PROTOCOL_VERSION = 11
RELEASE_VERSION = _autoconf.PACKAGE_VERSION
OS_API_VERSION = 5
EXPORT_VERSION = 0
# file paths
DATA_DIR = _autoconf.LOCALSTATEDIR + "/lib/ganeti"
+RUN_DIR = _autoconf.LOCALSTATEDIR + "/run"
+BDEV_CACHE_DIR = RUN_DIR + "/ganeti"
+LOCK_DIR = _autoconf.LOCALSTATEDIR + "/lock"
CLUSTER_CONF_FILE = DATA_DIR + "/config.data"
SSL_CERT_FILE = DATA_DIR + "/server.pem"
WATCHER_STATEFILE = DATA_DIR + "/watcher.data"
SSH_KNOWN_HOSTS_FILE = DATA_DIR + "/known_hosts"
+ETC_HOSTS = "/etc/hosts"
+DEFAULT_FILE_STORAGE_DIR = _autoconf.FILE_STORAGE_DIR
+MASTER_SOCKET = RUN_DIR + "/master.sock"
NODE_INITD_SCRIPT = _autoconf.SYSCONFDIR + "/init.d/ganeti"
-SSH_INITD_SCRIPT = _autoconf.SSH_INITD_SCRIPT
DEFAULT_NODED_PORT = 1811
FIRST_DRBD_PORT = 11000
LAST_DRBD_PORT = 14999
LOG_OS_DIR = LOG_DIR + "/os"
LOG_NODESERVER = LOG_DIR + "/node-daemon.log"
LOG_WATCHER = LOG_DIR + "/watcher.log"
+LOG_MASTERDAEMON = LOG_DIR + "/master-daemon.log"
OS_SEARCH_PATH = _autoconf.OS_SEARCH_PATH
EXPORT_DIR = _autoconf.EXPORT_DIR
XEN_KERNEL = _autoconf.XEN_KERNEL
XEN_INITRD = _autoconf.XEN_INITRD
+VALUE_DEFAULT = "default"
+VALUE_NONE = "none"
+
# hooks-related constants
HOOKS_BASE_DIR = _autoconf.SYSCONFDIR + "/ganeti/hooks"
HOOKS_PHASE_PRE = "pre"
HOOKS_PHASE_POST = "post"
+HOOKS_NAME_CFGUPDATE = "config-update"
HOOKS_VERSION = 1
# hooks subject type (what object type does the LU deal with)
DT_PLAIN = "plain"
DT_LOCAL_RAID1 = "local_raid1"
DT_REMOTE_RAID1 = "remote_raid1"
+DT_DRBD8 = "drbd"
+DT_FILE = "file"
+
+# the set of network-mirrored disk templates
+DTS_NET_MIRROR = frozenset([DT_REMOTE_RAID1, DT_DRBD8])
+
+# the set of non-lvm-based disk templates
+DTS_NOT_LVM = frozenset([DT_DISKLESS, DT_FILE])
+
+# logical disk types
+LD_LV = "lvm"
+LD_MD_R1 = "md_raid1"
+LD_DRBD7 = "drbd"
+LD_DRBD8 = "drbd8"
+LD_FILE = "file"
+
+# file backend driver
+FD_LOOP = "loop"
+FD_BLKTAP = "blktap"
-# instance creation modem
+# the set of drbd-like disk types
+LDS_DRBD = frozenset([LD_DRBD7, LD_DRBD8])
+
+# disk replacement mode
+REPLACE_DISK_PRI = "replace_primary"
+REPLACE_DISK_SEC = "replace_secondary"
+REPLACE_DISK_ALL = "replace_all"
+
+# instance creation modes
INSTANCE_CREATE = "create"
INSTANCE_IMPORT = "import"
DISK_TEMPLATES = frozenset([DT_DISKLESS, DT_PLAIN,
- DT_LOCAL_RAID1, DT_REMOTE_RAID1])
+ DT_LOCAL_RAID1, DT_REMOTE_RAID1,
+ DT_DRBD8, DT_FILE])
+
+FILE_DRIVER = frozenset([FD_LOOP, FD_BLKTAP])
# import/export config options
INISECT_EXP = "export"
# others
DEFAULT_BRIDGE = "xen-br0"
SYNC_SPEED = 30 * 1024
-LOCALHOST_IP_ADDRESS="127.0.0.1"
+LOCALHOST_IP_ADDRESS = "127.0.0.1"
TCP_PING_TIMEOUT = 10
+GANETI_RUNAS = "root"
+DEFAULT_VG = "xenvg"
+
+# valid os status
+OS_VALID_STATUS = "VALID"
+
+# ssh constants
+SSH_INITD_SCRIPT = _autoconf.SSH_INITD_SCRIPT
+SSH_CONFIG_DIR = "/etc/ssh/"
+SSH_HOST_DSA_PRIV = SSH_CONFIG_DIR + "ssh_host_dsa_key"
+SSH_HOST_DSA_PUB = SSH_HOST_DSA_PRIV + ".pub"
+SSH_HOST_RSA_PRIV = SSH_CONFIG_DIR + "ssh_host_rsa_key"
+SSH_HOST_RSA_PUB = SSH_HOST_RSA_PRIV + ".pub"
+SSH = "ssh"
+SCP = "scp"
+
+# reboot types
+INSTANCE_REBOOT_SOFT = "soft"
+INSTANCE_REBOOT_HARD = "hard"
+INSTANCE_REBOOT_FULL = "full"
+
+# Hypervisor constants
+HT_XEN_PVM30 = "xen-3.0"
+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_HVM_VNC_BASE_PORT = 5900
+HT_HVM_DEFAULT_BOOT_ORDER = 'dc'
+VNC_PASSWORD_FILE = _autoconf.SYSCONFDIR + "/ganeti/vnc-cluster-password"
+
+# Cluster Verify steps
+VERIFY_NPLUSONE_MEM = 'nplusone_mem'
+VERIFY_OPTIONAL_CHECKS = frozenset([VERIFY_NPLUSONE_MEM])
+
+# Allocator framework constants
+IALLOCATOR_DIR_IN = "in"
+IALLOCATOR_DIR_OUT = "out"
+IALLOCATOR_MODE_ALLOC = "allocate"
+IALLOCATOR_MODE_RELOC = "relocate"
+IALLOCATOR_SEARCH_PATH = _autoconf.IALLOCATOR_SEARCH_PATH
+IARUN_NOTFOUND = 1
+IARUN_FAILURE = 2
+IARUN_SUCCESS = 3