ST_LVM_VG = "lvm-vg"
# Storage fields
+# first two are valid in LU context only, not passed to backend
+SF_NODE = "node"
+SF_TYPE = "type"
+# and the rest are valid in backend
SF_NAME = "name"
SF_SIZE = "size"
SF_FREE = "free"
SO_FIX_CONSISTENCY = "fix-consistency"
# Available fields per storage type
-VALID_STORAGE_FIELDS = {
- ST_FILE: frozenset([SF_NAME, SF_USED, SF_FREE]),
- ST_LVM_PV: frozenset([SF_NAME, SF_SIZE, SF_USED, SF_FREE, SF_ALLOCATABLE]),
- ST_LVM_VG: frozenset([SF_NAME, SF_SIZE]),
- }
+VALID_STORAGE_FIELDS = frozenset([SF_NAME, SF_TYPE, SF_SIZE,
+ SF_USED, SF_FREE, SF_ALLOCATABLE])
+
+VALID_STORAGE_TYPES = frozenset([ST_FILE, ST_LVM_PV, ST_LVM_VG])
MODIFIABLE_STORAGE_FIELDS = {
ST_LVM_PV: frozenset([SF_ALLOCATABLE]),
MIN_VG_SIZE = 20480
DEFAULT_MAC_PREFIX = "aa:00:00"
LVM_STRIPECOUNT = _autoconf.LVM_STRIPECOUNT
+# default maximum instance wait time, in seconds.
+DEFAULT_SHUTDOWN_TIMEOUT = 120
+
# RPC constants
(RPC_ENCODING_NONE,
NV_VERSION = "version"
NV_VGLIST = "vglist"
NV_DRBDLIST = "drbd-list"
+NV_NODESETUP = "nodesetup"
# Allocator framework constants
IALLOCATOR_VERSION = 2
CONFD_REQ_MC_PIP_LIST = 5
CONFD_REQ_INSTANCES_IPS_LIST = 6
+# Confd request query fields. These are used to narrow down queries.
+# These must be strings rather than integers, because json-encoding
+# converts them to strings anyway, as they're used as dict-keys.
+CONFD_REQQ_LINK = "0"
+CONFD_REQQ_IP = "1"
+CONFD_REQQ_IPLIST = "2"
+
CONFD_REQS = frozenset([
CONFD_REQ_PING,
CONFD_REQ_NODE_ROLE_BYNAME,
# A few common errors for confd
CONFD_ERROR_UNKNOWN_ENTRY = 1
CONFD_ERROR_INTERNAL = 2
+CONFD_ERROR_ARGUMENT = 3
# Each request is "salted" by the current timestamp.
# This constants decides how many seconds of skew to accept.