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.pathutils import * # pylint: disable=W0401,W0614
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
105 # cpu pinning separators and constants
106 CPU_PINNING_SEP = ":"
107 CPU_PINNING_ALL = "all"
108 # internal representation of "all"
109 CPU_PINNING_ALL_VAL = -1
110 # one "all" entry in a CPU list means CPU pinning is off
111 CPU_PINNING_OFF = [CPU_PINNING_ALL_VAL]
113 # A Xen-specific implementation detail - there is no way to actually say
114 # "use any cpu for pinning" in a Xen configuration file, as opposed to the
115 # command line, where you can say "xm vcpu-pin <domain> <vcpu> all".
116 # The workaround used in Xen is "0-63" (see source code function
117 # xm_vcpu_pin in <xen-source>/tools/python/xen/xm/main.py).
118 # To support future changes, the following constant is treated as a
119 # blackbox string that simply means use-any-cpu-for-pinning-under-xen.
120 CPU_PINNING_ALL_XEN = "0-63"
122 # A KVM-specific implementation detail - the following value is used
123 # to set CPU affinity to all processors (#0 through #31), per taskset
125 # FIXME: This only works for machines with up to 32 CPU cores
126 CPU_PINNING_ALL_KVM = 0xFFFFFFFF
130 WIPE_BLOCK_SIZE = 1024 ** 2
131 MAX_WIPE_CHUNK = 1024 # 1GB
132 MIN_WIPE_CHUNK_PERCENT = 10
135 SECURE_DIR_MODE = 0700
136 SECURE_FILE_MODE = 0600
137 ADOPTABLE_BLOCKDEV_ROOT = "/dev/disk/"
138 ETC_HOSTS = "/etc/hosts"
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 HS_CONFD = _autoconf.HS_CONFD
143 ENABLE_SPLIT_QUERY = _autoconf.ENABLE_SPLIT_QUERY
145 NODED = "ganeti-noded"
146 CONFD = "ganeti-confd"
148 MASTERD = "ganeti-masterd"
149 # used in the ganeti-nbma project
153 # daemon-name: ("proto", "default-port")
154 NODED: ("tcp", 1811),
155 CONFD: ("udp", 1814),
158 # used in the ganeti-nbma project
161 DEFAULT_NODED_PORT = DAEMONS_PORTS[NODED][1]
162 DEFAULT_CONFD_PORT = DAEMONS_PORTS[CONFD][1]
163 DEFAULT_RAPI_PORT = DAEMONS_PORTS[RAPI][1]
164 # used in the ganeti-nbma project
165 DEFAULT_NLD_PORT = DAEMONS_PORTS[NLD][1]
167 FIRST_DRBD_PORT = 11000
168 LAST_DRBD_PORT = 14999
170 DEV_CONSOLE = "/dev/console"
172 PROC_MOUNTS = "/proc/mounts"
174 # Local UniX Interface related constants
176 LUXI_VERSION = CONFIG_VERSION
178 # one of "no", "yes", "only"
179 SYSLOG_USAGE = _autoconf.SYSLOG_USAGE
183 SYSLOG_SOCKET = "/dev/log"
185 EXPORT_CONF_FILE = "config.ini"
187 XEN_BOOTLOADER = _autoconf.XEN_BOOTLOADER
188 XEN_KERNEL = _autoconf.XEN_KERNEL
189 XEN_INITRD = _autoconf.XEN_INITRD
192 # FIXME: This will be made configurable using hvparams in Ganeti 2.7
193 XEN_CMD = _autoconf.XEN_CMD
195 KVM_PATH = _autoconf.KVM_PATH
196 KVM_KERNEL = _autoconf.KVM_KERNEL
197 SOCAT_PATH = _autoconf.SOCAT_PATH
198 SOCAT_USE_ESCAPE = _autoconf.SOCAT_USE_ESCAPE
199 SOCAT_USE_COMPRESS = _autoconf.SOCAT_USE_COMPRESS
200 SOCAT_ESCAPE_CODE = "0x1d"
202 #: Console as SSH command
205 #: Console as VNC server
208 #: Console as SPICE server
211 #: Display a message for console access
215 CONS_ALL = frozenset([CONS_SSH, CONS_VNC, CONS_SPICE, CONS_MESSAGE])
217 # For RSA keys more bits are better, but they also make operations more
218 # expensive. NIST SP 800-131 recommends a minimum of 2048 bits from the year
222 # Ciphers allowed for SSL connections. For the format, see ciphers(1). A better
223 # way to disable ciphers would be to use the exclamation mark (!), but socat
224 # versions below 1.5 can't parse exclamation marks in options properly. When
225 # modifying the ciphers, ensure not to accidentially add something after it's
226 # been removed. Use the "openssl" utility to check the allowed ciphers, e.g.
227 # "openssl ciphers -v HIGH:-DES".
228 OPENSSL_CIPHERS = "HIGH:-DES:-3DES:-EXPORT:-ADH"
230 # Digest used to sign certificates ("openssl x509" uses SHA1 by default)
231 X509_CERT_SIGN_DIGEST = "SHA1"
233 # Default validity of certificates in days
234 X509_CERT_DEFAULT_VALIDITY = 365 * 5
236 # commonName (CN) used in certificates
237 X509_CERT_CN = "ganeti.example.com"
239 X509_CERT_SIGNATURE_HEADER = "X-Ganeti-Signature"
241 # Import/export daemon mode
242 IEM_IMPORT = "import"
243 IEM_EXPORT = "export"
245 # Import/export transport compression
248 IEC_ALL = frozenset([
253 IE_CUSTOM_SIZE = "fd"
255 IE_MAGIC_RE = re.compile(r"^[-_.a-zA-Z0-9]{5,100}$")
258 # Direct file I/O, equivalent to a shell's I/O redirection using '<' or '>'
260 # Raw block device I/O using "dd"
261 IEIO_RAW_DISK = "raw"
262 # OS definition import/export script
263 IEIO_SCRIPT = "script"
265 VALUE_DEFAULT = "default"
267 VALUE_GENERATE = "generate"
270 VALUE_FALSE = "false"
272 # External script validation mask
273 EXT_PLUGIN_MASK = re.compile("^[a-zA-Z0-9_-]+$")
275 # hooks-related constants
276 HOOKS_PHASE_PRE = "pre"
277 HOOKS_PHASE_POST = "post"
278 HOOKS_NAME_CFGUPDATE = "config-update"
279 HOOKS_NAME_WATCHER = "watcher"
281 HOOKS_PATH = "/sbin:/bin:/usr/sbin:/usr/bin"
283 # hooks subject type (what object type does the LU deal with)
284 HTYPE_CLUSTER = "CLUSTER"
286 HTYPE_GROUP = "GROUP"
287 HTYPE_INSTANCE = "INSTANCE"
299 # first two are valid in LU context only, not passed to backend
302 # and the rest are valid in backend
307 SF_ALLOCATABLE = "allocatable"
310 SO_FIX_CONSISTENCY = "fix-consistency"
312 # Available fields per storage type
313 VALID_STORAGE_FIELDS = frozenset([
322 VALID_STORAGE_TYPES = frozenset([ST_FILE, ST_LVM_PV, ST_LVM_VG])
324 MODIFIABLE_STORAGE_FIELDS = {
325 ST_LVM_PV: frozenset([SF_ALLOCATABLE]),
328 VALID_STORAGE_OPERATIONS = {
329 ST_LVM_VG: frozenset([SO_FIX_CONSISTENCY]),
333 # Note: Code depends on LDS_OKAY < LDS_UNKNOWN < LDS_FAULTY
336 LDS_FAULTY) = range(1, 4)
338 # disk template types
339 DT_DISKLESS = "diskless"
343 DT_SHARED_FILE = "sharedfile"
344 DT_BLOCK = "blockdev"
347 # the set of network-mirrored disk templates
348 DTS_INT_MIRROR = frozenset([DT_DRBD8])
350 # the set of externally-mirrored disk templates (e.g. SAN, NAS)
351 DTS_EXT_MIRROR = frozenset([DT_SHARED_FILE, DT_BLOCK, DT_RBD])
353 # the set of non-lvm-based disk templates
354 DTS_NOT_LVM = frozenset([DT_DISKLESS, DT_FILE, DT_SHARED_FILE,
357 # the set of disk templates which can be grown
358 DTS_GROWABLE = frozenset([DT_PLAIN, DT_DRBD8, DT_FILE, DT_SHARED_FILE, DT_RBD])
360 # the set of disk templates that allow adoption
361 DTS_MAY_ADOPT = frozenset([DT_PLAIN, DT_BLOCK])
363 # the set of disk templates that *must* use adoption
364 DTS_MUST_ADOPT = frozenset([DT_BLOCK])
366 # the set of disk templates that allow migrations
367 DTS_MIRRORED = frozenset.union(DTS_INT_MIRROR, DTS_EXT_MIRROR)
369 # the set of file based disk templates
370 DTS_FILEBASED = frozenset([DT_FILE, DT_SHARED_FILE])
376 LD_BLOCKDEV = "blockdev"
378 LOGICAL_DISK_TYPES = frozenset([
386 LDS_BLOCK = frozenset([LD_LV, LD_DRBD8, LD_BLOCKDEV, LD_RBD])
389 DRBD_HMAC_ALG = "md5"
390 DRBD_NET_PROTOCOL = "C"
392 #: Size of DRBD meta block device
397 DRBD_B_DISK_BARRIERS = "b"
398 DRBD_B_DISK_DRAIN = "d"
399 DRBD_B_DISK_FLUSH = "f"
401 # Valid barrier combinations: "n" or any non-null subset of "bfd"
402 DRBD_VALID_BARRIER_OPT = frozenset([
403 frozenset([DRBD_B_NONE]),
404 frozenset([DRBD_B_DISK_BARRIERS]),
405 frozenset([DRBD_B_DISK_DRAIN]),
406 frozenset([DRBD_B_DISK_FLUSH]),
407 frozenset([DRBD_B_DISK_DRAIN, DRBD_B_DISK_FLUSH]),
408 frozenset([DRBD_B_DISK_DRAIN, DRBD_B_DISK_FLUSH]),
409 frozenset([DRBD_B_DISK_BARRIERS, DRBD_B_DISK_DRAIN]),
410 frozenset([DRBD_B_DISK_BARRIERS, DRBD_B_DISK_FLUSH]),
411 frozenset([DRBD_B_DISK_BARRIERS, DRBD_B_DISK_FLUSH, DRBD_B_DISK_DRAIN]),
417 # file backend driver
421 # the set of drbd-like disk types
422 LDS_DRBD = frozenset([LD_DRBD8])
427 DISK_ACCESS_SET = frozenset([DISK_RDONLY, DISK_RDWR])
429 # disk replacement mode
430 REPLACE_DISK_PRI = "replace_on_primary" # replace disks on primary
431 REPLACE_DISK_SEC = "replace_on_secondary" # replace disks on secondary
432 REPLACE_DISK_CHG = "replace_new_secondary" # change secondary node
433 REPLACE_DISK_AUTO = "replace_auto"
434 REPLACE_MODES = frozenset([
441 # Instance export mode
442 EXPORT_MODE_LOCAL = "local"
443 EXPORT_MODE_REMOTE = "remote"
444 EXPORT_MODES = frozenset([
449 # instance creation modes
450 INSTANCE_CREATE = "create"
451 INSTANCE_IMPORT = "import"
452 INSTANCE_REMOTE_IMPORT = "remote-import"
453 INSTANCE_CREATE_MODES = frozenset([
456 INSTANCE_REMOTE_IMPORT,
459 # Remote import/export handshake message and version
461 RIE_HANDSHAKE = "Hi, I'm Ganeti"
463 # Remote import/export certificate validity in seconds
464 RIE_CERT_VALIDITY = 24 * 60 * 60
466 # Overall timeout for establishing connection
467 RIE_CONNECT_TIMEOUT = 180
469 # Export only: how long to wait per connection attempt (seconds)
470 RIE_CONNECT_ATTEMPT_TIMEOUT = 20
472 # Export only: number of attempts to connect
473 RIE_CONNECT_RETRIES = 10
475 #: Give child process up to 5 seconds to exit after sending a signal
476 CHILD_LINGER_TIMEOUT = 5.0
478 DISK_TEMPLATES = frozenset([
488 FILE_DRIVER = frozenset([FD_LOOP, FD_BLKTAP])
490 # import/export config options
491 INISECT_EXP = "export"
492 INISECT_INS = "instance"
493 INISECT_HYP = "hypervisor"
494 INISECT_BEP = "backend"
497 # dynamic device modification
499 DDM_MODIFY = "modify"
500 DDM_REMOVE = "remove"
501 DDMS_VALUES = frozenset([DDM_ADD, DDM_REMOVE])
502 DDMS_VALUES_WITH_MODIFY = (DDMS_VALUES | frozenset([
505 # TODO: DDM_SWAP, DDM_MOVE?
512 EXIT_NODESETUP_ERROR = 12
513 EXIT_CONFIRMATION = 13 # need user confirmation
515 #: Exit code for query operations with unknown fields
516 EXIT_UNKNOWN_FIELD = 14
519 TAG_CLUSTER = "cluster"
520 TAG_NODEGROUP = "nodegroup"
522 TAG_INSTANCE = "instance"
523 VALID_TAG_TYPES = frozenset([
530 MAX_TAGS_PER_OBJ = 4096
533 DEFAULT_BRIDGE = "xen-br0"
534 CLASSIC_DRBD_SYNC_SPEED = 60 * 1024 # 60 MiB, expressed in KiB
535 IP4_ADDRESS_LOCALHOST = "127.0.0.1"
536 IP4_ADDRESS_ANY = "0.0.0.0"
537 IP6_ADDRESS_LOCALHOST = "::1"
538 IP6_ADDRESS_ANY = "::"
541 VALID_IP_VERSIONS = frozenset([IP4_VERSION, IP6_VERSION])
542 # for export to htools
543 IP4_FAMILY = socket.AF_INET
544 IP6_FAMILY = socket.AF_INET6
546 TCP_PING_TIMEOUT = 10
547 GANETI_RUNAS = "root"
549 DEFAULT_DRBD_HELPER = "/bin/true"
551 DEFAULT_MAC_PREFIX = "aa:00:00"
552 # default maximum instance wait time, in seconds.
553 DEFAULT_SHUTDOWN_TIMEOUT = 120
554 NODE_MAX_CLOCK_SKEW = 150
555 # Time for an intra-cluster disk transfer to wait for a connection
556 DISK_TRANSFER_CONNECT_TIMEOUT = 60
557 # Disk index separator
558 DISK_SEPARATOR = _autoconf.DISK_SEPARATOR
559 IP_COMMAND_PATH = _autoconf.IP_PATH
561 #: Key for job IDs in opcode result
567 RUNPARTS_ERR) = range(3)
569 RUNPARTS_STATUS = frozenset([RUNPARTS_SKIP, RUNPARTS_RUN, RUNPARTS_ERR])
573 RPC_ENCODING_ZLIB_BASE64) = range(2)
575 # Various time constants for the timeout table
576 RPC_TMO_URGENT = 60 # one minute
577 RPC_TMO_FAST = 5 * 60 # five minutes
578 RPC_TMO_NORMAL = 15 * 60 # 15 minutes
579 RPC_TMO_SLOW = 3600 # one hour
580 RPC_TMO_4HRS = 4 * 3600
583 # Timeout for connecting to nodes (seconds)
584 RPC_CONNECT_TIMEOUT = 5
586 # os related constants
587 OS_SCRIPT_CREATE = "create"
588 OS_SCRIPT_IMPORT = "import"
589 OS_SCRIPT_EXPORT = "export"
590 OS_SCRIPT_RENAME = "rename"
591 OS_SCRIPT_VERIFY = "verify"
592 OS_SCRIPTS = frozenset([
600 OS_API_FILE = "ganeti_api_version"
601 OS_VARIANTS_FILE = "variants.list"
602 OS_PARAMETERS_FILE = "parameters.list"
604 OS_VALIDATE_PARAMETERS = "parameters"
605 OS_VALIDATE_CALLS = frozenset([OS_VALIDATE_PARAMETERS])
612 INSTANCE_REBOOT_SOFT = "soft"
613 INSTANCE_REBOOT_HARD = "hard"
614 INSTANCE_REBOOT_FULL = "full"
616 REBOOT_TYPES = frozenset([
617 INSTANCE_REBOOT_SOFT,
618 INSTANCE_REBOOT_HARD,
622 # instance reboot behaviors
623 INSTANCE_REBOOT_ALLOWED = "reboot"
624 INSTANCE_REBOOT_EXIT = "exit"
626 REBOOT_BEHAVIORS = frozenset([
627 INSTANCE_REBOOT_ALLOWED,
631 VTYPE_STRING = "string"
632 VTYPE_MAYBE_STRING = "maybe-string"
634 VTYPE_SIZE = "size" # size, in MiBs
636 ENFORCEABLE_TYPES = frozenset([
644 # Constant representing that the user does not specify any IP version
645 IFACE_NO_IP_VERSION_SPECIFIED = 0
647 # HV parameter names (global namespace)
648 HV_BOOT_ORDER = "boot_order"
649 HV_CDROM_IMAGE_PATH = "cdrom_image_path"
650 HV_KVM_CDROM2_IMAGE_PATH = "cdrom2_image_path"
651 HV_KVM_FLOPPY_IMAGE_PATH = "floppy_image_path"
652 HV_NIC_TYPE = "nic_type"
653 HV_DISK_TYPE = "disk_type"
654 HV_KVM_CDROM_DISK_TYPE = "cdrom_disk_type"
655 HV_VNC_BIND_ADDRESS = "vnc_bind_address"
656 HV_VNC_PASSWORD_FILE = "vnc_password_file"
657 HV_VNC_TLS = "vnc_tls"
658 HV_VNC_X509 = "vnc_x509_path"
659 HV_VNC_X509_VERIFY = "vnc_x509_verify"
660 HV_KVM_SPICE_BIND = "spice_bind"
661 HV_KVM_SPICE_IP_VERSION = "spice_ip_version"
662 HV_KVM_SPICE_PASSWORD_FILE = "spice_password_file"
663 HV_KVM_SPICE_LOSSLESS_IMG_COMPR = "spice_image_compression"
664 HV_KVM_SPICE_JPEG_IMG_COMPR = "spice_jpeg_wan_compression"
665 HV_KVM_SPICE_ZLIB_GLZ_IMG_COMPR = "spice_zlib_glz_wan_compression"
666 HV_KVM_SPICE_STREAMING_VIDEO_DETECTION = "spice_streaming_video"
667 HV_KVM_SPICE_AUDIO_COMPR = "spice_playback_compression"
668 HV_KVM_SPICE_USE_TLS = "spice_use_tls"
669 HV_KVM_SPICE_TLS_CIPHERS = "spice_tls_ciphers"
670 HV_KVM_SPICE_USE_VDAGENT = "spice_use_vdagent"
673 HV_USE_BOOTLOADER = "use_bootloader"
674 HV_BOOTLOADER_ARGS = "bootloader_args"
675 HV_BOOTLOADER_PATH = "bootloader_path"
676 HV_KERNEL_ARGS = "kernel_args"
677 HV_KERNEL_PATH = "kernel_path"
678 HV_INITRD_PATH = "initrd_path"
679 HV_ROOT_PATH = "root_path"
680 HV_SERIAL_CONSOLE = "serial_console"
681 HV_USB_MOUSE = "usb_mouse"
683 HV_DEVICE_MODEL = "device_model"
684 HV_INIT_SCRIPT = "init_script"
685 HV_MIGRATION_PORT = "migration_port"
686 HV_MIGRATION_BANDWIDTH = "migration_bandwidth"
687 HV_MIGRATION_DOWNTIME = "migration_downtime"
688 HV_MIGRATION_MODE = "migration_mode"
689 HV_USE_LOCALTIME = "use_localtime"
690 HV_DISK_CACHE = "disk_cache"
691 HV_SECURITY_MODEL = "security_model"
692 HV_SECURITY_DOMAIN = "security_domain"
693 HV_KVM_FLAG = "kvm_flag"
694 HV_VHOST_NET = "vhost_net"
695 HV_KVM_USE_CHROOT = "use_chroot"
696 HV_CPU_MASK = "cpu_mask"
697 HV_MEM_PATH = "mem_path"
698 HV_PASSTHROUGH = "pci_pass"
699 HV_BLOCKDEV_PREFIX = "blockdev_prefix"
700 HV_REBOOT_BEHAVIOR = "reboot_behavior"
701 HV_CPU_TYPE = "cpu_type"
703 HVS_PARAMETER_TYPES = {
704 HV_BOOT_ORDER: VTYPE_STRING,
705 HV_KVM_FLOPPY_IMAGE_PATH: VTYPE_STRING,
706 HV_CDROM_IMAGE_PATH: VTYPE_STRING,
707 HV_KVM_CDROM2_IMAGE_PATH: VTYPE_STRING,
708 HV_NIC_TYPE: VTYPE_STRING,
709 HV_DISK_TYPE: VTYPE_STRING,
710 HV_KVM_CDROM_DISK_TYPE: VTYPE_STRING,
711 HV_VNC_PASSWORD_FILE: VTYPE_STRING,
712 HV_VNC_BIND_ADDRESS: VTYPE_STRING,
713 HV_VNC_TLS: VTYPE_BOOL,
714 HV_VNC_X509: VTYPE_STRING,
715 HV_VNC_X509_VERIFY: VTYPE_BOOL,
716 HV_KVM_SPICE_BIND: VTYPE_STRING,
717 HV_KVM_SPICE_IP_VERSION: VTYPE_INT,
718 HV_KVM_SPICE_PASSWORD_FILE: VTYPE_STRING,
719 HV_KVM_SPICE_LOSSLESS_IMG_COMPR: VTYPE_STRING,
720 HV_KVM_SPICE_JPEG_IMG_COMPR: VTYPE_STRING,
721 HV_KVM_SPICE_ZLIB_GLZ_IMG_COMPR: VTYPE_STRING,
722 HV_KVM_SPICE_STREAMING_VIDEO_DETECTION: VTYPE_STRING,
723 HV_KVM_SPICE_AUDIO_COMPR: VTYPE_BOOL,
724 HV_KVM_SPICE_USE_TLS: VTYPE_BOOL,
725 HV_KVM_SPICE_TLS_CIPHERS: VTYPE_STRING,
726 HV_KVM_SPICE_USE_VDAGENT: VTYPE_BOOL,
729 HV_USE_BOOTLOADER: VTYPE_BOOL,
730 HV_BOOTLOADER_PATH: VTYPE_STRING,
731 HV_BOOTLOADER_ARGS: VTYPE_STRING,
732 HV_KERNEL_PATH: VTYPE_STRING,
733 HV_KERNEL_ARGS: VTYPE_STRING,
734 HV_INITRD_PATH: VTYPE_STRING,
735 HV_ROOT_PATH: VTYPE_MAYBE_STRING,
736 HV_SERIAL_CONSOLE: VTYPE_BOOL,
737 HV_USB_MOUSE: VTYPE_STRING,
738 HV_KEYMAP: VTYPE_STRING,
739 HV_DEVICE_MODEL: VTYPE_STRING,
740 HV_INIT_SCRIPT: VTYPE_STRING,
741 HV_MIGRATION_PORT: VTYPE_INT,
742 HV_MIGRATION_BANDWIDTH: VTYPE_INT,
743 HV_MIGRATION_DOWNTIME: VTYPE_INT,
744 HV_MIGRATION_MODE: VTYPE_STRING,
745 HV_USE_LOCALTIME: VTYPE_BOOL,
746 HV_DISK_CACHE: VTYPE_STRING,
747 HV_SECURITY_MODEL: VTYPE_STRING,
748 HV_SECURITY_DOMAIN: VTYPE_STRING,
749 HV_KVM_FLAG: VTYPE_STRING,
750 HV_VHOST_NET: VTYPE_BOOL,
751 HV_KVM_USE_CHROOT: VTYPE_BOOL,
752 HV_CPU_MASK: VTYPE_STRING,
753 HV_MEM_PATH: VTYPE_STRING,
754 HV_PASSTHROUGH: VTYPE_STRING,
755 HV_BLOCKDEV_PREFIX: VTYPE_STRING,
756 HV_REBOOT_BEHAVIOR: VTYPE_STRING,
757 HV_CPU_TYPE: VTYPE_STRING,
760 HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys())
762 HVS_PARAMETER_TITLES = {
764 HV_BOOT_ORDER: "Boot_order",
765 HV_CDROM_IMAGE_PATH: "CDROM_image_path",
766 HV_DISK_TYPE: "Disk_type",
767 HV_INITRD_PATH: "Initrd_path",
768 HV_KERNEL_PATH: "Kernel_path",
769 HV_NIC_TYPE: "NIC_type",
771 HV_VNC_BIND_ADDRESS: "VNC_bind_address",
772 HV_PASSTHROUGH: "pci_pass",
773 HV_CPU_TYPE: "cpu_type",
777 HV_MIGRATION_COMPLETED = "completed"
778 HV_MIGRATION_ACTIVE = "active"
779 HV_MIGRATION_FAILED = "failed"
780 HV_MIGRATION_CANCELLED = "cancelled"
782 HV_MIGRATION_VALID_STATUSES = frozenset([
783 HV_MIGRATION_COMPLETED,
786 HV_MIGRATION_CANCELLED,
789 HV_MIGRATION_FAILED_STATUSES = frozenset([
791 HV_MIGRATION_CANCELLED,
794 # KVM-specific statuses
795 HV_KVM_MIGRATION_VALID_STATUSES = HV_MIGRATION_VALID_STATUSES
798 HV_NODEINFO_KEY_VERSION = "hv_version"
801 HVST_MEMORY_TOTAL = "mem_total"
802 HVST_MEMORY_NODE = "mem_node"
803 HVST_MEMORY_HV = "mem_hv"
804 HVST_CPU_TOTAL = "cpu_total"
805 HVST_CPU_NODE = "cpu_node"
808 HVST_MEMORY_TOTAL: 0,
815 HVSTS_PARAMETER_TYPES = {
816 HVST_MEMORY_TOTAL: VTYPE_INT,
817 HVST_MEMORY_NODE: VTYPE_INT,
818 HVST_MEMORY_HV: VTYPE_INT,
819 HVST_CPU_TOTAL: VTYPE_INT,
820 HVST_CPU_NODE: VTYPE_INT,
823 HVSTS_PARAMETERS = frozenset(HVSTS_PARAMETER_TYPES.keys())
826 DS_DISK_TOTAL = "disk_total"
827 DS_DISK_RESERVED = "disk_reserved"
828 DS_DISK_OVERHEAD = "disk_overhead"
836 DSS_PARAMETER_TYPES = {
837 DS_DISK_TOTAL: VTYPE_INT,
838 DS_DISK_RESERVED: VTYPE_INT,
839 DS_DISK_OVERHEAD: VTYPE_INT,
842 DSS_PARAMETERS = frozenset(DSS_PARAMETER_TYPES.keys())
843 DS_VALID_TYPES = frozenset([LD_LV])
845 # Backend parameter names
846 BE_MEMORY = "memory" # deprecated and replaced by max and min mem
850 BE_AUTO_BALANCE = "auto_balance"
851 BE_ALWAYS_FAILOVER = "always_failover"
852 BE_SPINDLE_USE = "spindle_use"
854 BES_PARAMETER_TYPES = {
855 BE_MAXMEM: VTYPE_SIZE,
856 BE_MINMEM: VTYPE_SIZE,
858 BE_AUTO_BALANCE: VTYPE_BOOL,
859 BE_ALWAYS_FAILOVER: VTYPE_BOOL,
860 BE_SPINDLE_USE: VTYPE_INT,
863 BES_PARAMETER_TITLES = {
864 BE_AUTO_BALANCE: "Auto_balance",
865 BE_MAXMEM: "ConfigMaxMem",
866 BE_MINMEM: "ConfigMinMem",
867 BE_VCPUS: "ConfigVCPUs",
870 BES_PARAMETER_COMPAT = {
871 BE_MEMORY: VTYPE_SIZE,
873 BES_PARAMETER_COMPAT.update(BES_PARAMETER_TYPES)
875 BES_PARAMETERS = frozenset(BES_PARAMETER_TYPES.keys())
878 ISPEC_MEM_SIZE = "memory-size"
879 ISPEC_CPU_COUNT = "cpu-count"
880 ISPEC_DISK_COUNT = "disk-count"
881 ISPEC_DISK_SIZE = "disk-size"
882 ISPEC_NIC_COUNT = "nic-count"
883 ISPEC_SPINDLE_USE = "spindle-use"
885 ISPECS_PARAMETER_TYPES = {
886 ISPEC_MEM_SIZE: VTYPE_INT,
887 ISPEC_CPU_COUNT: VTYPE_INT,
888 ISPEC_DISK_COUNT: VTYPE_INT,
889 ISPEC_DISK_SIZE: VTYPE_INT,
890 ISPEC_NIC_COUNT: VTYPE_INT,
891 ISPEC_SPINDLE_USE: VTYPE_INT,
894 ISPECS_PARAMETERS = frozenset(ISPECS_PARAMETER_TYPES.keys())
899 IPOLICY_DTS = "disk-templates"
900 IPOLICY_VCPU_RATIO = "vcpu-ratio"
901 IPOLICY_SPINDLE_RATIO = "spindle-ratio"
903 IPOLICY_ISPECS = frozenset([
909 IPOLICY_PARAMETERS = frozenset([
911 IPOLICY_SPINDLE_RATIO,
914 IPOLICY_ALL_KEYS = (IPOLICY_ISPECS |
916 frozenset([IPOLICY_DTS]))
918 # Node parameter names
919 ND_OOB_PROGRAM = "oob_program"
920 ND_SPINDLE_COUNT = "spindle_count"
922 NDS_PARAMETER_TYPES = {
923 ND_OOB_PROGRAM: VTYPE_STRING,
924 ND_SPINDLE_COUNT: VTYPE_INT,
927 NDS_PARAMETERS = frozenset(NDS_PARAMETER_TYPES.keys())
929 NDS_PARAMETER_TITLES = {
930 ND_OOB_PROGRAM: "OutOfBandProgram",
931 ND_SPINDLE_COUNT: "SpindleCount",
934 # Logical Disks parameters
935 LDP_RESYNC_RATE = "resync-rate"
936 LDP_STRIPES = "stripes"
937 LDP_BARRIERS = "disabled-barriers"
938 LDP_NO_META_FLUSH = "disable-meta-flush"
939 LDP_DEFAULT_METAVG = "default-metavg"
940 LDP_DISK_CUSTOM = "disk-custom"
941 LDP_NET_CUSTOM = "net-custom"
942 LDP_DYNAMIC_RESYNC = "dynamic-resync"
943 LDP_PLAN_AHEAD = "c-plan-ahead"
944 LDP_FILL_TARGET = "c-fill-target"
945 LDP_DELAY_TARGET = "c-delay-target"
946 LDP_MAX_RATE = "c-max-rate"
947 LDP_MIN_RATE = "c-min-rate"
950 LDP_RESYNC_RATE: VTYPE_INT,
951 LDP_STRIPES: VTYPE_INT,
952 LDP_BARRIERS: VTYPE_STRING,
953 LDP_NO_META_FLUSH: VTYPE_BOOL,
954 LDP_DEFAULT_METAVG: VTYPE_STRING,
955 LDP_DISK_CUSTOM: VTYPE_STRING,
956 LDP_NET_CUSTOM: VTYPE_STRING,
957 LDP_DYNAMIC_RESYNC: VTYPE_BOOL,
958 LDP_PLAN_AHEAD: VTYPE_INT,
959 LDP_FILL_TARGET: VTYPE_INT,
960 LDP_DELAY_TARGET: VTYPE_INT,
961 LDP_MAX_RATE: VTYPE_INT,
962 LDP_MIN_RATE: VTYPE_INT,
963 LDP_POOL: VTYPE_STRING,
965 DISK_LD_PARAMETERS = frozenset(DISK_LD_TYPES.keys())
967 # Disk template parameters (can be set/changed by the user via gnt-cluster and
969 DRBD_RESYNC_RATE = "resync-rate"
970 DRBD_DATA_STRIPES = "data-stripes"
971 DRBD_META_STRIPES = "meta-stripes"
972 DRBD_DISK_BARRIERS = "disk-barriers"
973 DRBD_META_BARRIERS = "meta-barriers"
974 DRBD_DEFAULT_METAVG = "metavg"
975 DRBD_DISK_CUSTOM = "disk-custom"
976 DRBD_NET_CUSTOM = "net-custom"
977 DRBD_DYNAMIC_RESYNC = "dynamic-resync"
978 DRBD_PLAN_AHEAD = "c-plan-ahead"
979 DRBD_FILL_TARGET = "c-fill-target"
980 DRBD_DELAY_TARGET = "c-delay-target"
981 DRBD_MAX_RATE = "c-max-rate"
982 DRBD_MIN_RATE = "c-min-rate"
983 LV_STRIPES = "stripes"
986 DRBD_RESYNC_RATE: VTYPE_INT,
987 DRBD_DATA_STRIPES: VTYPE_INT,
988 DRBD_META_STRIPES: VTYPE_INT,
989 DRBD_DISK_BARRIERS: VTYPE_STRING,
990 DRBD_META_BARRIERS: VTYPE_BOOL,
991 DRBD_DEFAULT_METAVG: VTYPE_STRING,
992 DRBD_DISK_CUSTOM: VTYPE_STRING,
993 DRBD_NET_CUSTOM: VTYPE_STRING,
994 DRBD_DYNAMIC_RESYNC: VTYPE_BOOL,
995 DRBD_PLAN_AHEAD: VTYPE_INT,
996 DRBD_FILL_TARGET: VTYPE_INT,
997 DRBD_DELAY_TARGET: VTYPE_INT,
998 DRBD_MAX_RATE: VTYPE_INT,
999 DRBD_MIN_RATE: VTYPE_INT,
1000 LV_STRIPES: VTYPE_INT,
1001 RBD_POOL: VTYPE_STRING,
1004 DISK_DT_PARAMETERS = frozenset(DISK_DT_TYPES.keys())
1006 # OOB supported commands
1007 OOB_POWER_ON = "power-on"
1008 OOB_POWER_OFF = "power-off"
1009 OOB_POWER_CYCLE = "power-cycle"
1010 OOB_POWER_STATUS = "power-status"
1011 OOB_HEALTH = "health"
1013 OOB_COMMANDS = frozenset([
1021 OOB_POWER_STATUS_POWERED = "powered"
1023 OOB_TIMEOUT = 60 # 60 seconds
1024 OOB_POWER_DELAY = 2.0 # 2 seconds
1026 OOB_STATUS_OK = "OK"
1027 OOB_STATUS_WARNING = "WARNING"
1028 OOB_STATUS_CRITICAL = "CRITICAL"
1029 OOB_STATUS_UNKNOWN = "UNKNOWN"
1031 OOB_STATUSES = frozenset([
1034 OOB_STATUS_CRITICAL,
1038 # Instance Parameters Profile
1039 PP_DEFAULT = "default"
1041 # NIC_* constants are used inside the ganeti config
1045 NIC_MODE_BRIDGED = "bridged"
1046 NIC_MODE_ROUTED = "routed"
1048 NIC_VALID_MODES = frozenset([NIC_MODE_BRIDGED, NIC_MODE_ROUTED])
1050 NICS_PARAMETER_TYPES = {
1051 NIC_MODE: VTYPE_STRING,
1052 NIC_LINK: VTYPE_STRING,
1055 NICS_PARAMETERS = frozenset(NICS_PARAMETER_TYPES.keys())
1057 # IDISK_* constants are used in opcodes, to create/change disks
1060 IDISK_ADOPT = "adopt"
1062 IDISK_METAVG = "metavg"
1063 IDISK_PARAMS_TYPES = {
1064 IDISK_SIZE: VTYPE_SIZE,
1065 IDISK_MODE: VTYPE_STRING,
1066 IDISK_ADOPT: VTYPE_STRING,
1067 IDISK_VG: VTYPE_STRING,
1068 IDISK_METAVG: VTYPE_STRING,
1070 IDISK_PARAMS = frozenset(IDISK_PARAMS_TYPES.keys())
1072 # INIC_* constants are used in opcodes, to create/change nics
1077 INIC_PARAMS_TYPES = {
1078 INIC_IP: VTYPE_MAYBE_STRING,
1079 INIC_LINK: VTYPE_STRING,
1080 INIC_MAC: VTYPE_STRING,
1081 INIC_MODE: VTYPE_STRING,
1083 INIC_PARAMS = frozenset(INIC_PARAMS_TYPES.keys())
1085 # Hypervisor constants
1086 HT_XEN_PVM = "xen-pvm"
1088 HT_XEN_HVM = "xen-hvm"
1090 HT_CHROOT = "chroot"
1092 HYPER_TYPES = frozenset([
1100 HTS_REQ_PORT = frozenset([HT_XEN_HVM, HT_KVM])
1102 VNC_BASE_PORT = 5900
1103 VNC_DEFAULT_BIND_ADDRESS = IP4_ADDRESS_ANY
1106 HT_NIC_RTL8139 = "rtl8139"
1107 HT_NIC_NE2K_PCI = "ne2k_pci"
1108 HT_NIC_NE2K_ISA = "ne2k_isa"
1109 HT_NIC_I82551 = "i82551"
1110 HT_NIC_I85557B = "i82557b"
1111 HT_NIC_I8259ER = "i82559er"
1112 HT_NIC_PCNET = "pcnet"
1113 HT_NIC_E1000 = "e1000"
1114 HT_NIC_PARAVIRTUAL = HT_DISK_PARAVIRTUAL = "paravirtual"
1116 HT_HVM_VALID_NIC_TYPES = frozenset([
1123 HT_KVM_VALID_NIC_TYPES = frozenset([
1136 HT_DISK_IOEMU = "ioemu"
1138 HT_DISK_SCSI = "scsi"
1141 HT_DISK_PFLASH = "pflash"
1143 HT_CACHE_DEFAULT = "default"
1144 HT_CACHE_NONE = "none"
1145 HT_CACHE_WTHROUGH = "writethrough"
1146 HT_CACHE_WBACK = "writeback"
1147 HT_VALID_CACHE_TYPES = frozenset([
1154 HT_HVM_VALID_DISK_TYPES = frozenset([HT_DISK_PARAVIRTUAL, HT_DISK_IOEMU])
1155 HT_KVM_VALID_DISK_TYPES = frozenset([
1156 HT_DISK_PARAVIRTUAL,
1165 HT_MOUSE_MOUSE = "mouse"
1166 HT_MOUSE_TABLET = "tablet"
1168 HT_KVM_VALID_MOUSE_TYPES = frozenset([HT_MOUSE_MOUSE, HT_MOUSE_TABLET])
1171 HT_BO_FLOPPY = "floppy"
1172 HT_BO_CDROM = "cdrom"
1174 HT_BO_NETWORK = "network"
1176 HT_KVM_VALID_BO_TYPES = frozenset([
1183 # SPICE lossless image compression options
1184 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_AUTO_GLZ = "auto_glz"
1185 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_AUTO_LZ = "auto_lz"
1186 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_QUIC = "quic"
1187 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_GLZ = "glz"
1188 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_LZ = "lz"
1189 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_OFF = "off"
1191 HT_KVM_SPICE_VALID_LOSSLESS_IMG_COMPR_OPTIONS = frozenset([
1192 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_AUTO_GLZ,
1193 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_AUTO_LZ,
1194 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_QUIC,
1195 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_GLZ,
1196 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_LZ,
1197 HT_KVM_SPICE_LOSSLESS_IMG_COMPR_OFF,
1200 # SPICE lossy image compression options (valid for both jpeg and zlib-glz)
1201 HT_KVM_SPICE_LOSSY_IMG_COMPR_AUTO = "auto"
1202 HT_KVM_SPICE_LOSSY_IMG_COMPR_NEVER = "never"
1203 HT_KVM_SPICE_LOSSY_IMG_COMPR_ALWAYS = "always"
1205 HT_KVM_SPICE_VALID_LOSSY_IMG_COMPR_OPTIONS = frozenset([
1206 HT_KVM_SPICE_LOSSY_IMG_COMPR_AUTO,
1207 HT_KVM_SPICE_LOSSY_IMG_COMPR_NEVER,
1208 HT_KVM_SPICE_LOSSY_IMG_COMPR_ALWAYS,
1211 # SPICE video stream detection
1212 HT_KVM_SPICE_VIDEO_STREAM_DETECTION_OFF = "off"
1213 HT_KVM_SPICE_VIDEO_STREAM_DETECTION_ALL = "all"
1214 HT_KVM_SPICE_VIDEO_STREAM_DETECTION_FILTER = "filter"
1216 HT_KVM_SPICE_VALID_VIDEO_STREAM_DETECTION_OPTIONS = frozenset([
1217 HT_KVM_SPICE_VIDEO_STREAM_DETECTION_OFF,
1218 HT_KVM_SPICE_VIDEO_STREAM_DETECTION_ALL,
1219 HT_KVM_SPICE_VIDEO_STREAM_DETECTION_FILTER,
1227 HT_KVM_VALID_SM_TYPES = frozenset([HT_SM_NONE, HT_SM_USER, HT_SM_POOL])
1230 HT_KVM_ENABLED = "enabled"
1231 HT_KVM_DISABLED = "disabled"
1233 HT_KVM_FLAG_VALUES = frozenset([HT_KVM_ENABLED, HT_KVM_DISABLED])
1236 HT_MIGRATION_LIVE = "live"
1237 HT_MIGRATION_NONLIVE = "non-live"
1238 HT_MIGRATION_MODES = frozenset([HT_MIGRATION_LIVE, HT_MIGRATION_NONLIVE])
1240 # Cluster Verify steps
1241 VERIFY_NPLUSONE_MEM = "nplusone_mem"
1242 VERIFY_OPTIONAL_CHECKS = frozenset([VERIFY_NPLUSONE_MEM])
1244 # Cluster Verify error classes
1245 CV_TCLUSTER = "cluster"
1247 CV_TINSTANCE = "instance"
1249 # Cluster Verify error codes and documentation
1251 (CV_TCLUSTER, "ECLUSTERCFG", "Cluster configuration verification failure")
1253 (CV_TCLUSTER, "ECLUSTERCERT",
1254 "Cluster certificate files verification failure")
1255 CV_ECLUSTERFILECHECK = \
1256 (CV_TCLUSTER, "ECLUSTERFILECHECK",
1257 "Cluster configuration verification failure")
1258 CV_ECLUSTERDANGLINGNODES = \
1259 (CV_TNODE, "ECLUSTERDANGLINGNODES",
1260 "Some nodes belong to non-existing groups")
1261 CV_ECLUSTERDANGLINGINST = \
1262 (CV_TNODE, "ECLUSTERDANGLINGINST",
1263 "Some instances have a non-existing primary node")
1264 CV_EINSTANCEBADNODE = \
1265 (CV_TINSTANCE, "EINSTANCEBADNODE",
1266 "Instance marked as running lives on an offline node")
1267 CV_EINSTANCEDOWN = \
1268 (CV_TINSTANCE, "EINSTANCEDOWN", "Instance not running on its primary node")
1269 CV_EINSTANCELAYOUT = \
1270 (CV_TINSTANCE, "EINSTANCELAYOUT", "Instance has multiple secondary nodes")
1271 CV_EINSTANCEMISSINGDISK = \
1272 (CV_TINSTANCE, "EINSTANCEMISSINGDISK", "Missing volume on an instance")
1273 CV_EINSTANCEFAULTYDISK = \
1274 (CV_TINSTANCE, "EINSTANCEFAULTYDISK",
1275 "Impossible to retrieve status for a disk")
1276 CV_EINSTANCEWRONGNODE = \
1277 (CV_TINSTANCE, "EINSTANCEWRONGNODE", "Instance running on the wrong node")
1278 CV_EINSTANCESPLITGROUPS = \
1279 (CV_TINSTANCE, "EINSTANCESPLITGROUPS",
1280 "Instance with primary and secondary nodes in different groups")
1281 CV_EINSTANCEPOLICY = \
1282 (CV_TINSTANCE, "EINSTANCEPOLICY",
1283 "Instance does not meet policy")
1285 (CV_TNODE, "ENODEDRBD", "Error parsing the DRBD status file")
1286 CV_ENODEDRBDHELPER = \
1287 (CV_TNODE, "ENODEDRBDHELPER", "Error caused by the DRBD helper")
1288 CV_ENODEFILECHECK = \
1289 (CV_TNODE, "ENODEFILECHECK",
1290 "Error retrieving the checksum of the node files")
1292 (CV_TNODE, "ENODEHOOKS", "Communication failure in hooks execution")
1294 (CV_TNODE, "ENODEHV", "Hypervisor parameters verification failure")
1296 (CV_TNODE, "ENODELVM", "LVM-related node error")
1298 (CV_TNODE, "ENODEN1", "Not enough memory to accommodate instance failovers")
1300 (CV_TNODE, "ENODENET", "Network-related node error")
1302 (CV_TNODE, "ENODEOS", "OS-related node error")
1303 CV_ENODEORPHANINSTANCE = \
1304 (CV_TNODE, "ENODEORPHANINSTANCE", "Unknown intance running on a node")
1305 CV_ENODEORPHANLV = \
1306 (CV_TNODE, "ENODEORPHANLV", "Unknown LVM logical volume")
1308 (CV_TNODE, "ENODERPC",
1309 "Error during connection to the primary node of an instance")
1311 (CV_TNODE, "ENODESSH", "SSH-related node error")
1313 (CV_TNODE, "ENODEVERSION",
1314 "Protocol version mismatch or Ganeti version mismatch")
1316 (CV_TNODE, "ENODESETUP", "Node setup error")
1318 (CV_TNODE, "ENODETIME", "Node returned invalid time")
1320 (CV_TNODE, "ENODEOOBPATH", "Invalid Out Of Band path")
1321 CV_ENODEUSERSCRIPTS = \
1322 (CV_TNODE, "ENODEUSERSCRIPTS", "User scripts not present or not executable")
1324 CV_ALL_ECODES = frozenset([
1327 CV_ECLUSTERFILECHECK,
1328 CV_ECLUSTERDANGLINGNODES,
1329 CV_ECLUSTERDANGLINGINST,
1330 CV_EINSTANCEBADNODE,
1333 CV_EINSTANCEMISSINGDISK,
1334 CV_EINSTANCEFAULTYDISK,
1335 CV_EINSTANCEWRONGNODE,
1336 CV_EINSTANCESPLITGROUPS,
1347 CV_ENODEORPHANINSTANCE,
1355 CV_ENODEUSERSCRIPTS,
1358 CV_ALL_ECODES_STRINGS = frozenset(estr for (_, estr, _) in CV_ALL_ECODES)
1360 # Node verify constants
1361 NV_DRBDHELPER = "drbd-helper"
1362 NV_DRBDLIST = "drbd-list"
1363 NV_FILELIST = "filelist"
1364 NV_HVINFO = "hvinfo"
1365 NV_HYPERVISOR = "hypervisor"
1366 NV_HVPARAMS = "hvparms"
1367 NV_INSTANCELIST = "instancelist"
1368 NV_LVLIST = "lvlist"
1369 NV_MASTERIP = "master-ip"
1370 NV_NODELIST = "nodelist"
1371 NV_NODENETTEST = "node-net-test"
1372 NV_NODESETUP = "nodesetup"
1373 NV_OSLIST = "oslist"
1374 NV_PVLIST = "pvlist"
1376 NV_VERSION = "version"
1377 NV_VGLIST = "vglist"
1378 NV_VMNODES = "vmnodes"
1379 NV_OOB_PATHS = "oob-paths"
1380 NV_BRIDGES = "bridges"
1381 NV_USERSCRIPTS = "user-scripts"
1384 INSTST_RUNNING = "running"
1385 INSTST_ADMINDOWN = "ADMIN_down"
1386 INSTST_ADMINOFFLINE = "ADMIN_offline"
1387 INSTST_NODEOFFLINE = "ERROR_nodeoffline"
1388 INSTST_NODEDOWN = "ERROR_nodedown"
1389 INSTST_WRONGNODE = "ERROR_wrongnode"
1390 INSTST_ERRORUP = "ERROR_up"
1391 INSTST_ERRORDOWN = "ERROR_down"
1392 INSTST_ALL = frozenset([
1395 INSTST_ADMINOFFLINE,
1405 ADMINST_DOWN = "down"
1406 ADMINST_OFFLINE = "offline"
1407 ADMINST_ALL = frozenset([
1419 NR_ALL = frozenset([
1427 # SSL certificate check constants (in days)
1428 SSL_CERT_EXPIRATION_WARN = 30
1429 SSL_CERT_EXPIRATION_ERROR = 7
1431 # Allocator framework constants
1432 IALLOCATOR_VERSION = 2
1433 IALLOCATOR_DIR_IN = "in"
1434 IALLOCATOR_DIR_OUT = "out"
1435 VALID_IALLOCATOR_DIRECTIONS = frozenset([
1439 IALLOCATOR_MODE_ALLOC = "allocate"
1440 IALLOCATOR_MODE_RELOC = "relocate"
1441 IALLOCATOR_MODE_CHG_GROUP = "change-group"
1442 IALLOCATOR_MODE_NODE_EVAC = "node-evacuate"
1443 IALLOCATOR_MODE_MULTI_ALLOC = "multi-allocate"
1444 VALID_IALLOCATOR_MODES = frozenset([
1445 IALLOCATOR_MODE_ALLOC,
1446 IALLOCATOR_MODE_RELOC,
1447 IALLOCATOR_MODE_CHG_GROUP,
1448 IALLOCATOR_MODE_NODE_EVAC,
1449 IALLOCATOR_MODE_MULTI_ALLOC,
1451 IALLOCATOR_SEARCH_PATH = _autoconf.IALLOCATOR_SEARCH_PATH
1453 IALLOCATOR_NEVAC_PRI = "primary-only"
1454 IALLOCATOR_NEVAC_SEC = "secondary-only"
1455 IALLOCATOR_NEVAC_ALL = "all"
1456 IALLOCATOR_NEVAC_MODES = frozenset([
1457 IALLOCATOR_NEVAC_PRI,
1458 IALLOCATOR_NEVAC_SEC,
1459 IALLOCATOR_NEVAC_ALL,
1463 NODE_EVAC_PRI = "primary-only"
1464 NODE_EVAC_SEC = "secondary-only"
1465 NODE_EVAC_ALL = "all"
1466 NODE_EVAC_MODES = frozenset([
1473 JOB_QUEUE_VERSION = 1
1474 JOB_QUEUE_SIZE_HARD_LIMIT = 5000
1476 JOB_ID_TEMPLATE = r"\d+"
1477 JOB_FILE_RE = re.compile(r"^job-(%s)$" % JOB_ID_TEMPLATE)
1479 # unchanged job return
1480 JOB_NOTCHANGED = "nochange"
1483 JOB_STATUS_QUEUED = "queued"
1484 JOB_STATUS_WAITING = "waiting"
1485 JOB_STATUS_CANCELING = "canceling"
1486 JOB_STATUS_RUNNING = "running"
1487 JOB_STATUS_CANCELED = "canceled"
1488 JOB_STATUS_SUCCESS = "success"
1489 JOB_STATUS_ERROR = "error"
1490 JOBS_FINALIZED = frozenset([
1491 JOB_STATUS_CANCELED,
1495 JOB_STATUS_ALL = frozenset([
1498 JOB_STATUS_CANCELING,
1504 OP_STATUS_QUEUED = "queued"
1505 OP_STATUS_WAITING = "waiting"
1506 OP_STATUS_CANCELING = "canceling"
1507 OP_STATUS_RUNNING = "running"
1509 OP_STATUS_CANCELED = "canceled"
1510 OP_STATUS_SUCCESS = "success"
1511 OP_STATUS_ERROR = "error"
1512 OPS_FINALIZED = frozenset([
1519 OP_PRIO_LOWEST = +19
1520 OP_PRIO_HIGHEST = -20
1526 OP_PRIO_SUBMIT_VALID = frozenset([
1532 OP_PRIO_DEFAULT = OP_PRIO_NORMAL
1534 # Lock recalculate mode
1535 LOCKS_REPLACE = "replace"
1536 LOCKS_APPEND = "append"
1538 # Lock timeout (sum) before we should go into blocking acquire (still
1539 # can be reset by priority change); computed as max time (10 hours)
1540 # before we should actually go into blocking acquire given that we
1541 # start from default priority level; in seconds
1543 LOCK_ATTEMPTS_TIMEOUT = 10 * 3600 / (OP_PRIO_DEFAULT - OP_PRIO_HIGHEST)
1544 LOCK_ATTEMPTS_MAXWAIT = 15.0
1545 LOCK_ATTEMPTS_MINWAIT = 1.0
1547 # Execution log types
1548 ELOG_MESSAGE = "message"
1549 ELOG_REMOTE_IMPORT = "remote-import"
1550 ELOG_JQUEUE_TEST = "jqueue-test"
1552 # /etc/hosts modification
1553 ETC_HOSTS_ADD = "add"
1554 ETC_HOSTS_REMOVE = "remove"
1557 JQT_MSGPREFIX = "TESTMSG="
1558 JQT_EXPANDNAMES = "expandnames"
1560 JQT_LOGMSG = "logmsg"
1561 JQT_STARTMSG = "startmsg"
1562 JQT_ALL = frozenset([
1570 QR_CLUSTER = "cluster"
1571 QR_INSTANCE = "instance"
1577 QR_EXPORT = "export"
1579 #: List of resources which can be queried using L{opcodes.OpQuery}
1580 QR_VIA_OP = frozenset([
1589 #: List of resources which can be queried using Local UniX Interface
1590 QR_VIA_LUXI = QR_VIA_OP.union([
1595 #: List of resources which can be queried using RAPI
1596 QR_VIA_RAPI = QR_VIA_LUXI
1599 QFT_UNKNOWN = "unknown"
1602 QFT_NUMBER = "number"
1604 QFT_TIMESTAMP = "timestamp"
1607 #: All query field types
1608 QFT_ALL = frozenset([
1618 # Query result field status (don't change or reuse values as they're used by
1620 #: Normal field status
1624 #: No data (e.g. RPC error), can be used instead of L{RS_OFFLINE}
1626 #: Value unavailable/unsupported for item; if this field is supported
1627 #: but we cannot get the data for the moment, RS_NODATA or
1628 #: RS_OFFLINE should be used
1630 #: Resource marked offline
1633 RS_ALL = frozenset([
1641 #: Dictionary with special field cases and their verbose/terse formatting
1643 RS_UNKNOWN: ("(unknown)", "??"),
1644 RS_NODATA: ("(nodata)", "?"),
1645 RS_OFFLINE: ("(offline)", "*"),
1646 RS_UNAVAIL: ("(unavail)", "-"),
1649 # max dynamic devices
1653 # SSCONF file prefix
1654 SSCONF_FILEPREFIX = "ssconf_"
1656 SS_CLUSTER_NAME = "cluster_name"
1657 SS_CLUSTER_TAGS = "cluster_tags"
1658 SS_FILE_STORAGE_DIR = "file_storage_dir"
1659 SS_SHARED_FILE_STORAGE_DIR = "shared_file_storage_dir"
1660 SS_MASTER_CANDIDATES = "master_candidates"
1661 SS_MASTER_CANDIDATES_IPS = "master_candidates_ips"
1662 SS_MASTER_IP = "master_ip"
1663 SS_MASTER_NETDEV = "master_netdev"
1664 SS_MASTER_NETMASK = "master_netmask"
1665 SS_MASTER_NODE = "master_node"
1666 SS_NODE_LIST = "node_list"
1667 SS_NODE_PRIMARY_IPS = "node_primary_ips"
1668 SS_NODE_SECONDARY_IPS = "node_secondary_ips"
1669 SS_OFFLINE_NODES = "offline_nodes"
1670 SS_ONLINE_NODES = "online_nodes"
1671 SS_PRIMARY_IP_FAMILY = "primary_ip_family"
1672 SS_INSTANCE_LIST = "instance_list"
1673 SS_RELEASE_VERSION = "release_version"
1674 SS_HYPERVISOR_LIST = "hypervisor_list"
1675 SS_MAINTAIN_NODE_HEALTH = "maintain_node_health"
1676 SS_UID_POOL = "uid_pool"
1677 SS_NODEGROUPS = "nodegroups"
1679 SS_FILE_PERMS = 0444
1681 # cluster wide default parameters
1682 DEFAULT_ENABLED_HYPERVISOR = HT_XEN_PVM
1686 HV_USE_BOOTLOADER: False,
1687 HV_BOOTLOADER_PATH: XEN_BOOTLOADER,
1688 HV_BOOTLOADER_ARGS: "",
1689 HV_KERNEL_PATH: XEN_KERNEL,
1691 HV_ROOT_PATH: "/dev/sda1",
1692 HV_KERNEL_ARGS: "ro",
1693 HV_MIGRATION_PORT: 8002,
1694 HV_MIGRATION_MODE: HT_MIGRATION_LIVE,
1695 HV_BLOCKDEV_PREFIX: "sd",
1696 HV_REBOOT_BEHAVIOR: INSTANCE_REBOOT_ALLOWED,
1697 HV_CPU_MASK: CPU_PINNING_ALL,
1700 HV_BOOT_ORDER: "cd",
1701 HV_CDROM_IMAGE_PATH: "",
1702 HV_NIC_TYPE: HT_NIC_RTL8139,
1703 HV_DISK_TYPE: HT_DISK_PARAVIRTUAL,
1704 HV_VNC_BIND_ADDRESS: IP4_ADDRESS_ANY,
1705 HV_VNC_PASSWORD_FILE: VNC_PASSWORD_FILE,
1708 HV_KERNEL_PATH: "/usr/lib/xen/boot/hvmloader",
1709 HV_DEVICE_MODEL: "/usr/lib/xen/bin/qemu-dm",
1710 HV_MIGRATION_PORT: 8002,
1711 HV_MIGRATION_MODE: HT_MIGRATION_NONLIVE,
1712 HV_USE_LOCALTIME: False,
1713 HV_BLOCKDEV_PREFIX: "hd",
1715 HV_REBOOT_BEHAVIOR: INSTANCE_REBOOT_ALLOWED,
1716 HV_CPU_MASK: CPU_PINNING_ALL,
1719 HV_KERNEL_PATH: KVM_KERNEL,
1721 HV_KERNEL_ARGS: "ro",
1722 HV_ROOT_PATH: "/dev/vda1",
1724 HV_SERIAL_CONSOLE: True,
1725 HV_VNC_BIND_ADDRESS: "",
1728 HV_VNC_X509_VERIFY: False,
1729 HV_VNC_PASSWORD_FILE: "",
1730 HV_KVM_SPICE_BIND: "",
1731 HV_KVM_SPICE_IP_VERSION: IFACE_NO_IP_VERSION_SPECIFIED,
1732 HV_KVM_SPICE_PASSWORD_FILE: "",
1733 HV_KVM_SPICE_LOSSLESS_IMG_COMPR: "",
1734 HV_KVM_SPICE_JPEG_IMG_COMPR: "",
1735 HV_KVM_SPICE_ZLIB_GLZ_IMG_COMPR: "",
1736 HV_KVM_SPICE_STREAMING_VIDEO_DETECTION: "",
1737 HV_KVM_SPICE_AUDIO_COMPR: True,
1738 HV_KVM_SPICE_USE_TLS: False,
1739 HV_KVM_SPICE_TLS_CIPHERS: OPENSSL_CIPHERS,
1740 HV_KVM_SPICE_USE_VDAGENT: True,
1741 HV_KVM_FLOPPY_IMAGE_PATH: "",
1742 HV_CDROM_IMAGE_PATH: "",
1743 HV_KVM_CDROM2_IMAGE_PATH: "",
1744 HV_BOOT_ORDER: HT_BO_DISK,
1745 HV_NIC_TYPE: HT_NIC_PARAVIRTUAL,
1746 HV_DISK_TYPE: HT_DISK_PARAVIRTUAL,
1747 HV_KVM_CDROM_DISK_TYPE: "",
1750 HV_MIGRATION_PORT: 8102,
1751 HV_MIGRATION_BANDWIDTH: 32, # MiB/s
1752 HV_MIGRATION_DOWNTIME: 30, # ms
1753 HV_MIGRATION_MODE: HT_MIGRATION_LIVE,
1754 HV_USE_LOCALTIME: False,
1755 HV_DISK_CACHE: HT_CACHE_DEFAULT,
1756 HV_SECURITY_MODEL: HT_SM_NONE,
1757 HV_SECURITY_DOMAIN: "",
1759 HV_VHOST_NET: False,
1760 HV_KVM_USE_CHROOT: False,
1762 HV_REBOOT_BEHAVIOR: INSTANCE_REBOOT_ALLOWED,
1763 HV_CPU_MASK: CPU_PINNING_ALL,
1768 HV_INIT_SCRIPT: "/ganeti-chroot",
1775 HVC_GLOBALS = frozenset([
1777 HV_MIGRATION_BANDWIDTH,
1785 BE_AUTO_BALANCE: True,
1786 BE_ALWAYS_FAILOVER: False,
1792 ND_SPINDLE_COUNT: 1,
1795 DISK_LD_DEFAULTS = {
1797 LDP_RESYNC_RATE: CLASSIC_DRBD_SYNC_SPEED,
1798 LDP_BARRIERS: _autoconf.DRBD_BARRIERS,
1799 LDP_NO_META_FLUSH: _autoconf.DRBD_NO_META_FLUSH,
1800 LDP_DEFAULT_METAVG: DEFAULT_VG,
1801 LDP_DISK_CUSTOM: "",
1803 LDP_DYNAMIC_RESYNC: False,
1805 # The default values for the DRBD dynamic resync speed algorithm are taken
1806 # from the drbsetup 8.3.11 man page, except for c-plan-ahead (that we
1807 # don't need to set to 0, because we have a separate option to enable it)
1808 # and for c-max-rate, that we cap to the default value for the static resync
1810 LDP_PLAN_AHEAD: 20, # ds
1811 LDP_FILL_TARGET: 0, # sectors
1812 LDP_DELAY_TARGET: 1, # ds
1813 LDP_MAX_RATE: CLASSIC_DRBD_SYNC_SPEED, # KiB/s
1814 LDP_MIN_RATE: 4 * 1024, # KiB/s
1817 LDP_STRIPES: _autoconf.LVM_STRIPECOUNT
1826 # readability shortcuts
1827 _LV_DEFAULTS = DISK_LD_DEFAULTS[LD_LV]
1828 _DRBD_DEFAULTS = DISK_LD_DEFAULTS[LD_DRBD8]
1830 DISK_DT_DEFAULTS = {
1832 LV_STRIPES: DISK_LD_DEFAULTS[LD_LV][LDP_STRIPES],
1835 DRBD_RESYNC_RATE: _DRBD_DEFAULTS[LDP_RESYNC_RATE],
1836 DRBD_DATA_STRIPES: _LV_DEFAULTS[LDP_STRIPES],
1837 DRBD_META_STRIPES: _LV_DEFAULTS[LDP_STRIPES],
1838 DRBD_DISK_BARRIERS: _DRBD_DEFAULTS[LDP_BARRIERS],
1839 DRBD_META_BARRIERS: _DRBD_DEFAULTS[LDP_NO_META_FLUSH],
1840 DRBD_DEFAULT_METAVG: _DRBD_DEFAULTS[LDP_DEFAULT_METAVG],
1841 DRBD_DISK_CUSTOM: _DRBD_DEFAULTS[LDP_DISK_CUSTOM],
1842 DRBD_NET_CUSTOM: _DRBD_DEFAULTS[LDP_NET_CUSTOM],
1843 DRBD_DYNAMIC_RESYNC: _DRBD_DEFAULTS[LDP_DYNAMIC_RESYNC],
1844 DRBD_PLAN_AHEAD: _DRBD_DEFAULTS[LDP_PLAN_AHEAD],
1845 DRBD_FILL_TARGET: _DRBD_DEFAULTS[LDP_FILL_TARGET],
1846 DRBD_DELAY_TARGET: _DRBD_DEFAULTS[LDP_DELAY_TARGET],
1847 DRBD_MAX_RATE: _DRBD_DEFAULTS[LDP_MAX_RATE],
1848 DRBD_MIN_RATE: _DRBD_DEFAULTS[LDP_MIN_RATE],
1855 RBD_POOL: DISK_LD_DEFAULTS[LD_RBD][LDP_POOL]
1859 # we don't want to export the shortcuts
1860 del _LV_DEFAULTS, _DRBD_DEFAULTS
1863 NIC_MODE: NIC_MODE_BRIDGED,
1864 NIC_LINK: DEFAULT_BRIDGE,
1867 # All of the following values are quite arbitrarily - there are no
1868 # "good" defaults, these must be customised per-site
1869 IPOLICY_DEFAULTS = {
1871 ISPEC_MEM_SIZE: 128,
1873 ISPEC_DISK_COUNT: 1,
1874 ISPEC_DISK_SIZE: 1024,
1876 ISPEC_SPINDLE_USE: 1,
1879 ISPEC_MEM_SIZE: 32768,
1881 ISPEC_DISK_COUNT: MAX_DISKS,
1882 ISPEC_DISK_SIZE: 1024 * 1024,
1883 ISPEC_NIC_COUNT: MAX_NICS,
1884 ISPEC_SPINDLE_USE: 12,
1887 ISPEC_MEM_SIZE: 128,
1889 ISPEC_DISK_COUNT: 1,
1890 ISPEC_DISK_SIZE: 1024,
1892 ISPEC_SPINDLE_USE: 1,
1894 IPOLICY_DTS: DISK_TEMPLATES,
1895 IPOLICY_VCPU_RATIO: 4.0,
1896 IPOLICY_SPINDLE_RATIO: 32.0,
1899 MASTER_POOL_SIZE_DEFAULT = 10
1901 CONFD_PROTOCOL_VERSION = 1
1904 CONFD_REQ_NODE_ROLE_BYNAME = 1
1905 CONFD_REQ_NODE_PIP_BY_INSTANCE_IP = 2
1906 CONFD_REQ_CLUSTER_MASTER = 3
1907 CONFD_REQ_NODE_PIP_LIST = 4
1908 CONFD_REQ_MC_PIP_LIST = 5
1909 CONFD_REQ_INSTANCES_IPS_LIST = 6
1910 CONFD_REQ_NODE_DRBD = 7
1912 # Confd request query fields. These are used to narrow down queries.
1913 # These must be strings rather than integers, because json-encoding
1914 # converts them to strings anyway, as they're used as dict-keys.
1915 CONFD_REQQ_LINK = "0"
1917 CONFD_REQQ_IPLIST = "2"
1918 CONFD_REQQ_FIELDS = "3"
1920 CONFD_REQFIELD_NAME = "0"
1921 CONFD_REQFIELD_IP = "1"
1922 CONFD_REQFIELD_MNODE_PIP = "2"
1924 CONFD_REQS = frozenset([
1926 CONFD_REQ_NODE_ROLE_BYNAME,
1927 CONFD_REQ_NODE_PIP_BY_INSTANCE_IP,
1928 CONFD_REQ_CLUSTER_MASTER,
1929 CONFD_REQ_NODE_PIP_LIST,
1930 CONFD_REQ_MC_PIP_LIST,
1931 CONFD_REQ_INSTANCES_IPS_LIST,
1932 CONFD_REQ_NODE_DRBD,
1935 CONFD_REPL_STATUS_OK = 0
1936 CONFD_REPL_STATUS_ERROR = 1
1937 CONFD_REPL_STATUS_NOTIMPLEMENTED = 2
1939 CONFD_REPL_STATUSES = frozenset([
1940 CONFD_REPL_STATUS_OK,
1941 CONFD_REPL_STATUS_ERROR,
1942 CONFD_REPL_STATUS_NOTIMPLEMENTED,
1945 (CONFD_NODE_ROLE_MASTER,
1946 CONFD_NODE_ROLE_CANDIDATE,
1947 CONFD_NODE_ROLE_OFFLINE,
1948 CONFD_NODE_ROLE_DRAINED,
1949 CONFD_NODE_ROLE_REGULAR,
1952 # A few common errors for confd
1953 CONFD_ERROR_UNKNOWN_ENTRY = 1
1954 CONFD_ERROR_INTERNAL = 2
1955 CONFD_ERROR_ARGUMENT = 3
1957 # Each request is "salted" by the current timestamp.
1958 # This constants decides how many seconds of skew to accept.
1959 # TODO: make this a default and allow the value to be more configurable
1960 CONFD_MAX_CLOCK_SKEW = 2 * NODE_MAX_CLOCK_SKEW
1962 # When we haven't reloaded the config for more than this amount of seconds, we
1963 # force a test to see if inotify is betraying us.
1964 CONFD_CONFIG_RELOAD_TIMEOUT = 60
1966 # If we receive more than one update in this amount of seconds, we move to
1967 # polling every RATELIMIT seconds, rather than relying on inotify, to be able
1968 # to serve more requests.
1969 CONFD_CONFIG_RELOAD_RATELIMIT = 2
1971 # Magic number prepended to all confd queries.
1972 # This allows us to distinguish different types of confd protocols and handle
1973 # them. For example by changing this we can move the whole payload to be
1974 # compressed, or move away from json.
1975 CONFD_MAGIC_FOURCC = "plj0"
1977 # By default a confd request is sent to the minimum between this number and all
1978 # MCs. 6 was chosen because even in the case of a disastrous 50% response rate,
1979 # we should have enough answers to be able to compare more than one.
1980 CONFD_DEFAULT_REQ_COVERAGE = 6
1982 # Timeout in seconds to expire pending query request in the confd client
1983 # library. We don't actually expect any answer more than 10 seconds after we
1985 CONFD_CLIENT_EXPIRE_TIMEOUT = 10
1987 # Maximum UDP datagram size.
1988 # On IPv4: 64K - 20 (ip header size) - 8 (udp header size) = 65507
1989 # On IPv6: 64K - 40 (ip6 header size) - 8 (udp header size) = 65487
1990 # (assuming we can't use jumbo frames)
1991 # We just set this to 60K, which should be enough
1992 MAX_UDP_DATA_SIZE = 61440
1994 # User-id pool minimum/maximum acceptable user-ids.
1996 UIDPOOL_UID_MAX = 2 ** 32 - 1 # Assuming 32 bit user-ids
1998 # Name or path of the pgrep command
2001 # Name of the node group that gets created at cluster init or upgrade
2002 INITIAL_NODE_GROUP_NAME = "default"
2004 # Possible values for NodeGroup.alloc_policy
2005 ALLOC_POLICY_PREFERRED = "preferred"
2006 ALLOC_POLICY_LAST_RESORT = "last_resort"
2007 ALLOC_POLICY_UNALLOCABLE = "unallocable"
2008 VALID_ALLOC_POLICIES = [
2009 ALLOC_POLICY_PREFERRED,
2010 ALLOC_POLICY_LAST_RESORT,
2011 ALLOC_POLICY_UNALLOCABLE,
2014 # Temporary external/shared storage parameters
2015 BLOCKDEV_DRIVER_MANUAL = "manual"
2017 # qemu-img path, required for ovfconverter
2018 QEMUIMG_PATH = _autoconf.QEMUIMG_PATH
2020 # Whether htools was enabled at compilation time
2021 HTOOLS = _autoconf.HTOOLS
2022 # The hail iallocator
2023 IALLOC_HAIL = "hail"
2025 # Fake opcodes for functions that have hooks attached to them via
2026 # backend.RunLocalHooks
2027 FAKE_OP_MASTER_TURNUP = "OP_CLUSTER_IP_TURNUP"
2028 FAKE_OP_MASTER_TURNDOWN = "OP_CLUSTER_IP_TURNDOWN"
2030 # Do not re-export imported modules
2031 del re, _vcsversion, _autoconf, socket
2033 # Unintended imports from pathutils (temporary)