4 # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Google Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 """Module holding different constants."""
27 from ganeti import _autoconf
28 from ganeti import _vcsversion
29 from ganeti import pathutils
33 RELEASE_VERSION = _autoconf.PACKAGE_VERSION
37 OS_API_VERSIONS = frozenset([OS_API_V10, OS_API_V15, OS_API_V20])
38 VCS_VERSION = _vcsversion.VCS_VERSION
43 # Format for CONFIG_VERSION:
44 # 01 03 0123 = 01030123
46 # | | + Configuration version/revision
50 # It is stored as an integer. Make sure not to write an octal number.
52 # BuildVersion and SplitVersion must be in here because we can't import other
53 # modules. The cfgupgrade tool must be able to read and write version numbers
54 # and thus requires these functions. To avoid code duplication, they're kept in
57 def BuildVersion(major, minor, revision):
58 """Calculates int version number from major, minor and revision numbers.
60 Returns: int representing version number
63 assert isinstance(major, int)
64 assert isinstance(minor, int)
65 assert isinstance(revision, int)
66 return (1000000 * major +
71 def SplitVersion(version):
72 """Splits version number stored in an int.
74 Returns: tuple; (major, minor, revision)
77 assert isinstance(version, int)
79 (major, remainder) = divmod(version, 1000000)
80 (minor, revision) = divmod(remainder, 10000)
82 return (major, minor, revision)
85 CONFIG_MAJOR = int(_autoconf.VERSION_MAJOR)
86 CONFIG_MINOR = int(_autoconf.VERSION_MINOR)
88 CONFIG_VERSION = BuildVersion(CONFIG_MAJOR, CONFIG_MINOR, CONFIG_REVISION)
90 #: RPC protocol version
91 PROTOCOL_VERSION = BuildVersion(CONFIG_MAJOR, CONFIG_MINOR, 0)
94 DAEMONS_GROUP = _autoconf.DAEMONS_GROUP
95 ADMIN_GROUP = _autoconf.ADMIN_GROUP
96 MASTERD_USER = _autoconf.MASTERD_USER
97 MASTERD_GROUP = _autoconf.MASTERD_GROUP
98 RAPI_USER = _autoconf.RAPI_USER
99 RAPI_GROUP = _autoconf.RAPI_GROUP
100 CONFD_USER = _autoconf.CONFD_USER
101 CONFD_GROUP = _autoconf.CONFD_GROUP
102 NODED_USER = _autoconf.NODED_USER
103 NODED_GROUP = _autoconf.NODED_GROUP
104 SSH_LOGIN_USER = _autoconf.SSH_LOGIN_USER
105 SSH_CONSOLE_USER = _autoconf.SSH_CONSOLE_USER
107 # cpu pinning separators and constants
108 CPU_PINNING_SEP = ":"
109 CPU_PINNING_ALL = "all"
110 # internal representation of "all"
111 CPU_PINNING_ALL_VAL = -1
112 # one "all" entry in a CPU list means CPU pinning is off
113 CPU_PINNING_OFF = [CPU_PINNING_ALL_VAL]
115 # A Xen-specific implementation detail - there is no way to actually say
116 # "use any cpu for pinning" in a Xen configuration file, as opposed to the
117 # command line, where you can say "xm vcpu-pin <domain> <vcpu> all".
118 # The workaround used in Xen is "0-63" (see source code function
119 # xm_vcpu_pin in <xen-source>/tools/python/xen/xm/main.py).
120 # To support future changes, the following constant is treated as a
121 # blackbox string that simply means use-any-cpu-for-pinning-under-xen.
122 CPU_PINNING_ALL_XEN = "0-63"
124 # A KVM-specific implementation detail - the following value is used
125 # to set CPU affinity to all processors (#0 through #31), per taskset
127 # FIXME: This only works for machines with up to 32 CPU cores
128 CPU_PINNING_ALL_KVM = 0xFFFFFFFF
132 MAX_WIPE_CHUNK = 1024 # 1GB
133 MIN_WIPE_CHUNK_PERCENT = 10
136 SECURE_DIR_MODE = 0700
137 SECURE_FILE_MODE = 0600
138 ADOPTABLE_BLOCKDEV_ROOT = "/dev/disk/"
139 ENABLE_FILE_STORAGE = _autoconf.ENABLE_FILE_STORAGE
140 ENABLE_SHARED_FILE_STORAGE = _autoconf.ENABLE_SHARED_FILE_STORAGE
141 ENABLE_CONFD = _autoconf.ENABLE_CONFD
142 ENABLE_SPLIT_QUERY = _autoconf.ENABLE_SPLIT_QUERY
144 NODED = "ganeti-noded"
145 CONFD = "ganeti-confd"
147 MASTERD = "ganeti-masterd"
148 # used in the ganeti-nbma project
152 # daemon-name: ("proto", "default-port")
153 NODED: ("tcp", 1811),
154 CONFD: ("udp", 1814),
157 # used in the ganeti-nbma project
160 DEFAULT_NODED_PORT = DAEMONS_PORTS[NODED][1]
161 DEFAULT_CONFD_PORT = DAEMONS_PORTS[CONFD][1]
162 DEFAULT_RAPI_PORT = DAEMONS_PORTS[RAPI][1]
163 # used in the ganeti-nbma project
164 DEFAULT_NLD_PORT = DAEMONS_PORTS[NLD][1]
166 FIRST_DRBD_PORT = 11000
167 LAST_DRBD_PORT = 14999
170 NODED: pathutils.GetLogFilename("node-daemon"),
171 CONFD: pathutils.GetLogFilename("conf-daemon"),
172 RAPI: pathutils.GetLogFilename("rapi-daemon"),
173 MASTERD: pathutils.GetLogFilename("master-daemon"),
176 DEV_CONSOLE = "/dev/console"
178 PROC_MOUNTS = "/proc/mounts"
180 # Local UniX Interface related constants
182 LUXI_VERSION = CONFIG_VERSION
184 # one of "no", "yes", "only"
185 SYSLOG_USAGE = _autoconf.SYSLOG_USAGE
189 SYSLOG_SOCKET = "/dev/log"
191 EXPORT_CONF_FILE = "config.ini"
193 XEN_BOOTLOADER = _autoconf.XEN_BOOTLOADER
194 XEN_KERNEL = _autoconf.XEN_KERNEL
195 XEN_INITRD = _autoconf.XEN_INITRD
198 # FIXME: This will be made configurable using hvparams in Ganeti 2.7
199 XEN_CMD = _autoconf.XEN_CMD
201 KVM_PATH = _autoconf.KVM_PATH
202 KVM_KERNEL = _autoconf.KVM_KERNEL
203 SOCAT_PATH = _autoconf.SOCAT_PATH
204 SOCAT_USE_ESCAPE = _autoconf.SOCAT_USE_ESCAPE
205 SOCAT_USE_COMPRESS = _autoconf.SOCAT_USE_COMPRESS
206 SOCAT_ESCAPE_CODE = "0x1d"
208 #: Console as SSH command
211 #: Console as VNC server
214 #: Console as SPICE server
217 #: Display a message for console access
221 CONS_ALL = frozenset([CONS_SSH, CONS_VNC, CONS_SPICE, CONS_MESSAGE])
223 # For RSA keys more bits are better, but they also make operations more
224 # expensive. NIST SP 800-131 recommends a minimum of 2048 bits from the year
228 # Ciphers allowed for SSL connections. For the format, see ciphers(1). A better
229 # way to disable ciphers would be to use the exclamation mark (!), but socat
230 # versions below 1.5 can't parse exclamation marks in options properly. When
231 # modifying the ciphers, ensure not to accidentially add something after it's
232 # been removed. Use the "openssl" utility to check the allowed ciphers, e.g.
233 # "openssl ciphers -v HIGH:-DES".
234 OPENSSL_CIPHERS = "HIGH:-DES:-3DES:-EXPORT:-ADH"
236 # Digest used to sign certificates ("openssl x509" uses SHA1 by default)
237 X509_CERT_SIGN_DIGEST = "SHA1"
239 # Default validity of certificates in days
240 X509_CERT_DEFAULT_VALIDITY = 365 * 5
242 # commonName (CN) used in certificates
243 X509_CERT_CN = "ganeti.example.com"
245 X509_CERT_SIGNATURE_HEADER = "X-Ganeti-Signature"
247 # Import/export daemon mode
248 IEM_IMPORT = "import"
249 IEM_EXPORT = "export"
251 # Import/export transport compression
254 IEC_ALL = frozenset([
259 IE_CUSTOM_SIZE = "fd"
261 IE_MAGIC_RE = re.compile(r"^[-_.a-zA-Z0-9]{5,100}$")
264 # Direct file I/O, equivalent to a shell's I/O redirection using '<' or '>'
266 # Raw block device I/O using "dd"
267 IEIO_RAW_DISK = "raw"
268 # OS definition import/export script
269 IEIO_SCRIPT = "script"
271 VALUE_DEFAULT = "default"
273 VALUE_GENERATE = "generate"
276 VALUE_FALSE = "false"
278 # External script validation mask
279 EXT_PLUGIN_MASK = re.compile("^[a-zA-Z0-9_-]+$")
281 # hooks-related constants
282 HOOKS_PHASE_PRE = "pre"
283 HOOKS_PHASE_POST = "post"
284 HOOKS_NAME_CFGUPDATE = "config-update"
285 HOOKS_NAME_WATCHER = "watcher"
287 HOOKS_PATH = "/sbin:/bin:/usr/sbin:/usr/bin"
289 # hooks subject type (what object type does the LU deal with)
290 HTYPE_CLUSTER = "CLUSTER"
292 HTYPE_GROUP = "GROUP"
293 HTYPE_INSTANCE = "INSTANCE"
305 # first two are valid in LU context only, not passed to backend
308 # and the rest are valid in backend
313 SF_ALLOCATABLE = "allocatable"
316 SO_FIX_CONSISTENCY = "fix-consistency"
318 # Available fields per storage type
319 VALID_STORAGE_FIELDS = frozenset([
328 VALID_STORAGE_TYPES = frozenset([ST_FILE, ST_LVM_PV, ST_LVM_VG])
330 MODIFIABLE_STORAGE_FIELDS = {
331 ST_LVM_PV: frozenset([SF_ALLOCATABLE]),
334 VALID_STORAGE_OPERATIONS = {
335 ST_LVM_VG: frozenset([SO_FIX_CONSISTENCY]),
339 # Note: Code depends on LDS_OKAY < LDS_UNKNOWN < LDS_FAULTY
342 LDS_FAULTY) = range(1, 4)
344 # disk template types
345 DT_DISKLESS = "diskless"
349 DT_SHARED_FILE = "sharedfile"
350 DT_BLOCK = "blockdev"
353 # the set of network-mirrored disk templates
354 DTS_INT_MIRROR = frozenset([DT_DRBD8])
356 # the set of externally-mirrored disk templates (e.g. SAN, NAS)
357 DTS_EXT_MIRROR = frozenset([DT_SHARED_FILE, DT_BLOCK, DT_RBD])
359 # the set of non-lvm-based disk templates
360 DTS_NOT_LVM = frozenset([DT_DISKLESS, DT_FILE, DT_SHARED_FILE,
363 # the set of disk templates which can be grown
364 DTS_GROWABLE = frozenset([DT_PLAIN, DT_DRBD8, DT_FILE, DT_SHARED_FILE, DT_RBD])
366 # the set of disk templates that allow adoption
367 DTS_MAY_ADOPT = frozenset([DT_PLAIN, DT_BLOCK])
369 # the set of disk templates that *must* use adoption
370 DTS_MUST_ADOPT = frozenset([DT_BLOCK])
372 # the set of disk templates that allow migrations
373 DTS_MIRRORED = frozenset.union(DTS_INT_MIRROR, DTS_EXT_MIRROR)
375 # the set of file based disk templates
376 DTS_FILEBASED = frozenset([DT_FILE, DT_SHARED_FILE])
382 LD_BLOCKDEV = "blockdev"
384 LOGICAL_DISK_TYPES = frozenset([
392 LDS_BLOCK = frozenset([LD_LV, LD_DRBD8, LD_BLOCKDEV, LD_RBD])
395 DRBD_HMAC_ALG = "md5"
396 DRBD_NET_PROTOCOL = "C"
398 #: Size of DRBD meta block device
403 DRBD_B_DISK_BARRIERS = "b"
404 DRBD_B_DISK_DRAIN = "d"
405 DRBD_B_DISK_FLUSH = "f"
407 # Valid barrier combinations: "n" or any non-null subset of "bfd"
408 DRBD_VALID_BARRIER_OPT = frozenset([
409 frozenset([DRBD_B_NONE]),
410 frozenset([DRBD_B_DISK_BARRIERS]),
411 frozenset([DRBD_B_DISK_DRAIN]),
412 frozenset([DRBD_B_DISK_FLUSH]),
413 frozenset([DRBD_B_DISK_DRAIN, DRBD_B_DISK_FLUSH]),
414 frozenset([DRBD_B_DISK_DRAIN, DRBD_B_DISK_FLUSH]),
415 frozenset([DRBD_B_DISK_BARRIERS, DRBD_B_DISK_DRAIN]),
416 frozenset([DRBD_B_DISK_BARRIERS, DRBD_B_DISK_FLUSH]),
417 frozenset([DRBD_B_DISK_BARRIERS, DRBD_B_DISK_FLUSH, DRBD_B_DISK_DRAIN]),
423 # file backend driver
427 # the set of drbd-like disk types
428 LDS_DRBD = frozenset([LD_DRBD8])
433 DISK_ACCESS_SET = frozenset([DISK_RDONLY, DISK_RDWR])
435 # disk replacement mode
436 REPLACE_DISK_PRI = "replace_on_primary" # replace disks on primary
437 REPLACE_DISK_SEC = "replace_on_secondary" # replace disks on secondary
438 REPLACE_DISK_CHG = "replace_new_secondary" # change secondary node
439 REPLACE_DISK_AUTO = "replace_auto"
440 REPLACE_MODES = frozenset([
447 # Instance export mode
448 EXPORT_MODE_LOCAL = "local"
449 EXPORT_MODE_REMOTE = "remote"
450 EXPORT_MODES = frozenset([
455 # instance creation modes
456 INSTANCE_CREATE = "create"
457 INSTANCE_IMPORT = "import"
458 INSTANCE_REMOTE_IMPORT = "remote-import"
459 INSTANCE_CREATE_MODES = frozenset([
462 INSTANCE_REMOTE_IMPORT,
465 # Remote import/export handshake message and version
467 RIE_HANDSHAKE = "Hi, I'm Ganeti"
469 # Remote import/export certificate validity in seconds
470 RIE_CERT_VALIDITY = 24 * 60 * 60
472 # Overall timeout for establishing connection
473 RIE_CONNECT_TIMEOUT = 180
475 # Export only: how long to wait per connection attempt (seconds)
476 RIE_CONNECT_ATTEMPT_TIMEOUT = 20
478 # Export only: number of attempts to connect
479 RIE_CONNECT_RETRIES = 10
481 #: Give child process up to 5 seconds to exit after sending a signal
482 CHILD_LINGER_TIMEOUT = 5.0
484 DISK_TEMPLATES = frozenset([
494 FILE_DRIVER = frozenset([FD_LOOP, FD_BLKTAP])
496 # import/export config options
497 INISECT_EXP = "export"
498 INISECT_INS = "instance"
499 INISECT_HYP = "hypervisor"
500 INISECT_BEP = "backend"
503 # dynamic device modification
505 DDM_MODIFY = "modify"
506 DDM_REMOVE = "remove"
507 DDMS_VALUES = frozenset([DDM_ADD, DDM_REMOVE])
508 DDMS_VALUES_WITH_MODIFY = (DDMS_VALUES | frozenset([
511 # TODO: DDM_SWAP, DDM_MOVE?
518 EXIT_NODESETUP_ERROR = 12
519 EXIT_CONFIRMATION = 13 # need user confirmation
521 #: Exit code for query operations with unknown fields
522 EXIT_UNKNOWN_FIELD = 14
525 TAG_CLUSTER = "cluster"
526 TAG_NODEGROUP = "nodegroup"
528 TAG_INSTANCE = "instance"
529 VALID_TAG_TYPES = frozenset([
536 MAX_TAGS_PER_OBJ = 4096
539 DEFAULT_BRIDGE = "xen-br0"
540 CLASSIC_DRBD_SYNC_SPEED = 60 * 1024 # 60 MiB, expressed in KiB
541 IP4_ADDRESS_LOCALHOST = "127.0.0.1"
542 IP4_ADDRESS_ANY = "0.0.0.0"
543 IP6_ADDRESS_LOCALHOST = "::1"
544 IP6_ADDRESS_ANY = "::"
547 VALID_IP_VERSIONS = frozenset([IP4_VERSION, IP6_VERSION])
548 # for export to htools
549 IP4_FAMILY = socket.AF_INET
550 IP6_FAMILY = socket.AF_INET6
552 TCP_PING_TIMEOUT = 10
554 DEFAULT_DRBD_HELPER = "/bin/true"
556 DEFAULT_MAC_PREFIX = "aa:00:00"
557 # default maximum instance wait time, in seconds.
558 DEFAULT_SHUTDOWN_TIMEOUT = 120
559 NODE_MAX_CLOCK_SKEW = 150
560 # Time for an intra-cluster disk transfer to wait for a connection
561 DISK_TRANSFER_CONNECT_TIMEOUT = 60
562 # Disk index separator
563 DISK_SEPARATOR = _autoconf.DISK_SEPARATOR
564 IP_COMMAND_PATH = _autoconf.IP_PATH
566 #: Key for job IDs in opcode result
572 RUNPARTS_ERR) = range(3)
574 RUNPARTS_STATUS = frozenset([RUNPARTS_SKIP, RUNPARTS_RUN, RUNPARTS_ERR])
578 RPC_ENCODING_ZLIB_BASE64) = range(2)
580 # Various time constants for the timeout table
581 RPC_TMO_URGENT = 60 # one minute
582 RPC_TMO_FAST = 5 * 60 # five minutes
583 RPC_TMO_NORMAL = 15 * 60 # 15 minutes
584 RPC_TMO_SLOW = 3600 # one hour
585 RPC_TMO_4HRS = 4 * 3600
588 # Timeout for connecting to nodes (seconds)
589 RPC_CONNECT_TIMEOUT = 5
591 # os related constants
592 OS_SCRIPT_CREATE = "create"
593 OS_SCRIPT_IMPORT = "import"
594 OS_SCRIPT_EXPORT = "export"
595 OS_SCRIPT_RENAME = "rename"
596 OS_SCRIPT_VERIFY = "verify"
597 OS_SCRIPTS = frozenset([
605 OS_API_FILE = "ganeti_api_version"
606 OS_VARIANTS_FILE = "variants.list"
607 OS_PARAMETERS_FILE = "parameters.list"
609 OS_VALIDATE_PARAMETERS = "parameters"
610 OS_VALIDATE_CALLS = frozenset([OS_VALIDATE_PARAMETERS])
617 INSTANCE_REBOOT_SOFT = "soft"
618 INSTANCE_REBOOT_HARD = "hard"
619 INSTANCE_REBOOT_FULL = "full"
621 REBOOT_TYPES = frozenset([
622 INSTANCE_REBOOT_SOFT,
623 INSTANCE_REBOOT_HARD,
627 # instance reboot behaviors
628 INSTANCE_REBOOT_ALLOWED = "reboot"
629 INSTANCE_REBOOT_EXIT = "exit"
631 REBOOT_BEHAVIORS = frozenset([
632 INSTANCE_REBOOT_ALLOWED,
636 VTYPE_STRING = "string"
637 VTYPE_MAYBE_STRING = "maybe-string"
639 VTYPE_SIZE = "size" # size, in MiBs
641 ENFORCEABLE_TYPES = frozenset([
649 # Constant representing that the user does not specify any IP version
650 IFACE_NO_IP_VERSION_SPECIFIED = 0
652 # HV parameter names (global namespace)
653 HV_BOOT_ORDER = "boot_order"
654 HV_CDROM_IMAGE_PATH = "cdrom_image_path"
655 HV_KVM_CDROM2_IMAGE_PATH = "cdrom2_image_path"
656 HV_KVM_FLOPPY_IMAGE_PATH = "floppy_image_path"
657 HV_NIC_TYPE = "nic_type"
658 HV_DISK_TYPE = "disk_type"
659 HV_KVM_CDROM_DISK_TYPE = "cdrom_disk_type"
660 HV_VNC_BIND_ADDRESS = "vnc_bind_address"
661 HV_VNC_PASSWORD_FILE = "vnc_password_file"
662 HV_VNC_TLS = "vnc_tls"
663 HV_VNC_X509 = "vnc_x509_path"
664 HV_VNC_X509_VERIFY = "vnc_x509_verify"
665 HV_KVM_SPICE_BIND = "spice_bind"
666 HV_KVM_SPICE_IP_VERSION = "spice_ip_version"
667 HV_KVM_SPICE_PASSWORD_FILE = "spice_password_file"
668 HV_KVM_SPICE_LOSSLESS_IMG_COMPR = "spice_image_compression"
669 HV_KVM_SPICE_JPEG_IMG_COMPR = "spice_jpeg_wan_compression"
670 HV_KVM_SPICE_ZLIB_GLZ_IMG_COMPR = "spice_zlib_glz_wan_compression"
671 HV_KVM_SPICE_STREAMING_VIDEO_DETECTION = "spice_streaming_video"
672 HV_KVM_SPICE_AUDIO_COMPR = "spice_playback_compression"
673 HV_KVM_SPICE_USE_TLS = "spice_use_tls"
674 HV_KVM_SPICE_TLS_CIPHERS = "spice_tls_ciphers"
675 HV_KVM_SPICE_USE_VDAGENT = "spice_use_vdagent"
678 HV_USE_BOOTLOADER = "use_bootloader"
679 HV_BOOTLOADER_ARGS = "bootloader_args"
680 HV_BOOTLOADER_PATH = "bootloader_path"
681 HV_KERNEL_ARGS = "kernel_args"
682 HV_KERNEL_PATH = "kernel_path"
683 HV_INITRD_PATH = "initrd_path"
684 HV_ROOT_PATH = "root_path"
685 HV_SERIAL_CONSOLE = "serial_console"
686 HV_USB_MOUSE = "usb_mouse"
688 HV_DEVICE_MODEL = "device_model"
689 HV_INIT_SCRIPT = "init_script"
690 HV_MIGRATION_PORT = "migration_port"
691 HV_MIGRATION_BANDWIDTH = "migration_bandwidth"
692 HV_MIGRATION_DOWNTIME = "migration_downtime"
693 HV_MIGRATION_MODE = "migration_mode"
694 HV_USE_LOCALTIME = "use_localtime"
695 HV_DISK_CACHE = "disk_cache"
696 HV_SECURITY_MODEL = "security_model"
697 HV_SECURITY_DOMAIN = "security_domain"
698 HV_KVM_FLAG = "kvm_flag"
699 HV_VHOST_NET = "vhost_net"
700 HV_KVM_USE_CHROOT = "use_chroot"
701 HV_CPU_MASK = "cpu_mask"
702 HV_MEM_PATH = "mem_path"
703 HV_PASSTHROUGH = "pci_pass"
704 HV_BLOCKDEV_PREFIX = "blockdev_prefix"
705 HV_REBOOT_BEHAVIOR = "reboot_behavior"
706 HV_CPU_TYPE = "cpu_type"
708 HVS_PARAMETER_TYPES = {
709 HV_BOOT_ORDER: VTYPE_STRING,
710 HV_KVM_FLOPPY_IMAGE_PATH: VTYPE_STRING,
711 HV_CDROM_IMAGE_PATH: VTYPE_STRING,
712 HV_KVM_CDROM2_IMAGE_PATH: VTYPE_STRING,
713 HV_NIC_TYPE: VTYPE_STRING,
714 HV_DISK_TYPE: VTYPE_STRING,
715 HV_KVM_CDROM_DISK_TYPE: VTYPE_STRING,
716 HV_VNC_PASSWORD_FILE: VTYPE_STRING,
717 HV_VNC_BIND_ADDRESS: VTYPE_STRING,
718 HV_VNC_TLS: VTYPE_BOOL,
719 HV_VNC_X509: VTYPE_STRING,
720 HV_VNC_X509_VERIFY: VTYPE_BOOL,
721 HV_KVM_SPICE_BIND: VTYPE_STRING,
722 HV_KVM_SPICE_IP_VERSION: VTYPE_INT,
723 HV_KVM_SPICE_PASSWORD_FILE: VTYPE_STRING,
724 HV_KVM_SPICE_LOSSLESS_IMG_COMPR: VTYPE_STRING,
725 HV_KVM_SPICE_JPEG_IMG_COMPR: VTYPE_STRING,
726 HV_KVM_SPICE_ZLIB_GLZ_IMG_COMPR: VTYPE_STRING,
727 HV_KVM_SPICE_STREAMING_VIDEO_DETECTION: VTYPE_STRING,
728 HV_KVM_SPICE_AUDIO_COMPR: VTYPE_BOOL,
729 HV_KVM_SPICE_USE_TLS: VTYPE_BOOL,
730 HV_KVM_SPICE_TLS_CIPHERS: VTYPE_STRING,
731 HV_KVM_SPICE_USE_VDAGENT: VTYPE_BOOL,
734 HV_USE_BOOTLOADER: VTYPE_BOOL,
735 HV_BOOTLOADER_PATH: VTYPE_STRING,
736 HV_BOOTLOADER_ARGS: VTYPE_STRING,
737 HV_KERNEL_PATH: VTYPE_STRING,
738 HV_KERNEL_ARGS: VTYPE_STRING,
739 HV_INITRD_PATH: VTYPE_STRING,
740 HV_ROOT_PATH: VTYPE_MAYBE_STRING,
741 HV_SERIAL_CONSOLE: VTYPE_BOOL,
742 HV_USB_MOUSE: VTYPE_STRING,
743 HV_KEYMAP: VTYPE_STRING,
744 HV_DEVICE_MODEL: VTYPE_STRING,
745 HV_INIT_SCRIPT: VTYPE_STRING,
746 HV_MIGRATION_PORT: VTYPE_INT,
747 HV_MIGRATION_BANDWIDTH: VTYPE_INT,
748 HV_MIGRATION_DOWNTIME: VTYPE_INT,
749 HV_MIGRATION_MODE: VTYPE_STRING,
750 HV_USE_LOCALTIME: VTYPE_BOOL,
751 HV_DISK_CACHE: VTYPE_STRING,
752 HV_SECURITY_MODEL: VTYPE_STRING,
753 HV_SECURITY_DOMAIN: VTYPE_STRING,
754 HV_KVM_FLAG: VTYPE_STRING,
755 HV_VHOST_NET: VTYPE_BOOL,
756 HV_KVM_USE_CHROOT: VTYPE_BOOL,
757 HV_CPU_MASK: VTYPE_STRING,
758 HV_MEM_PATH: VTYPE_STRING,
759 HV_PASSTHROUGH: VTYPE_STRING,
760 HV_BLOCKDEV_PREFIX: VTYPE_STRING,
761 HV_REBOOT_BEHAVIOR: VTYPE_STRING,
762 HV_CPU_TYPE: VTYPE_STRING,
765 HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys())
767 HVS_PARAMETER_TITLES = {
769 HV_BOOT_ORDER: "Boot_order",
770 HV_CDROM_IMAGE_PATH: "CDROM_image_path",
771 HV_DISK_TYPE: "Disk_type",
772 HV_INITRD_PATH: "Initrd_path",
773 HV_KERNEL_PATH: "Kernel_path",
774 HV_NIC_TYPE: "NIC_type",
776 HV_VNC_BIND_ADDRESS: "VNC_bind_address",
777 HV_PASSTHROUGH: "pci_pass",
778 HV_CPU_TYPE: "cpu_type",
782 HV_MIGRATION_COMPLETED = "completed"
783 HV_MIGRATION_ACTIVE = "active"
784 HV_MIGRATION_FAILED = "failed"
785 HV_MIGRATION_CANCELLED = "cancelled"
787 HV_MIGRATION_VALID_STATUSES = frozenset([
788 HV_MIGRATION_COMPLETED,
791 HV_MIGRATION_CANCELLED,
794 HV_MIGRATION_FAILED_STATUSES = frozenset([
796 HV_MIGRATION_CANCELLED,
799 # KVM-specific statuses
800 HV_KVM_MIGRATION_VALID_STATUSES = HV_MIGRATION_VALID_STATUSES
803 HV_NODEINFO_KEY_VERSION = "hv_version"
806 HVST_MEMORY_TOTAL = "mem_total"
807 HVST_MEMORY_NODE = "mem_node"
808 HVST_MEMORY_HV = "mem_hv"
809 HVST_CPU_TOTAL = "cpu_total"
810 HVST_CPU_NODE = "cpu_node"
813 HVST_MEMORY_TOTAL: 0,
820 HVSTS_PARAMETER_TYPES = {
821 HVST_MEMORY_TOTAL: VTYPE_INT,
822 HVST_MEMORY_NODE: VTYPE_INT,
823 HVST_MEMORY_HV: VTYPE_INT,
824 HVST_CPU_TOTAL: VTYPE_INT,
825 HVST_CPU_NODE: VTYPE_INT,
828 HVSTS_PARAMETERS = frozenset(HVSTS_PARAMETER_TYPES.keys())
831 DS_DISK_TOTAL = "disk_total"
832 DS_DISK_RESERVED = "disk_reserved"
833 DS_DISK_OVERHEAD = "disk_overhead"
841 DSS_PARAMETER_TYPES = {
842 DS_DISK_TOTAL: VTYPE_INT,
843 DS_DISK_RESERVED: VTYPE_INT,
844 DS_DISK_OVERHEAD: VTYPE_INT,
847 DSS_PARAMETERS = frozenset(DSS_PARAMETER_TYPES.keys())
848 DS_VALID_TYPES = frozenset([LD_LV])
850 # Backend parameter names
851 BE_MEMORY = "memory" # deprecated and replaced by max and min mem
855 BE_AUTO_BALANCE = "auto_balance"
856 BE_ALWAYS_FAILOVER = "always_failover"
857 BE_SPINDLE_USE = "spindle_use"
859 BES_PARAMETER_TYPES = {
860 BE_MAXMEM: VTYPE_SIZE,
861 BE_MINMEM: VTYPE_SIZE,
863 BE_AUTO_BALANCE: VTYPE_BOOL,
864 BE_ALWAYS_FAILOVER: VTYPE_BOOL,
865 BE_SPINDLE_USE: VTYPE_INT,
868 BES_PARAMETER_TITLES = {
869 BE_AUTO_BALANCE: "Auto_balance",
870 BE_MAXMEM: "ConfigMaxMem",
871 BE_MINMEM: "ConfigMinMem",
872 BE_VCPUS: "ConfigVCPUs",
875 BES_PARAMETER_COMPAT = {
876 BE_MEMORY: VTYPE_SIZE,
878 BES_PARAMETER_COMPAT.update(BES_PARAMETER_TYPES)
880 BES_PARAMETERS = frozenset(BES_PARAMETER_TYPES.keys())
883 ISPEC_MEM_SIZE = "memory-size"
884 ISPEC_CPU_COUNT = "cpu-count"
885 ISPEC_DISK_COUNT = "disk-count"
886 ISPEC_DISK_SIZE = "disk-size"
887 ISPEC_NIC_COUNT = "nic-count"
888 ISPEC_SPINDLE_USE = "spindle-use"
890 ISPECS_PARAMETER_TYPES = {
891 ISPEC_MEM_SIZE: VTYPE_INT,
892 ISPEC_CPU_COUNT: VTYPE_INT,
893 ISPEC_DISK_COUNT: VTYPE_INT,
894 ISPEC_DISK_SIZE: VTYPE_INT,
895 ISPEC_NIC_COUNT: VTYPE_INT,
896 ISPEC_SPINDLE_USE: VTYPE_INT,
899 ISPECS_PARAMETERS = frozenset(ISPECS_PARAMETER_TYPES.keys())
904 IPOLICY_DTS = "disk-templates"
905 IPOLICY_VCPU_RATIO = "vcpu-ratio"
906 IPOLICY_SPINDLE_RATIO = "spindle-ratio"
908 IPOLICY_ISPECS = frozenset([
914 IPOLICY_PARAMETERS = frozenset([
916 IPOLICY_SPINDLE_RATIO,
919 IPOLICY_ALL_KEYS = (IPOLICY_ISPECS |
921 frozenset([IPOLICY_DTS]))
923 # Node parameter names
924 ND_OOB_PROGRAM = "oob_program"
925 ND_SPINDLE_COUNT = "spindle_count"
927 NDS_PARAMETER_TYPES = {
928 ND_OOB_PROGRAM: VTYPE_STRING,
929 ND_SPINDLE_COUNT: VTYPE_INT,
932 NDS_PARAMETERS = frozenset(NDS_PARAMETER_TYPES.keys())
934 NDS_PARAMETER_TITLES = {
935 ND_OOB_PROGRAM: "OutOfBandProgram",
936 ND_SPINDLE_COUNT: "SpindleCount",
939 # Logical Disks parameters
940 LDP_RESYNC_RATE = "resync-rate"
941 LDP_STRIPES = "stripes"
942 LDP_BARRIERS = "disabled-barriers"
943 LDP_NO_META_FLUSH = "disable-meta-flush"
944 LDP_DEFAULT_METAVG = "default-metavg"
945 LDP_DISK_CUSTOM = "disk-custom"
946 LDP_NET_CUSTOM = "net-custom"
947 LDP_DYNAMIC_RESYNC = "dynamic-resync"
948 LDP_PLAN_AHEAD = "c-plan-ahead"
949 LDP_FILL_TARGET = "c-fill-target"
950 LDP_DELAY_TARGET = "c-delay-target"
951 LDP_MAX_RATE = "c-max-rate"
952 LDP_MIN_RATE = "c-min-rate"
955 LDP_RESYNC_RATE: VTYPE_INT,
956 LDP_STRIPES: VTYPE_INT,
957 LDP_BARRIERS: VTYPE_STRING,
958 LDP_NO_META_FLUSH: VTYPE_BOOL,
959 LDP_DEFAULT_METAVG: VTYPE_STRING,
960 LDP_DISK_CUSTOM: VTYPE_STRING,
961 LDP_NET_CUSTOM: VTYPE_STRING,
962 LDP_DYNAMIC_RESYNC: VTYPE_BOOL,
963 LDP_PLAN_AHEAD: VTYPE_INT,
964 LDP_FILL_TARGET: VTYPE_INT,
965 LDP_DELAY_TARGET: VTYPE_INT,
966 LDP_MAX_RATE: VTYPE_INT,
967 LDP_MIN_RATE: VTYPE_INT,
968 LDP_POOL: VTYPE_STRING,
970 DISK_LD_PARAMETERS = frozenset(DISK_LD_TYPES.keys())
972 # Disk template parameters (can be set/changed by the user via gnt-cluster and
974 DRBD_RESYNC_RATE = "resync-rate"
975 DRBD_DATA_STRIPES = "data-stripes"
976 DRBD_META_STRIPES = "meta-stripes"
977 DRBD_DISK_BARRIERS = "disk-barriers"
978 DRBD_META_BARRIERS = "meta-barriers"
979 DRBD_DEFAULT_METAVG = "metavg"
980 DRBD_DISK_CUSTOM = "disk-custom"
981 DRBD_NET_CUSTOM = "net-custom"
982 DRBD_DYNAMIC_RESYNC = "dynamic-resync"
983 DRBD_PLAN_AHEAD = "c-plan-ahead"
984 DRBD_FILL_TARGET = "c-fill-target"
985 DRBD_DELAY_TARGET = "c-delay-target"
986 DRBD_MAX_RATE = "c-max-rate"
987 DRBD_MIN_RATE = "c-min-rate"
988 LV_STRIPES = "stripes"
991 DRBD_RESYNC_RATE: VTYPE_INT,
992 DRBD_DATA_STRIPES: VTYPE_INT,
993 DRBD_META_STRIPES: VTYPE_INT,
994 DRBD_DISK_BARRIERS: VTYPE_STRING,
995 DRBD_META_BARRIERS: VTYPE_BOOL,
996 DRBD_DEFAULT_METAVG: VTYPE_STRING,
997 DRBD_DISK_CUSTOM: VTYPE_STRING,
998 DRBD_NET_CUSTOM: VTYPE_STRING,
999 DRBD_DYNAMIC_RESYNC: VTYPE_BOOL,
1000 DRBD_PLAN_AHEAD: VTYPE_INT,
1001 DRBD_FILL_TARGET: VTYPE_INT,
1002 DRBD_DELAY_TARGET: VTYPE_INT,
1003 DRBD_MAX_RATE: VTYPE_INT,
1004 DRBD_MIN_RATE: VTYPE_INT,
1005 LV_STRIPES: VTYPE_INT,
1006 RBD_POOL: VTYPE_STRING,
1009 DISK_DT_PARAMETERS = frozenset(DISK_DT_TYPES.keys())
1011 # OOB supported commands
1012 OOB_POWER_ON = "power-on"
1013 OOB_POWER_OFF = "power-off"
1014 OOB_POWER_CYCLE = "power-cycle"
1015 OOB_POWER_STATUS = "power-status"
1016 OOB_HEALTH = "health"
1018 OOB_COMMANDS = frozenset([
1026 OOB_POWER_STATUS_POWERED = "powered"
1028 OOB_TIMEOUT = 60 # 60 seconds
1029 OOB_POWER_DELAY = 2.0 # 2 seconds
1031 OOB_STATUS_OK = "OK"
1032 OOB_STATUS_WARNING = "WARNING"
1033 OOB_STATUS_CRITICAL = "CRITICAL"
1034 OOB_STATUS_UNKNOWN = "UNKNOWN"
1036 OOB_STATUSES = frozenset([
1039 OOB_STATUS_CRITICAL,
1043 # Instance Parameters Profile
1044 PP_DEFAULT = "default"
1046 # NIC_* constants are used inside the ganeti config
1050 NIC_MODE_BRIDGED = "bridged"
1051 NIC_MODE_ROUTED = "routed"
1053 NIC_VALID_MODES = frozenset([NIC_MODE_BRIDGED, NIC_MODE_ROUTED])
1055 NICS_PARAMETER_TYPES = {
1056 NIC_MODE: VTYPE_STRING,
1057 NIC_LINK: VTYPE_STRING,
1060 NICS_PARAMETERS = frozenset(NICS_PARAMETER_TYPES.keys())
1062 # IDISK_* constants are used in opcodes, to create/change disks
1065 IDISK_ADOPT = "adopt"
1067 IDISK_METAVG = "metavg"
1068 IDISK_PARAMS_TYPES = {
1069 IDISK_SIZE: VTYPE_SIZE,
1070 IDISK_MODE: VTYPE_STRING,
1071 IDISK_ADOPT: VTYPE_STRING,
1072 IDISK_VG: VTYPE_STRING,
1073 IDISK_METAVG: VTYPE_STRING,
1075 IDISK_PARAMS = frozenset(IDISK_PARAMS_TYPES.keys())
1077 # INIC_* constants are used in opcodes, to create/change nics
1082 INIC_PARAMS_TYPES = {
1083 INIC_IP: VTYPE_MAYBE_STRING,
1084 INIC_LINK: VTYPE_STRING,
1085 INIC_MAC: VTYPE_STRING,
1086 INIC_MODE: VTYPE_STRING,
1088 INIC_PARAMS = frozenset(INIC_PARAMS_TYPES.keys())
1090 # Hypervisor constants
1091 HT_XEN_PVM = "xen-pvm"
1093 HT_XEN_HVM = "xen-hvm"
1095 HT_CHROOT = "chroot"
1097 HYPER_TYPES = frozenset([
1105 HTS_REQ_PORT = frozenset([HT_XEN_HVM, HT_KVM])
1107 VNC_BASE_PORT = 5900
1108 VNC_DEFAULT_BIND_ADDRESS = IP4_ADDRESS_ANY
1111 HT_NIC_RTL8139 = "rtl8139"
1112 HT_NIC_NE2K_PCI = "ne2k_pci"
1113 HT_NIC_NE2K_ISA = "ne2k_isa"
1114 HT_NIC_I82551 = "i82551"
1115 HT_NIC_I85557B = "i82557b"
1116 HT_NIC_I8259ER = "i82559er"
1117 HT_NIC_PCNET = "pcnet"
1118 HT_NIC_E1000 = "e1000"
1119 HT_NIC_PARAVIRTUAL = HT_DISK_PARAVIRTUAL = "paravirtual"
1121 HT_HVM_VALID_NIC_TYPES = frozenset([
1128 HT_KVM_VALID_NIC_TYPES = frozenset([
1141 HT_DISK_IOEMU = "ioemu"
1143 HT_DISK_SCSI = "scsi"
1146 HT_DISK_PFLASH = "pflash"
1148 HT_CACHE_DEFAULT = "default"
1149 HT_CACHE_NONE = "none"
1150 HT_CACHE_WTHROUGH = "writethrough"
1151 HT_CACHE_WBACK = "writeback"
1152 HT_VALID_CACHE_TYPES = frozenset([
1159 HT_HVM_VALID_DISK_TYPES = frozenset([HT_DISK_PARAVIRTUAL, HT_DISK_IOEMU])
1160 HT_KVM_VALID_DISK_TYPES = frozenset([
1161 HT_DISK_PARAVIRTUAL,
1170 HT_MOUSE_MOUSE = "mouse"
1171 HT_MOUSE_TABLET = "tablet"
1173 HT_KVM_VALID_MOUSE_TYPES = frozenset([HT_MOUSE_MOUSE, HT_MOUSE_TABLET])
1176 HT_BO_FLOPPY = "floppy"
1177 HT_BO_CDROM = "cdrom"
1179 HT_BO_NETWORK = "network"
1181 HT_KVM_VALID_BO_TYPES = frozenset([
1188 # SPICE lossless image compression options
1189 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_AUTO_GLZ = "auto_glz"
1190 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_AUTO_LZ = "auto_lz"
1191 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_QUIC = "quic"
1192 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_GLZ = "glz"
1193 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_LZ = "lz"
1194 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_OFF = "off"
1196 HT_KVM_SPICE_VALID_LOSSLESS_IMG_COMPR_OPTIONS = frozenset([
1197 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_AUTO_GLZ,
1198 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_AUTO_LZ,
1199 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_QUIC,
1200 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_GLZ,
1201 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_LZ,
1202 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_OFF,
1205 # SPICE lossy image compression options (valid for both jpeg and zlib-glz)
1206 HT_KVM_SPICE_LOSSY_IMG_COMPR_AUTO = "auto"
1207 HT_KVM_SPICE_LOSSY_IMG_COMPR_NEVER = "never"
1208 HT_KVM_SPICE_LOSSY_IMG_COMPR_ALWAYS = "always"
1210 HT_KVM_SPICE_VALID_LOSSY_IMG_COMPR_OPTIONS = frozenset([
1211 HT_KVM_SPICE_LOSSY_IMG_COMPR_AUTO,
1212 HT_KVM_SPICE_LOSSY_IMG_COMPR_NEVER,
1213 HT_KVM_SPICE_LOSSY_IMG_COMPR_ALWAYS,
1216 # SPICE video stream detection
1217 HT_KVM_SPICE_VIDEO_STREAM_DETECTION_OFF = "off"
1218 HT_KVM_SPICE_VIDEO_STREAM_DETECTION_ALL = "all"
1219 HT_KVM_SPICE_VIDEO_STREAM_DETECTION_FILTER = "filter"
1221 HT_KVM_SPICE_VALID_VIDEO_STREAM_DETECTION_OPTIONS = frozenset([
1222 HT_KVM_SPICE_VIDEO_STREAM_DETECTION_OFF,
1223 HT_KVM_SPICE_VIDEO_STREAM_DETECTION_ALL,
1224 HT_KVM_SPICE_VIDEO_STREAM_DETECTION_FILTER,
1232 HT_KVM_VALID_SM_TYPES = frozenset([HT_SM_NONE, HT_SM_USER, HT_SM_POOL])
1235 HT_KVM_ENABLED = "enabled"
1236 HT_KVM_DISABLED = "disabled"
1238 HT_KVM_FLAG_VALUES = frozenset([HT_KVM_ENABLED, HT_KVM_DISABLED])
1241 HT_MIGRATION_LIVE = "live"
1242 HT_MIGRATION_NONLIVE = "non-live"
1243 HT_MIGRATION_MODES = frozenset([HT_MIGRATION_LIVE, HT_MIGRATION_NONLIVE])
1245 # Cluster Verify steps
1246 VERIFY_NPLUSONE_MEM = "nplusone_mem"
1247 VERIFY_OPTIONAL_CHECKS = frozenset([VERIFY_NPLUSONE_MEM])
1249 # Cluster Verify error classes
1250 CV_TCLUSTER = "cluster"
1252 CV_TINSTANCE = "instance"
1254 # Cluster Verify error codes and documentation
1256 (CV_TCLUSTER, "ECLUSTERCFG", "Cluster configuration verification failure")
1258 (CV_TCLUSTER, "ECLUSTERCERT",
1259 "Cluster certificate files verification failure")
1260 CV_ECLUSTERFILECHECK = \
1261 (CV_TCLUSTER, "ECLUSTERFILECHECK",
1262 "Cluster configuration verification failure")
1263 CV_ECLUSTERDANGLINGNODES = \
1264 (CV_TNODE, "ECLUSTERDANGLINGNODES",
1265 "Some nodes belong to non-existing groups")
1266 CV_ECLUSTERDANGLINGINST = \
1267 (CV_TNODE, "ECLUSTERDANGLINGINST",
1268 "Some instances have a non-existing primary node")
1269 CV_EINSTANCEBADNODE = \
1270 (CV_TINSTANCE, "EINSTANCEBADNODE",
1271 "Instance marked as running lives on an offline node")
1272 CV_EINSTANCEDOWN = \
1273 (CV_TINSTANCE, "EINSTANCEDOWN", "Instance not running on its primary node")
1274 CV_EINSTANCELAYOUT = \
1275 (CV_TINSTANCE, "EINSTANCELAYOUT", "Instance has multiple secondary nodes")
1276 CV_EINSTANCEMISSINGDISK = \
1277 (CV_TINSTANCE, "EINSTANCEMISSINGDISK", "Missing volume on an instance")
1278 CV_EINSTANCEFAULTYDISK = \
1279 (CV_TINSTANCE, "EINSTANCEFAULTYDISK",
1280 "Impossible to retrieve status for a disk")
1281 CV_EINSTANCEWRONGNODE = \
1282 (CV_TINSTANCE, "EINSTANCEWRONGNODE", "Instance running on the wrong node")
1283 CV_EINSTANCESPLITGROUPS = \
1284 (CV_TINSTANCE, "EINSTANCESPLITGROUPS",
1285 "Instance with primary and secondary nodes in different groups")
1286 CV_EINSTANCEPOLICY = \
1287 (CV_TINSTANCE, "EINSTANCEPOLICY",
1288 "Instance does not meet policy")
1290 (CV_TNODE, "ENODEDRBD", "Error parsing the DRBD status file")
1291 CV_ENODEDRBDHELPER = \
1292 (CV_TNODE, "ENODEDRBDHELPER", "Error caused by the DRBD helper")
1293 CV_ENODEFILECHECK = \
1294 (CV_TNODE, "ENODEFILECHECK",
1295 "Error retrieving the checksum of the node files")
1297 (CV_TNODE, "ENODEHOOKS", "Communication failure in hooks execution")
1299 (CV_TNODE, "ENODEHV", "Hypervisor parameters verification failure")
1301 (CV_TNODE, "ENODELVM", "LVM-related node error")
1303 (CV_TNODE, "ENODEN1", "Not enough memory to accommodate instance failovers")
1305 (CV_TNODE, "ENODENET", "Network-related node error")
1307 (CV_TNODE, "ENODEOS", "OS-related node error")
1308 CV_ENODEORPHANINSTANCE = \
1309 (CV_TNODE, "ENODEORPHANINSTANCE", "Unknown intance running on a node")
1310 CV_ENODEORPHANLV = \
1311 (CV_TNODE, "ENODEORPHANLV", "Unknown LVM logical volume")
1313 (CV_TNODE, "ENODERPC",
1314 "Error during connection to the primary node of an instance")
1316 (CV_TNODE, "ENODESSH", "SSH-related node error")
1318 (CV_TNODE, "ENODEVERSION",
1319 "Protocol version mismatch or Ganeti version mismatch")
1321 (CV_TNODE, "ENODESETUP", "Node setup error")
1323 (CV_TNODE, "ENODETIME", "Node returned invalid time")
1325 (CV_TNODE, "ENODEOOBPATH", "Invalid Out Of Band path")
1326 CV_ENODEUSERSCRIPTS = \
1327 (CV_TNODE, "ENODEUSERSCRIPTS", "User scripts not present or not executable")
1329 CV_ALL_ECODES = frozenset([
1332 CV_ECLUSTERFILECHECK,
1333 CV_ECLUSTERDANGLINGNODES,
1334 CV_ECLUSTERDANGLINGINST,
1335 CV_EINSTANCEBADNODE,
1338 CV_EINSTANCEMISSINGDISK,
1339 CV_EINSTANCEFAULTYDISK,
1340 CV_EINSTANCEWRONGNODE,
1341 CV_EINSTANCESPLITGROUPS,
1352 CV_ENODEORPHANINSTANCE,
1360 CV_ENODEUSERSCRIPTS,
1363 CV_ALL_ECODES_STRINGS = frozenset(estr for (_, estr, _) in CV_ALL_ECODES)
1365 # Node verify constants
1366 NV_DRBDHELPER = "drbd-helper"
1367 NV_DRBDLIST = "drbd-list"
1368 NV_FILELIST = "filelist"
1369 NV_HVINFO = "hvinfo"
1370 NV_HYPERVISOR = "hypervisor"
1371 NV_HVPARAMS = "hvparms"
1372 NV_INSTANCELIST = "instancelist"
1373 NV_LVLIST = "lvlist"
1374 NV_MASTERIP = "master-ip"
1375 NV_NODELIST = "nodelist"
1376 NV_NODENETTEST = "node-net-test"
1377 NV_NODESETUP = "nodesetup"
1378 NV_OSLIST = "oslist"
1379 NV_PVLIST = "pvlist"
1381 NV_VERSION = "version"
1382 NV_VGLIST = "vglist"
1383 NV_VMNODES = "vmnodes"
1384 NV_OOB_PATHS = "oob-paths"
1385 NV_BRIDGES = "bridges"
1386 NV_USERSCRIPTS = "user-scripts"
1389 INSTST_RUNNING = "running"
1390 INSTST_ADMINDOWN = "ADMIN_down"
1391 INSTST_ADMINOFFLINE = "ADMIN_offline"
1392 INSTST_NODEOFFLINE = "ERROR_nodeoffline"
1393 INSTST_NODEDOWN = "ERROR_nodedown"
1394 INSTST_WRONGNODE = "ERROR_wrongnode"
1395 INSTST_ERRORUP = "ERROR_up"
1396 INSTST_ERRORDOWN = "ERROR_down"
1397 INSTST_ALL = frozenset([
1400 INSTST_ADMINOFFLINE,
1410 ADMINST_DOWN = "down"
1411 ADMINST_OFFLINE = "offline"
1412 ADMINST_ALL = frozenset([
1424 NR_ALL = frozenset([
1432 # SSL certificate check constants (in days)
1433 SSL_CERT_EXPIRATION_WARN = 30
1434 SSL_CERT_EXPIRATION_ERROR = 7
1436 # Allocator framework constants
1437 IALLOCATOR_VERSION = 2
1438 IALLOCATOR_DIR_IN = "in"
1439 IALLOCATOR_DIR_OUT = "out"
1440 VALID_IALLOCATOR_DIRECTIONS = frozenset([
1444 IALLOCATOR_MODE_ALLOC = "allocate"
1445 IALLOCATOR_MODE_RELOC = "relocate"
1446 IALLOCATOR_MODE_CHG_GROUP = "change-group"
1447 IALLOCATOR_MODE_NODE_EVAC = "node-evacuate"
1448 IALLOCATOR_MODE_MULTI_ALLOC = "multi-allocate"
1449 VALID_IALLOCATOR_MODES = frozenset([
1450 IALLOCATOR_MODE_ALLOC,
1451 IALLOCATOR_MODE_RELOC,
1452 IALLOCATOR_MODE_CHG_GROUP,
1453 IALLOCATOR_MODE_NODE_EVAC,
1454 IALLOCATOR_MODE_MULTI_ALLOC,
1456 IALLOCATOR_SEARCH_PATH = _autoconf.IALLOCATOR_SEARCH_PATH
1457 DEFAULT_IALLOCATOR_SHORTCUT = "."
1459 IALLOCATOR_NEVAC_PRI = "primary-only"
1460 IALLOCATOR_NEVAC_SEC = "secondary-only"
1461 IALLOCATOR_NEVAC_ALL = "all"
1462 IALLOCATOR_NEVAC_MODES = frozenset([
1463 IALLOCATOR_NEVAC_PRI,
1464 IALLOCATOR_NEVAC_SEC,
1465 IALLOCATOR_NEVAC_ALL,
1469 NODE_EVAC_PRI = "primary-only"
1470 NODE_EVAC_SEC = "secondary-only"
1471 NODE_EVAC_ALL = "all"
1472 NODE_EVAC_MODES = frozenset([
1479 JOB_QUEUE_VERSION = 1
1480 JOB_QUEUE_SIZE_HARD_LIMIT = 5000
1482 JOB_ID_TEMPLATE = r"\d+"
1483 JOB_FILE_RE = re.compile(r"^job-(%s)$" % JOB_ID_TEMPLATE)
1485 # unchanged job return
1486 JOB_NOTCHANGED = "nochange"
1489 JOB_STATUS_QUEUED = "queued"
1490 JOB_STATUS_WAITING = "waiting"
1491 JOB_STATUS_CANCELING = "canceling"
1492 JOB_STATUS_RUNNING = "running"
1493 JOB_STATUS_CANCELED = "canceled"
1494 JOB_STATUS_SUCCESS = "success"
1495 JOB_STATUS_ERROR = "error"
1496 JOBS_FINALIZED = frozenset([
1497 JOB_STATUS_CANCELED,
1501 JOB_STATUS_ALL = frozenset([
1504 JOB_STATUS_CANCELING,
1510 OP_STATUS_QUEUED = "queued"
1511 OP_STATUS_WAITING = "waiting"
1512 OP_STATUS_CANCELING = "canceling"
1513 OP_STATUS_RUNNING = "running"
1515 OP_STATUS_CANCELED = "canceled"
1516 OP_STATUS_SUCCESS = "success"
1517 OP_STATUS_ERROR = "error"
1518 OPS_FINALIZED = frozenset([
1525 OP_PRIO_LOWEST = +19
1526 OP_PRIO_HIGHEST = -20
1532 OP_PRIO_SUBMIT_VALID = frozenset([
1538 OP_PRIO_DEFAULT = OP_PRIO_NORMAL
1540 # Lock recalculate mode
1541 LOCKS_REPLACE = "replace"
1542 LOCKS_APPEND = "append"
1544 # Lock timeout (sum) before we should go into blocking acquire (still
1545 # can be reset by priority change); computed as max time (10 hours)
1546 # before we should actually go into blocking acquire given that we
1547 # start from default priority level; in seconds
1549 LOCK_ATTEMPTS_TIMEOUT = 10 * 3600 / (OP_PRIO_DEFAULT - OP_PRIO_HIGHEST)
1550 LOCK_ATTEMPTS_MAXWAIT = 15.0
1551 LOCK_ATTEMPTS_MINWAIT = 1.0
1553 # Execution log types
1554 ELOG_MESSAGE = "message"
1555 ELOG_REMOTE_IMPORT = "remote-import"
1556 ELOG_JQUEUE_TEST = "jqueue-test"
1558 # /etc/hosts modification
1559 ETC_HOSTS_ADD = "add"
1560 ETC_HOSTS_REMOVE = "remove"
1563 JQT_MSGPREFIX = "TESTMSG="
1564 JQT_EXPANDNAMES = "expandnames"
1566 JQT_LOGMSG = "logmsg"
1567 JQT_STARTMSG = "startmsg"
1568 JQT_ALL = frozenset([
1576 QR_CLUSTER = "cluster"
1577 QR_INSTANCE = "instance"
1583 QR_EXPORT = "export"
1585 #: List of resources which can be queried using L{opcodes.OpQuery}
1586 QR_VIA_OP = frozenset([
1595 #: List of resources which can be queried using Local UniX Interface
1596 QR_VIA_LUXI = QR_VIA_OP.union([
1601 #: List of resources which can be queried using RAPI
1602 QR_VIA_RAPI = QR_VIA_LUXI
1605 QFT_UNKNOWN = "unknown"
1608 QFT_NUMBER = "number"
1610 QFT_TIMESTAMP = "timestamp"
1613 #: All query field types
1614 QFT_ALL = frozenset([
1624 # Query result field status (don't change or reuse values as they're used by
1626 #: Normal field status
1630 #: No data (e.g. RPC error), can be used instead of L{RS_OFFLINE}
1632 #: Value unavailable/unsupported for item; if this field is supported
1633 #: but we cannot get the data for the moment, RS_NODATA or
1634 #: RS_OFFLINE should be used
1636 #: Resource marked offline
1639 RS_ALL = frozenset([
1647 #: Dictionary with special field cases and their verbose/terse formatting
1649 RS_UNKNOWN: ("(unknown)", "??"),
1650 RS_NODATA: ("(nodata)", "?"),
1651 RS_OFFLINE: ("(offline)", "*"),
1652 RS_UNAVAIL: ("(unavail)", "-"),
1655 # max dynamic devices
1659 # SSCONF file prefix
1660 SSCONF_FILEPREFIX = "ssconf_"
1662 SS_CLUSTER_NAME = "cluster_name"
1663 SS_CLUSTER_TAGS = "cluster_tags"
1664 SS_FILE_STORAGE_DIR = "file_storage_dir"
1665 SS_SHARED_FILE_STORAGE_DIR = "shared_file_storage_dir"
1666 SS_MASTER_CANDIDATES = "master_candidates"
1667 SS_MASTER_CANDIDATES_IPS = "master_candidates_ips"
1668 SS_MASTER_IP = "master_ip"
1669 SS_MASTER_NETDEV = "master_netdev"
1670 SS_MASTER_NETMASK = "master_netmask"
1671 SS_MASTER_NODE = "master_node"
1672 SS_NODE_LIST = "node_list"
1673 SS_NODE_PRIMARY_IPS = "node_primary_ips"
1674 SS_NODE_SECONDARY_IPS = "node_secondary_ips"
1675 SS_OFFLINE_NODES = "offline_nodes"
1676 SS_ONLINE_NODES = "online_nodes"
1677 SS_PRIMARY_IP_FAMILY = "primary_ip_family"
1678 SS_INSTANCE_LIST = "instance_list"
1679 SS_RELEASE_VERSION = "release_version"
1680 SS_HYPERVISOR_LIST = "hypervisor_list"
1681 SS_MAINTAIN_NODE_HEALTH = "maintain_node_health"
1682 SS_UID_POOL = "uid_pool"
1683 SS_NODEGROUPS = "nodegroups"
1685 SS_FILE_PERMS = 0444
1687 # cluster wide default parameters
1688 DEFAULT_ENABLED_HYPERVISOR = HT_XEN_PVM
1692 HV_USE_BOOTLOADER: False,
1693 HV_BOOTLOADER_PATH: XEN_BOOTLOADER,
1694 HV_BOOTLOADER_ARGS: "",
1695 HV_KERNEL_PATH: XEN_KERNEL,
1697 HV_ROOT_PATH: "/dev/sda1",
1698 HV_KERNEL_ARGS: "ro",
1699 HV_MIGRATION_PORT: 8002,
1700 HV_MIGRATION_MODE: HT_MIGRATION_LIVE,
1701 HV_BLOCKDEV_PREFIX: "sd",
1702 HV_REBOOT_BEHAVIOR: INSTANCE_REBOOT_ALLOWED,
1703 HV_CPU_MASK: CPU_PINNING_ALL,
1706 HV_BOOT_ORDER: "cd",
1707 HV_CDROM_IMAGE_PATH: "",
1708 HV_NIC_TYPE: HT_NIC_RTL8139,
1709 HV_DISK_TYPE: HT_DISK_PARAVIRTUAL,
1710 HV_VNC_BIND_ADDRESS: IP4_ADDRESS_ANY,
1711 HV_VNC_PASSWORD_FILE: pathutils.VNC_PASSWORD_FILE,
1714 HV_KERNEL_PATH: "/usr/lib/xen/boot/hvmloader",
1715 HV_DEVICE_MODEL: "/usr/lib/xen/bin/qemu-dm",
1716 HV_MIGRATION_PORT: 8002,
1717 HV_MIGRATION_MODE: HT_MIGRATION_NONLIVE,
1718 HV_USE_LOCALTIME: False,
1719 HV_BLOCKDEV_PREFIX: "hd",
1721 HV_REBOOT_BEHAVIOR: INSTANCE_REBOOT_ALLOWED,
1722 HV_CPU_MASK: CPU_PINNING_ALL,
1725 HV_KERNEL_PATH: KVM_KERNEL,
1727 HV_KERNEL_ARGS: "ro",
1728 HV_ROOT_PATH: "/dev/vda1",
1730 HV_SERIAL_CONSOLE: True,
1731 HV_VNC_BIND_ADDRESS: "",
1734 HV_VNC_X509_VERIFY: False,
1735 HV_VNC_PASSWORD_FILE: "",
1736 HV_KVM_SPICE_BIND: "",
1737 HV_KVM_SPICE_IP_VERSION: IFACE_NO_IP_VERSION_SPECIFIED,
1738 HV_KVM_SPICE_PASSWORD_FILE: "",
1739 HV_KVM_SPICE_LOSSLESS_IMG_COMPR: "",
1740 HV_KVM_SPICE_JPEG_IMG_COMPR: "",
1741 HV_KVM_SPICE_ZLIB_GLZ_IMG_COMPR: "",
1742 HV_KVM_SPICE_STREAMING_VIDEO_DETECTION: "",
1743 HV_KVM_SPICE_AUDIO_COMPR: True,
1744 HV_KVM_SPICE_USE_TLS: False,
1745 HV_KVM_SPICE_TLS_CIPHERS: OPENSSL_CIPHERS,
1746 HV_KVM_SPICE_USE_VDAGENT: True,
1747 HV_KVM_FLOPPY_IMAGE_PATH: "",
1748 HV_CDROM_IMAGE_PATH: "",
1749 HV_KVM_CDROM2_IMAGE_PATH: "",
1750 HV_BOOT_ORDER: HT_BO_DISK,
1751 HV_NIC_TYPE: HT_NIC_PARAVIRTUAL,
1752 HV_DISK_TYPE: HT_DISK_PARAVIRTUAL,
1753 HV_KVM_CDROM_DISK_TYPE: "",
1756 HV_MIGRATION_PORT: 8102,
1757 HV_MIGRATION_BANDWIDTH: 32, # MiB/s
1758 HV_MIGRATION_DOWNTIME: 30, # ms
1759 HV_MIGRATION_MODE: HT_MIGRATION_LIVE,
1760 HV_USE_LOCALTIME: False,
1761 HV_DISK_CACHE: HT_CACHE_DEFAULT,
1762 HV_SECURITY_MODEL: HT_SM_NONE,
1763 HV_SECURITY_DOMAIN: "",
1765 HV_VHOST_NET: False,
1766 HV_KVM_USE_CHROOT: False,
1768 HV_REBOOT_BEHAVIOR: INSTANCE_REBOOT_ALLOWED,
1769 HV_CPU_MASK: CPU_PINNING_ALL,
1774 HV_INIT_SCRIPT: "/ganeti-chroot",
1781 HVC_GLOBALS = frozenset([
1783 HV_MIGRATION_BANDWIDTH,
1791 BE_AUTO_BALANCE: True,
1792 BE_ALWAYS_FAILOVER: False,
1798 ND_SPINDLE_COUNT: 1,
1801 DISK_LD_DEFAULTS = {
1803 LDP_RESYNC_RATE: CLASSIC_DRBD_SYNC_SPEED,
1804 LDP_BARRIERS: _autoconf.DRBD_BARRIERS,
1805 LDP_NO_META_FLUSH: _autoconf.DRBD_NO_META_FLUSH,
1806 LDP_DEFAULT_METAVG: DEFAULT_VG,
1807 LDP_DISK_CUSTOM: "",
1809 LDP_DYNAMIC_RESYNC: False,
1811 # The default values for the DRBD dynamic resync speed algorithm are taken
1812 # from the drbsetup 8.3.11 man page, except for c-plan-ahead (that we
1813 # don't need to set to 0, because we have a separate option to enable it)
1814 # and for c-max-rate, that we cap to the default value for the static resync
1816 LDP_PLAN_AHEAD: 20, # ds
1817 LDP_FILL_TARGET: 0, # sectors
1818 LDP_DELAY_TARGET: 1, # ds
1819 LDP_MAX_RATE: CLASSIC_DRBD_SYNC_SPEED, # KiB/s
1820 LDP_MIN_RATE: 4 * 1024, # KiB/s
1823 LDP_STRIPES: _autoconf.LVM_STRIPECOUNT
1832 # readability shortcuts
1833 _LV_DEFAULTS = DISK_LD_DEFAULTS[LD_LV]
1834 _DRBD_DEFAULTS = DISK_LD_DEFAULTS[LD_DRBD8]
1836 DISK_DT_DEFAULTS = {
1838 LV_STRIPES: DISK_LD_DEFAULTS[LD_LV][LDP_STRIPES],
1841 DRBD_RESYNC_RATE: _DRBD_DEFAULTS[LDP_RESYNC_RATE],
1842 DRBD_DATA_STRIPES: _LV_DEFAULTS[LDP_STRIPES],
1843 DRBD_META_STRIPES: _LV_DEFAULTS[LDP_STRIPES],
1844 DRBD_DISK_BARRIERS: _DRBD_DEFAULTS[LDP_BARRIERS],
1845 DRBD_META_BARRIERS: _DRBD_DEFAULTS[LDP_NO_META_FLUSH],
1846 DRBD_DEFAULT_METAVG: _DRBD_DEFAULTS[LDP_DEFAULT_METAVG],
1847 DRBD_DISK_CUSTOM: _DRBD_DEFAULTS[LDP_DISK_CUSTOM],
1848 DRBD_NET_CUSTOM: _DRBD_DEFAULTS[LDP_NET_CUSTOM],
1849 DRBD_DYNAMIC_RESYNC: _DRBD_DEFAULTS[LDP_DYNAMIC_RESYNC],
1850 DRBD_PLAN_AHEAD: _DRBD_DEFAULTS[LDP_PLAN_AHEAD],
1851 DRBD_FILL_TARGET: _DRBD_DEFAULTS[LDP_FILL_TARGET],
1852 DRBD_DELAY_TARGET: _DRBD_DEFAULTS[LDP_DELAY_TARGET],
1853 DRBD_MAX_RATE: _DRBD_DEFAULTS[LDP_MAX_RATE],
1854 DRBD_MIN_RATE: _DRBD_DEFAULTS[LDP_MIN_RATE],
1861 RBD_POOL: DISK_LD_DEFAULTS[LD_RBD][LDP_POOL]
1865 # we don't want to export the shortcuts
1866 del _LV_DEFAULTS, _DRBD_DEFAULTS
1869 NIC_MODE: NIC_MODE_BRIDGED,
1870 NIC_LINK: DEFAULT_BRIDGE,
1873 # All of the following values are quite arbitrarily - there are no
1874 # "good" defaults, these must be customised per-site
1875 IPOLICY_DEFAULTS = {
1877 ISPEC_MEM_SIZE: 128,
1879 ISPEC_DISK_COUNT: 1,
1880 ISPEC_DISK_SIZE: 1024,
1882 ISPEC_SPINDLE_USE: 1,
1885 ISPEC_MEM_SIZE: 32768,
1887 ISPEC_DISK_COUNT: MAX_DISKS,
1888 ISPEC_DISK_SIZE: 1024 * 1024,
1889 ISPEC_NIC_COUNT: MAX_NICS,
1890 ISPEC_SPINDLE_USE: 12,
1893 ISPEC_MEM_SIZE: 128,
1895 ISPEC_DISK_COUNT: 1,
1896 ISPEC_DISK_SIZE: 1024,
1898 ISPEC_SPINDLE_USE: 1,
1900 IPOLICY_DTS: DISK_TEMPLATES,
1901 IPOLICY_VCPU_RATIO: 4.0,
1902 IPOLICY_SPINDLE_RATIO: 32.0,
1905 MASTER_POOL_SIZE_DEFAULT = 10
1907 CONFD_PROTOCOL_VERSION = 1
1910 CONFD_REQ_NODE_ROLE_BYNAME = 1
1911 CONFD_REQ_NODE_PIP_BY_INSTANCE_IP = 2
1912 CONFD_REQ_CLUSTER_MASTER = 3
1913 CONFD_REQ_NODE_PIP_LIST = 4
1914 CONFD_REQ_MC_PIP_LIST = 5
1915 CONFD_REQ_INSTANCES_IPS_LIST = 6
1916 CONFD_REQ_NODE_DRBD = 7
1918 # Confd request query fields. These are used to narrow down queries.
1919 # These must be strings rather than integers, because json-encoding
1920 # converts them to strings anyway, as they're used as dict-keys.
1921 CONFD_REQQ_LINK = "0"
1923 CONFD_REQQ_IPLIST = "2"
1924 CONFD_REQQ_FIELDS = "3"
1926 CONFD_REQFIELD_NAME = "0"
1927 CONFD_REQFIELD_IP = "1"
1928 CONFD_REQFIELD_MNODE_PIP = "2"
1930 CONFD_REQS = frozenset([
1932 CONFD_REQ_NODE_ROLE_BYNAME,
1933 CONFD_REQ_NODE_PIP_BY_INSTANCE_IP,
1934 CONFD_REQ_CLUSTER_MASTER,
1935 CONFD_REQ_NODE_PIP_LIST,
1936 CONFD_REQ_MC_PIP_LIST,
1937 CONFD_REQ_INSTANCES_IPS_LIST,
1938 CONFD_REQ_NODE_DRBD,
1941 CONFD_REPL_STATUS_OK = 0
1942 CONFD_REPL_STATUS_ERROR = 1
1943 CONFD_REPL_STATUS_NOTIMPLEMENTED = 2
1945 CONFD_REPL_STATUSES = frozenset([
1946 CONFD_REPL_STATUS_OK,
1947 CONFD_REPL_STATUS_ERROR,
1948 CONFD_REPL_STATUS_NOTIMPLEMENTED,
1951 (CONFD_NODE_ROLE_MASTER,
1952 CONFD_NODE_ROLE_CANDIDATE,
1953 CONFD_NODE_ROLE_OFFLINE,
1954 CONFD_NODE_ROLE_DRAINED,
1955 CONFD_NODE_ROLE_REGULAR,
1958 # A few common errors for confd
1959 CONFD_ERROR_UNKNOWN_ENTRY = 1
1960 CONFD_ERROR_INTERNAL = 2
1961 CONFD_ERROR_ARGUMENT = 3
1963 # Each request is "salted" by the current timestamp.
1964 # This constants decides how many seconds of skew to accept.
1965 # TODO: make this a default and allow the value to be more configurable
1966 CONFD_MAX_CLOCK_SKEW = 2 * NODE_MAX_CLOCK_SKEW
1968 # When we haven't reloaded the config for more than this amount of seconds, we
1969 # force a test to see if inotify is betraying us.
1970 CONFD_CONFIG_RELOAD_TIMEOUT = 60
1972 # If we receive more than one update in this amount of seconds, we move to
1973 # polling every RATELIMIT seconds, rather than relying on inotify, to be able
1974 # to serve more requests.
1975 CONFD_CONFIG_RELOAD_RATELIMIT = 2
1977 # Magic number prepended to all confd queries.
1978 # This allows us to distinguish different types of confd protocols and handle
1979 # them. For example by changing this we can move the whole payload to be
1980 # compressed, or move away from json.
1981 CONFD_MAGIC_FOURCC = "plj0"
1983 # By default a confd request is sent to the minimum between this number and all
1984 # MCs. 6 was chosen because even in the case of a disastrous 50% response rate,
1985 # we should have enough answers to be able to compare more than one.
1986 CONFD_DEFAULT_REQ_COVERAGE = 6
1988 # Timeout in seconds to expire pending query request in the confd client
1989 # library. We don't actually expect any answer more than 10 seconds after we
1991 CONFD_CLIENT_EXPIRE_TIMEOUT = 10
1993 # Maximum UDP datagram size.
1994 # On IPv4: 64K - 20 (ip header size) - 8 (udp header size) = 65507
1995 # On IPv6: 64K - 40 (ip6 header size) - 8 (udp header size) = 65487
1996 # (assuming we can't use jumbo frames)
1997 # We just set this to 60K, which should be enough
1998 MAX_UDP_DATA_SIZE = 61440
2000 # User-id pool minimum/maximum acceptable user-ids.
2002 UIDPOOL_UID_MAX = 2 ** 32 - 1 # Assuming 32 bit user-ids
2004 # Name or path of the pgrep command
2007 # Name of the node group that gets created at cluster init or upgrade
2008 INITIAL_NODE_GROUP_NAME = "default"
2010 # Possible values for NodeGroup.alloc_policy
2011 ALLOC_POLICY_PREFERRED = "preferred"
2012 ALLOC_POLICY_LAST_RESORT = "last_resort"
2013 ALLOC_POLICY_UNALLOCABLE = "unallocable"
2014 VALID_ALLOC_POLICIES = [
2015 ALLOC_POLICY_PREFERRED,
2016 ALLOC_POLICY_LAST_RESORT,
2017 ALLOC_POLICY_UNALLOCABLE,
2020 # Temporary external/shared storage parameters
2021 BLOCKDEV_DRIVER_MANUAL = "manual"
2023 # qemu-img path, required for ovfconverter
2024 QEMUIMG_PATH = _autoconf.QEMUIMG_PATH
2026 # Whether htools was enabled at compilation time
2027 HTOOLS = _autoconf.HTOOLS
2028 # The hail iallocator
2029 IALLOC_HAIL = "hail"
2031 # Fake opcodes for functions that have hooks attached to them via
2032 # backend.RunLocalHooks
2033 FAKE_OP_MASTER_TURNUP = "OP_CLUSTER_IP_TURNUP"
2034 FAKE_OP_MASTER_TURNDOWN = "OP_CLUSTER_IP_TURNDOWN"
2036 # Do not re-export imported modules
2037 del re, _vcsversion, _autoconf, socket, pathutils