# various versions
PROTOCOL_VERSION = 20
RELEASE_VERSION = _autoconf.PACKAGE_VERSION
-OS_API_VERSION = 10
+OS_API_V10 = 10
+OS_API_V15 = 15
+OS_API_VERSIONS = frozenset([OS_API_V10, OS_API_V15])
EXPORT_VERSION = 0
RAPI_VERSION = 2
CLUSTER_CONF_FILE = DATA_DIR + "/config.data"
SSL_CERT_FILE = DATA_DIR + "/server.pem"
RAPI_CERT_FILE = DATA_DIR + "/rapi.pem"
+HMAC_CLUSTER_KEY = DATA_DIR + "/hmac.key"
WATCHER_STATEFILE = DATA_DIR + "/watcher.data"
INSTANCE_UPFILE = RUN_GANETI_DIR + "/instance-status"
SSH_KNOWN_HOSTS_FILE = DATA_DIR + "/known_hosts"
QUEUE_DIR = DATA_DIR + "/queue"
ETC_HOSTS = "/etc/hosts"
DEFAULT_FILE_STORAGE_DIR = _autoconf.FILE_STORAGE_DIR
+SYSCONFDIR = _autoconf.SYSCONFDIR
MASTER_SOCKET = SOCKET_DIR + "/ganeti-master"
BIND_ADDRESS_GLOBAL = "0.0.0.0"
MIN_VG_SIZE = 20480
DEFAULT_MAC_PREFIX = "aa:00:00"
+LVM_STRIPECOUNT = _autoconf.LVM_STRIPECOUNT
# RPC constants
(RPC_ENCODING_NONE,
RPC_ENCODING_ZLIB_BASE64) = range(2)
# os related constants
-OS_VALID_STATUS = "VALID"
OS_SCRIPT_CREATE = 'create'
OS_SCRIPT_IMPORT = 'import'
OS_SCRIPT_EXPORT = 'export'
HV_ROOT_PATH = "root_path"
HV_SERIAL_CONSOLE = "serial_console"
HV_USB_MOUSE = "usb_mouse"
+HV_DEVICE_MODEL = "device_model"
HVS_PARAMETER_TYPES = {
HV_BOOT_ORDER: VTYPE_STRING,
HV_ROOT_PATH: VTYPE_STRING,
HV_SERIAL_CONSOLE: VTYPE_BOOL,
HV_USB_MOUSE: VTYPE_STRING,
+ HV_DEVICE_MODEL: VTYPE_STRING,
}
HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys())
BES_PARAMETERS = frozenset(BES_PARAMETER_TYPES.keys())
-# BE GROUP
-BEGR_DEFAULT = "default"
+# Instance Parameters Profile
+PP_DEFAULT = "default"
+
+NIC_MODE = "mode"
+NIC_LINK = "link"
+
+NIC_MODE_BRIDGED = "bridged"
+NIC_MODE_ROUTED = "routed"
+
+NIC_VALID_MODES = frozenset([NIC_MODE_BRIDGED, NIC_MODE_ROUTED])
+
+NICS_PARAMETER_TYPES = {
+ NIC_MODE: VTYPE_STRING,
+ NIC_LINK: VTYPE_STRING,
+ }
+
+NICS_PARAMETERS = frozenset(NICS_PARAMETER_TYPES.keys())
# Hypervisor constants
HT_XEN_PVM = "xen-pvm"
HT_KVM = "kvm"
HYPER_TYPES = frozenset([HT_XEN_PVM, HT_FAKE, HT_XEN_HVM, HT_KVM])
HTS_REQ_PORT = frozenset([HT_XEN_HVM, HT_KVM])
-HTS_COPY_VNC_PASSWORD = frozenset([HT_XEN_HVM])
VNC_BASE_PORT = 5900
VNC_PASSWORD_FILE = _autoconf.SYSCONFDIR + "/ganeti/vnc-cluster-password"
IALLOCATOR_MODE_ALLOC = "allocate"
IALLOCATOR_MODE_RELOC = "relocate"
IALLOCATOR_SEARCH_PATH = _autoconf.IALLOCATOR_SEARCH_PATH
-IARUN_NOTFOUND = 1
-IARUN_FAILURE = 2
-IARUN_SUCCESS = 3
# Job queue
JOB_QUEUE_VERSION = 1
JOB_STATUS_SUCCESS = "success"
JOB_STATUS_ERROR = "error"
+# OpCode status
+# not yet finalized
OP_STATUS_QUEUED = "queued"
OP_STATUS_WAITLOCK = "waiting"
OP_STATUS_CANCELING = "canceling"
OP_STATUS_RUNNING = "running"
+# finalized
OP_STATUS_CANCELED = "canceled"
OP_STATUS_SUCCESS = "success"
OP_STATUS_ERROR = "error"
+OPS_FINALIZED = frozenset([OP_STATUS_CANCELED,
+ OP_STATUS_SUCCESS,
+ OP_STATUS_ERROR])
# Execution log types
ELOG_MESSAGE = "message"
HV_VNC_BIND_ADDRESS: '0.0.0.0',
HV_ACPI: True,
HV_PAE: True,
+ HV_KERNEL_PATH: "/usr/lib/xen/boot/hvmloader",
+ HV_DEVICE_MODEL: "/usr/lib/xen/bin/qemu-dm",
},
HT_KVM: {
HV_KERNEL_PATH: "/boot/vmlinuz-2.6-kvmU",
BE_AUTO_BALANCE: True,
}
+NICC_DEFAULTS = {
+ NIC_MODE: NIC_MODE_BRIDGED,
+ NIC_LINK: DEFAULT_BRIDGE,
+ }
+
MASTER_POOL_SIZE_DEFAULT = 10