projects
/
ganeti-local
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cluster verify: verify hypervisor parameters only once
[ganeti-local]
/
lib
/
constants.py
diff --git
a/lib/constants.py
b/lib/constants.py
index
450ae79
..
2a36acb
100644
(file)
--- a/
lib/constants.py
+++ b/
lib/constants.py
@@
-120,6
+120,7
@@
CRYPTO_KEYS_DIR = RUN_GANETI_DIR + "/crypto"
CRYPTO_KEYS_DIR_MODE = SECURE_DIR_MODE
IMPORT_EXPORT_DIR = RUN_GANETI_DIR + "/import-export"
IMPORT_EXPORT_DIR_MODE = 0755
CRYPTO_KEYS_DIR_MODE = SECURE_DIR_MODE
IMPORT_EXPORT_DIR = RUN_GANETI_DIR + "/import-export"
IMPORT_EXPORT_DIR_MODE = 0755
+ADOPTABLE_BLOCKDEV_ROOT = "/dev/disk/"
# keep RUN_GANETI_DIR first here, to make sure all get created when the node
# daemon is started (this takes care of RUN_DIR being tmpfs)
SUB_RUN_DIRS = [ RUN_GANETI_DIR, BDEV_CACHE_DIR, DISK_LINKS_DIR ]
# keep RUN_GANETI_DIR first here, to make sure all get created when the node
# daemon is started (this takes care of RUN_DIR being tmpfs)
SUB_RUN_DIRS = [ RUN_GANETI_DIR, BDEV_CACHE_DIR, DISK_LINKS_DIR ]
@@
-144,7
+145,9
@@
SETUP_SSH = _autoconf.TOOLSDIR + "/setup-ssh"
KVM_IFUP = _autoconf.PKGLIBDIR + "/kvm-ifup"
ETC_HOSTS = "/etc/hosts"
DEFAULT_FILE_STORAGE_DIR = _autoconf.FILE_STORAGE_DIR
KVM_IFUP = _autoconf.PKGLIBDIR + "/kvm-ifup"
ETC_HOSTS = "/etc/hosts"
DEFAULT_FILE_STORAGE_DIR = _autoconf.FILE_STORAGE_DIR
+DEFAULT_SHARED_FILE_STORAGE_DIR = _autoconf.SHARED_FILE_STORAGE_DIR
ENABLE_FILE_STORAGE = _autoconf.ENABLE_FILE_STORAGE
ENABLE_FILE_STORAGE = _autoconf.ENABLE_FILE_STORAGE
+ENABLE_SHARED_FILE_STORAGE = _autoconf.ENABLE_SHARED_FILE_STORAGE
SYSCONFDIR = _autoconf.SYSCONFDIR
TOOLSDIR = _autoconf.TOOLSDIR
CONF_DIR = SYSCONFDIR + "/ganeti"
SYSCONFDIR = _autoconf.SYSCONFDIR
TOOLSDIR = _autoconf.TOOLSDIR
CONF_DIR = SYSCONFDIR + "/ganeti"
@@
-200,7
+203,7
@@
DEV_CONSOLE = "/dev/console"
PROC_MOUNTS = "/proc/mounts"
PROC_MOUNTS = "/proc/mounts"
-# luxi related constants
+# Local UniX Interface related constants
LUXI_EOM = "\3"
LUXI_VERSION = CONFIG_VERSION
LUXI_EOM = "\3"
LUXI_VERSION = CONFIG_VERSION
@@
-360,24
+363,37
@@
DT_DISKLESS = "diskless"
DT_PLAIN = "plain"
DT_DRBD8 = "drbd"
DT_FILE = "file"
DT_PLAIN = "plain"
DT_DRBD8 = "drbd"
DT_FILE = "file"
+DT_SHARED_FILE = "sharedfile"
+DT_BLOCK = "blockdev"
# the set of network-mirrored disk templates
# the set of network-mirrored disk templates
-DTS_NET_MIRROR = frozenset([DT_DRBD8])
+DTS_INT_MIRROR = frozenset([DT_DRBD8])
+
+# the set of externally-mirrored disk templates (e.g. SAN, NAS)
+DTS_EXT_MIRROR = frozenset([DT_SHARED_FILE, DT_BLOCK])
# the set of non-lvm-based disk templates
# the set of non-lvm-based disk templates
-DTS_NOT_LVM = frozenset([DT_DISKLESS, DT_FILE])
+DTS_NOT_LVM = frozenset([DT_DISKLESS, DT_FILE, DT_SHARED_FILE, DT_BLOCK])
# the set of disk templates which can be grown
# the set of disk templates which can be grown
-DTS_GROWABLE = frozenset([DT_PLAIN, DT_DRBD8, DT_FILE])
+DTS_GROWABLE = frozenset([DT_PLAIN, DT_DRBD8, DT_FILE, DT_SHARED_FILE])
# the set of disk templates that allow adoption
# the set of disk templates that allow adoption
-DTS_MAY_ADOPT = frozenset([DT_PLAIN])
+DTS_MAY_ADOPT = frozenset([DT_PLAIN, DT_BLOCK])
+
+# the set of disk templates that *must* use adoption
+DTS_MUST_ADOPT = frozenset([DT_BLOCK])
+
+# the set of disk templates that allow migrations
+DTS_MIRRORED = frozenset.union(DTS_INT_MIRROR, DTS_EXT_MIRROR)
+
# logical disk types
LD_LV = "lvm"
LD_DRBD8 = "drbd8"
LD_FILE = "file"
# logical disk types
LD_LV = "lvm"
LD_DRBD8 = "drbd8"
LD_FILE = "file"
-LDS_BLOCK = frozenset([LD_LV, LD_DRBD8])
+LD_BLOCKDEV = "blockdev"
+LDS_BLOCK = frozenset([LD_LV, LD_DRBD8, LD_BLOCKDEV])
# drbd constants
DRBD_HMAC_ALG = "md5"
# drbd constants
DRBD_HMAC_ALG = "md5"
@@
-416,10
+432,18
@@
EXPORT_MODES = frozenset([
EXPORT_MODE_REMOTE,
])
EXPORT_MODE_REMOTE,
])
-# lock recalculate mode
+# Lock recalculate mode
LOCKS_REPLACE = 'replace'
LOCKS_APPEND = 'append'
LOCKS_REPLACE = 'replace'
LOCKS_APPEND = 'append'
+# Lock timeout (sum) before we should go into blocking acquire (still
+# can be reset by priority change); computed as max time (10 hours)
+# before we should actually go into blocking acquire given that we
+# start from default priority level; in seconds
+LOCK_ATTEMPTS_TIMEOUT = 10 * 3600 / 20.0
+LOCK_ATTEMPTS_MAXWAIT = 15.0
+LOCK_ATTEMPTS_MINWAIT = 1.0
+
# instance creation modes
INSTANCE_CREATE = "create"
INSTANCE_IMPORT = "import"
# instance creation modes
INSTANCE_CREATE = "create"
INSTANCE_IMPORT = "import"
@@
-437,13
+461,20
@@
RIE_HANDSHAKE = "Hi, I'm Ganeti"
# Remote import/export certificate validity in seconds
RIE_CERT_VALIDITY = 24 * 60 * 60
# Remote import/export certificate validity in seconds
RIE_CERT_VALIDITY = 24 * 60 * 60
-# Remote import/export connect timeout for socat
-RIE_CONNECT_TIMEOUT = 60
+# Overall timeout for establishing connection
+RIE_CONNECT_TIMEOUT = 180
+
+# Export only: how long to wait per connection attempt (seconds)
+RIE_CONNECT_ATTEMPT_TIMEOUT = 20
+
+# Export only: number of attempts to connect
+RIE_CONNECT_RETRIES = 10
+
#: Give child process up to 5 seconds to exit after sending a signal
CHILD_LINGER_TIMEOUT = 5.0
#: Give child process up to 5 seconds to exit after sending a signal
CHILD_LINGER_TIMEOUT = 5.0
-DISK_TEMPLATES = frozenset([DT_DISKLESS, DT_PLAIN,
- DT_DRBD8, DT_FILE])
+DISK_TEMPLATES = frozenset([DT_DISKLESS, DT_PLAIN, DT_DRBD8,
+ DT_FILE, DT_SHARED_FILE, DT_BLOCK])
FILE_DRIVER = frozenset([FD_LOOP, FD_BLKTAP])
FILE_DRIVER = frozenset([FD_LOOP, FD_BLKTAP])
@@
-472,10
+503,12
@@
EXIT_UNKNOWN_FIELD = 14
# tags
TAG_CLUSTER = "cluster"
# tags
TAG_CLUSTER = "cluster"
+TAG_NODEGROUP = "nodegroup"
TAG_NODE = "node"
TAG_INSTANCE = "instance"
VALID_TAG_TYPES = frozenset([
TAG_CLUSTER,
TAG_NODE = "node"
TAG_INSTANCE = "instance"
VALID_TAG_TYPES = frozenset([
TAG_CLUSTER,
+ TAG_NODEGROUP,
TAG_NODE,
TAG_INSTANCE,
])
TAG_NODE,
TAG_INSTANCE,
])
@@
-502,10
+535,13
@@
LVM_STRIPECOUNT = _autoconf.LVM_STRIPECOUNT
DEFAULT_SHUTDOWN_TIMEOUT = 120
NODE_MAX_CLOCK_SKEW = 150
# Time for an intra-cluster disk transfer to wait for a connection
DEFAULT_SHUTDOWN_TIMEOUT = 120
NODE_MAX_CLOCK_SKEW = 150
# Time for an intra-cluster disk transfer to wait for a connection
-DISK_TRANSFER_CONNECT_TIMEOUT = 30
+DISK_TRANSFER_CONNECT_TIMEOUT = 60
# Disk index separator
DISK_SEPARATOR = _autoconf.DISK_SEPARATOR
# Disk index separator
DISK_SEPARATOR = _autoconf.DISK_SEPARATOR
+#: Key for job IDs in opcode result
+JOB_IDS_KEY = "jobs"
+
# runparts results
(RUNPARTS_SKIP,
RUNPARTS_RUN,
# runparts results
(RUNPARTS_SKIP,
RUNPARTS_RUN,
@@
-568,8
+604,11
@@
ENFORCEABLE_TYPES = frozenset([
# HV parameter names (global namespace)
HV_BOOT_ORDER = "boot_order"
HV_CDROM_IMAGE_PATH = "cdrom_image_path"
# HV parameter names (global namespace)
HV_BOOT_ORDER = "boot_order"
HV_CDROM_IMAGE_PATH = "cdrom_image_path"
+HV_KVM_CDROM2_IMAGE_PATH = "cdrom2_image_path"
+HV_KVM_FLOPPY_IMAGE_PATH = "floppy_image_path"
HV_NIC_TYPE = "nic_type"
HV_DISK_TYPE = "disk_type"
HV_NIC_TYPE = "nic_type"
HV_DISK_TYPE = "disk_type"
+HV_KVM_CDROM_DISK_TYPE = "cdrom_disk_type"
HV_VNC_BIND_ADDRESS = "vnc_bind_address"
HV_VNC_PASSWORD_FILE = "vnc_password_file"
HV_VNC_TLS = "vnc_tls"
HV_VNC_BIND_ADDRESS = "vnc_bind_address"
HV_VNC_PASSWORD_FILE = "vnc_password_file"
HV_VNC_TLS = "vnc_tls"
@@
-605,9
+644,12
@@
HV_BLOCKDEV_PREFIX = "blockdev_prefix"
HVS_PARAMETER_TYPES = {
HV_BOOT_ORDER: VTYPE_STRING,
HVS_PARAMETER_TYPES = {
HV_BOOT_ORDER: VTYPE_STRING,
+ HV_KVM_FLOPPY_IMAGE_PATH: VTYPE_STRING,
HV_CDROM_IMAGE_PATH: VTYPE_STRING,
HV_CDROM_IMAGE_PATH: VTYPE_STRING,
+ HV_KVM_CDROM2_IMAGE_PATH: VTYPE_STRING,
HV_NIC_TYPE: VTYPE_STRING,
HV_DISK_TYPE: VTYPE_STRING,
HV_NIC_TYPE: VTYPE_STRING,
HV_DISK_TYPE: VTYPE_STRING,
+ HV_KVM_CDROM_DISK_TYPE: VTYPE_STRING,
HV_VNC_PASSWORD_FILE: VTYPE_STRING,
HV_VNC_BIND_ADDRESS: VTYPE_STRING,
HV_VNC_TLS: VTYPE_BOOL,
HV_VNC_PASSWORD_FILE: VTYPE_STRING,
HV_VNC_BIND_ADDRESS: VTYPE_STRING,
HV_VNC_TLS: VTYPE_BOOL,
@@
-621,7
+663,7
@@
HVS_PARAMETER_TYPES = {
HV_KERNEL_PATH: VTYPE_STRING,
HV_KERNEL_ARGS: VTYPE_STRING,
HV_INITRD_PATH: VTYPE_STRING,
HV_KERNEL_PATH: VTYPE_STRING,
HV_KERNEL_ARGS: VTYPE_STRING,
HV_INITRD_PATH: VTYPE_STRING,
- HV_ROOT_PATH: VTYPE_STRING,
+ HV_ROOT_PATH: VTYPE_MAYBE_STRING,
HV_SERIAL_CONSOLE: VTYPE_BOOL,
HV_USB_MOUSE: VTYPE_STRING,
HV_DEVICE_MODEL: VTYPE_STRING,
HV_SERIAL_CONSOLE: VTYPE_BOOL,
HV_USB_MOUSE: VTYPE_STRING,
HV_DEVICE_MODEL: VTYPE_STRING,
@@
-644,7
+686,7
@@
HVS_PARAMETER_TYPES = {
HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys())
HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys())
-# BE parameter names
+# Backend parameter names
BE_MEMORY = "memory"
BE_VCPUS = "vcpus"
BE_AUTO_BALANCE = "auto_balance"
BE_MEMORY = "memory"
BE_VCPUS = "vcpus"
BE_AUTO_BALANCE = "auto_balance"
@@
-679,6
+721,7
@@
OOB_COMMANDS = frozenset([OOB_POWER_ON, OOB_POWER_OFF, OOB_POWER_CYCLE,
OOB_POWER_STATUS_POWERED = "powered"
OOB_TIMEOUT = 60 # 60 seconds
OOB_POWER_STATUS_POWERED = "powered"
OOB_TIMEOUT = 60 # 60 seconds
+OOB_POWER_DELAY = 2.0 # 2 seconds
OOB_STATUS_OK = "OK"
OOB_STATUS_WARNING = "WARNING"
OOB_STATUS_OK = "OK"
OOB_STATUS_WARNING = "WARNING"
@@
-695,6
+738,7
@@
OOB_STATUSES = frozenset([
# Instance Parameters Profile
PP_DEFAULT = "default"
# Instance Parameters Profile
PP_DEFAULT = "default"
+# NIC_* constants are used inside the ganeti config
NIC_MODE = "mode"
NIC_LINK = "link"
NIC_MODE = "mode"
NIC_LINK = "link"
@@
-710,25
+754,27
@@
NICS_PARAMETER_TYPES = {
NICS_PARAMETERS = frozenset(NICS_PARAMETER_TYPES.keys())
NICS_PARAMETERS = frozenset(NICS_PARAMETER_TYPES.keys())
+# IDISK_* constants are used in opcodes, to create/change disks
IDISK_SIZE = "size"
IDISK_MODE = "mode"
IDISK_ADOPT = "adopt"
IDISK_VG = "vg"
IDISK_SIZE = "size"
IDISK_MODE = "mode"
IDISK_ADOPT = "adopt"
IDISK_VG = "vg"
+IDISK_METAVG = "metavg"
IDISK_PARAMS_TYPES = {
IDISK_SIZE: VTYPE_SIZE,
IDISK_MODE: VTYPE_STRING,
IDISK_ADOPT: VTYPE_STRING,
IDISK_VG: VTYPE_STRING,
IDISK_PARAMS_TYPES = {
IDISK_SIZE: VTYPE_SIZE,
IDISK_MODE: VTYPE_STRING,
IDISK_ADOPT: VTYPE_STRING,
IDISK_VG: VTYPE_STRING,
+ IDISK_METAVG: VTYPE_STRING,
}
IDISK_PARAMS = frozenset(IDISK_PARAMS_TYPES.keys())
}
IDISK_PARAMS = frozenset(IDISK_PARAMS_TYPES.keys())
+# INIC_* constants are used in opcodes, to create/change nics
INIC_MAC = "mac"
INIC_IP = "ip"
INIC_MODE = "mode"
INIC_LINK = "link"
INIC_MAC = "mac"
INIC_IP = "ip"
INIC_MODE = "mode"
INIC_LINK = "link"
-INIC_BRIDGE = "bridge"
INIC_PARAMS_TYPES = {
INIC_PARAMS_TYPES = {
- INIC_BRIDGE: VTYPE_STRING,
INIC_IP: VTYPE_MAYBE_STRING,
INIC_LINK: VTYPE_STRING,
INIC_MAC: VTYPE_STRING,
INIC_IP: VTYPE_MAYBE_STRING,
INIC_LINK: VTYPE_STRING,
INIC_MAC: VTYPE_STRING,
@@
-769,7
+815,8
@@
HT_NIC_E1000 = "e1000"
HT_NIC_PARAVIRTUAL = HT_DISK_PARAVIRTUAL = "paravirtual"
HT_HVM_VALID_NIC_TYPES = frozenset([HT_NIC_RTL8139, HT_NIC_NE2K_PCI,
HT_NIC_PARAVIRTUAL = HT_DISK_PARAVIRTUAL = "paravirtual"
HT_HVM_VALID_NIC_TYPES = frozenset([HT_NIC_RTL8139, HT_NIC_NE2K_PCI,
- HT_NIC_NE2K_ISA, HT_NIC_PARAVIRTUAL])
+ HT_NIC_E1000, HT_NIC_NE2K_ISA,
+ HT_NIC_PARAVIRTUAL])
HT_KVM_VALID_NIC_TYPES = frozenset([HT_NIC_RTL8139, HT_NIC_NE2K_PCI,
HT_NIC_NE2K_ISA, HT_NIC_I82551,
HT_NIC_I85557B, HT_NIC_I8259ER,
HT_KVM_VALID_NIC_TYPES = frozenset([HT_NIC_RTL8139, HT_NIC_NE2K_PCI,
HT_NIC_NE2K_ISA, HT_NIC_I82551,
HT_NIC_I85557B, HT_NIC_I8259ER,
@@
-804,11
+851,13
@@
HT_MOUSE_TABLET = "tablet"
HT_KVM_VALID_MOUSE_TYPES = frozenset([HT_MOUSE_MOUSE, HT_MOUSE_TABLET])
# Boot order
HT_KVM_VALID_MOUSE_TYPES = frozenset([HT_MOUSE_MOUSE, HT_MOUSE_TABLET])
# Boot order
+HT_BO_FLOPPY = "floppy"
HT_BO_CDROM = "cdrom"
HT_BO_DISK = "disk"
HT_BO_NETWORK = "network"
HT_BO_CDROM = "cdrom"
HT_BO_DISK = "disk"
HT_BO_NETWORK = "network"
-HT_KVM_VALID_BO_TYPES = frozenset([HT_BO_CDROM, HT_BO_DISK, HT_BO_NETWORK])
+HT_KVM_VALID_BO_TYPES = frozenset([HT_BO_FLOPPY, HT_BO_CDROM,
+ HT_BO_DISK, HT_BO_NETWORK])
# Security models
HT_SM_NONE = "none"
# Security models
HT_SM_NONE = "none"
@@
-838,6
+887,7
@@
NV_DRBDLIST = "drbd-list"
NV_FILELIST = "filelist"
NV_HVINFO = "hvinfo"
NV_HYPERVISOR = "hypervisor"
NV_FILELIST = "filelist"
NV_HVINFO = "hvinfo"
NV_HYPERVISOR = "hypervisor"
+NV_HVPARAMS = "hvparms"
NV_INSTANCELIST = "instancelist"
NV_LVLIST = "lvlist"
NV_MASTERIP = "master-ip"
NV_INSTANCELIST = "instancelist"
NV_LVLIST = "lvlist"
NV_MASTERIP = "master-ip"
@@
-851,6
+901,39
@@
NV_VERSION = "version"
NV_VGLIST = "vglist"
NV_VMNODES = "vmnodes"
NV_OOB_PATHS = "oob-paths"
NV_VGLIST = "vglist"
NV_VMNODES = "vmnodes"
NV_OOB_PATHS = "oob-paths"
+NV_BRIDGES = "bridges"
+
+# Instance status
+INSTST_RUNNING = "running"
+INSTST_ADMINDOWN = "ADMIN_down"
+INSTST_NODEOFFLINE = "ERROR_nodeoffline"
+INSTST_NODEDOWN = "ERROR_nodedown"
+INSTST_WRONGNODE = "ERROR_wrongnode"
+INSTST_ERRORUP = "ERROR_up"
+INSTST_ERRORDOWN = "ERROR_down"
+INSTST_ALL = frozenset([
+ INSTST_RUNNING,
+ INSTST_ADMINDOWN,
+ INSTST_NODEOFFLINE,
+ INSTST_NODEDOWN,
+ INSTST_WRONGNODE,
+ INSTST_ERRORUP,
+ INSTST_ERRORDOWN,
+ ])
+
+# Node roles
+NR_REGULAR = "R"
+NR_MASTER = "M"
+NR_MCANDIDATE = "C"
+NR_DRAINED = "D"
+NR_OFFLINE = "O"
+NR_ALL = frozenset([
+ NR_REGULAR,
+ NR_MASTER,
+ NR_MCANDIDATE,
+ NR_DRAINED,
+ NR_OFFLINE,
+ ])
# SSL certificate check constants (in days)
SSL_CERT_EXPIRATION_WARN = 30
# SSL certificate check constants (in days)
SSL_CERT_EXPIRATION_WARN = 30
@@
-867,13
+950,24
@@
VALID_IALLOCATOR_DIRECTIONS = frozenset([
IALLOCATOR_MODE_ALLOC = "allocate"
IALLOCATOR_MODE_RELOC = "relocate"
IALLOCATOR_MODE_MEVAC = "multi-evacuate"
IALLOCATOR_MODE_ALLOC = "allocate"
IALLOCATOR_MODE_RELOC = "relocate"
IALLOCATOR_MODE_MEVAC = "multi-evacuate"
+IALLOCATOR_MODE_MRELOC = "multi-relocate"
VALID_IALLOCATOR_MODES = frozenset([
IALLOCATOR_MODE_ALLOC,
IALLOCATOR_MODE_RELOC,
IALLOCATOR_MODE_MEVAC,
VALID_IALLOCATOR_MODES = frozenset([
IALLOCATOR_MODE_ALLOC,
IALLOCATOR_MODE_RELOC,
IALLOCATOR_MODE_MEVAC,
+ IALLOCATOR_MODE_MRELOC,
])
IALLOCATOR_SEARCH_PATH = _autoconf.IALLOCATOR_SEARCH_PATH
])
IALLOCATOR_SEARCH_PATH = _autoconf.IALLOCATOR_SEARCH_PATH
+IALLOCATOR_MRELOC_ANY = "any_group"
+IALLOCATOR_MRELOC_CHANGE = "change_group"
+IALLOCATOR_MRELOC_KEEP = "keep_group"
+IALLOCATOR_MRELOC_MODES = frozenset([
+ IALLOCATOR_MRELOC_ANY,
+ IALLOCATOR_MRELOC_CHANGE,
+ IALLOCATOR_MRELOC_KEEP,
+ ])
+
# Job queue
JOB_QUEUE_VERSION = 1
JOB_QUEUE_LOCK_FILE = QUEUE_DIR + "/lock"
# Job queue
JOB_QUEUE_VERSION = 1
JOB_QUEUE_LOCK_FILE = QUEUE_DIR + "/lock"
@@
-968,15
+1062,19
@@
QR_INSTANCE = "instance"
QR_NODE = "node"
QR_LOCK = "lock"
QR_GROUP = "group"
QR_NODE = "node"
QR_LOCK = "lock"
QR_GROUP = "group"
+QR_OS = "os"
#: List of resources which can be queried using L{opcodes.OpQuery}
#: List of resources which can be queried using L{opcodes.OpQuery}
-QR_OP_QUERY = frozenset([QR_INSTANCE, QR_NODE, QR_GROUP])
+QR_VIA_OP = frozenset([QR_INSTANCE, QR_NODE, QR_GROUP, QR_OS])
-#: List of resources which can be queried using LUXI
-QR_OP_LUXI = QR_OP_QUERY.union([
+#: List of resources which can be queried using Local UniX Interface
+QR_VIA_LUXI = QR_VIA_OP.union([
QR_LOCK,
])
QR_LOCK,
])
+#: List of resources which can be queried using RAPI
+QR_VIA_RAPI = QR_VIA_LUXI
+
# Query field types
QFT_UNKNOWN = "unknown"
QFT_TEXT = "text"
# Query field types
QFT_UNKNOWN = "unknown"
QFT_TEXT = "text"
@@
-1000,26
+1098,34
@@
QFT_ALL = frozenset([
# Query result field status (don't change or reuse values as they're used by
# clients)
#: Normal field status
# Query result field status (don't change or reuse values as they're used by
# clients)
#: Normal field status
-QRFS_NORMAL = 0
+RS_NORMAL = 0
#: Unknown field
#: Unknown field
-QRFS_UNKNOWN = 1
-#: No data (e.g. RPC error), can be used instead of L{QRFS_OFFLINE}
-QRFS_NODATA = 2
+RS_UNKNOWN = 1
+#: No data (e.g. RPC error), can be used instead of L{RS_OFFLINE}
+RS_NODATA = 2
#: Value unavailable/unsupported for item; if this field is supported
#: Value unavailable/unsupported for item; if this field is supported
-#: but we cannot get the data for the moment, QRFS_NODATA or
-#: QRFS_OFFLINE should be used
-QRFS_UNAVAIL = 3
+#: but we cannot get the data for the moment, RS_NODATA or
+#: RS_OFFLINE should be used
+RS_UNAVAIL = 3
#: Resource marked offline
#: Resource marked offline
-QRFS_OFFLINE = 4
-
-QRFS_ALL = frozenset([
- QRFS_NORMAL,
- QRFS_UNKNOWN,
- QRFS_NODATA,
- QRFS_UNAVAIL,
- QRFS_OFFLINE,
+RS_OFFLINE = 4
+
+RS_ALL = frozenset([
+ RS_NORMAL,
+ RS_UNKNOWN,
+ RS_NODATA,
+ RS_UNAVAIL,
+ RS_OFFLINE,
])
])
+#: Dictionary with special field cases and their verbose/terse formatting
+RSS_DESCRIPTION = {
+ RS_UNKNOWN: ("(unknown)", "??"),
+ RS_NODATA: ("(nodata)", "?"),
+ RS_OFFLINE: ("(offline)", "*"),
+ RS_UNAVAIL: ("(unavail)", "-"),
+ }
+
# max dynamic devices
MAX_NICS = 8
MAX_DISKS = 16
# max dynamic devices
MAX_NICS = 8
MAX_DISKS = 16
@@
-1028,6
+1134,7
@@
MAX_DISKS = 16
SS_CLUSTER_NAME = "cluster_name"
SS_CLUSTER_TAGS = "cluster_tags"
SS_FILE_STORAGE_DIR = "file_storage_dir"
SS_CLUSTER_NAME = "cluster_name"
SS_CLUSTER_TAGS = "cluster_tags"
SS_FILE_STORAGE_DIR = "file_storage_dir"
+SS_SHARED_FILE_STORAGE_DIR = "shared_file_storage_dir"
SS_MASTER_CANDIDATES = "master_candidates"
SS_MASTER_CANDIDATES_IPS = "master_candidates_ips"
SS_MASTER_IP = "master_ip"
SS_MASTER_CANDIDATES = "master_candidates"
SS_MASTER_CANDIDATES_IPS = "master_candidates_ips"
SS_MASTER_IP = "master_ip"
@@
-1090,10
+1197,13
@@
HVC_DEFAULTS = {
HV_VNC_X509: '',
HV_VNC_X509_VERIFY: False,
HV_VNC_PASSWORD_FILE: '',
HV_VNC_X509: '',
HV_VNC_X509_VERIFY: False,
HV_VNC_PASSWORD_FILE: '',
+ HV_KVM_FLOPPY_IMAGE_PATH: '',
HV_CDROM_IMAGE_PATH: '',
HV_CDROM_IMAGE_PATH: '',
+ HV_KVM_CDROM2_IMAGE_PATH: '',
HV_BOOT_ORDER: HT_BO_DISK,
HV_NIC_TYPE: HT_NIC_PARAVIRTUAL,
HV_DISK_TYPE: HT_DISK_PARAVIRTUAL,
HV_BOOT_ORDER: HT_BO_DISK,
HV_NIC_TYPE: HT_NIC_PARAVIRTUAL,
HV_DISK_TYPE: HT_DISK_PARAVIRTUAL,
+ HV_KVM_CDROM_DISK_TYPE: '',
HV_USB_MOUSE: '',
HV_MIGRATION_PORT: 8102,
HV_MIGRATION_BANDWIDTH: 32, # MiB/s
HV_USB_MOUSE: '',
HV_MIGRATION_PORT: 8102,
HV_MIGRATION_BANDWIDTH: 32, # MiB/s
@@
-1251,3
+1361,11
@@
VALID_ALLOC_POLICIES = [
ALLOC_POLICY_LAST_RESORT,
ALLOC_POLICY_UNALLOCABLE,
]
ALLOC_POLICY_LAST_RESORT,
ALLOC_POLICY_UNALLOCABLE,
]
+
+# Temporary external/shared storage parameters
+BLOCKDEV_DRIVER_MANUAL = "manual"
+
+# Whether htools was enabled at compilation time
+HTOOLS = _autoconf.HTOOLS
+# The hail iallocator
+IALLOC_HAIL = "hail"