Switch KVM to multi-error verify results
[ganeti-local] / lib / constants.py
index b24c055..4e04dff 100644 (file)
@@ -1,7 +1,7 @@
 #
 #
 
-# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Google Inc.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Google Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -421,7 +421,7 @@ DTS_FILEBASED = compat.UniqueFrozenset([
   ])
 
 # the set of disk templates that are supported by exclusive_storage
-DTS_EXCL_STORAGE = frozenset([DT_PLAIN])
+DTS_EXCL_STORAGE = compat.UniqueFrozenset([DT_PLAIN])
 
 # templates for which we don't perform checks on free space
 DTS_NO_FREE_SPACE_CHECK = compat.UniqueFrozenset([
@@ -834,9 +834,12 @@ HV_SOUNDHW = "soundhw"
 HV_USB_DEVICES = "usb_devices"
 HV_VGA = "vga"
 HV_KVM_EXTRA = "kvm_extra"
+HV_KVM_MACHINE_VERSION = "machine_version"
+HV_KVM_PATH = "kvm_path"
 
 
 HVS_PARAMETER_TYPES = {
+  HV_KVM_PATH: VTYPE_STRING,
   HV_BOOT_ORDER: VTYPE_STRING,
   HV_KVM_FLOPPY_IMAGE_PATH: VTYPE_STRING,
   HV_CDROM_IMAGE_PATH: VTYPE_STRING,
@@ -901,6 +904,7 @@ HVS_PARAMETER_TYPES = {
   HV_USB_DEVICES: VTYPE_STRING,
   HV_VGA: VTYPE_STRING,
   HV_KVM_EXTRA: VTYPE_STRING,
+  HV_KVM_MACHINE_VERSION: VTYPE_STRING,
   }
 
 HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys())
@@ -1428,6 +1432,7 @@ VERIFY_OPTIONAL_CHECKS = compat.UniqueFrozenset([VERIFY_NPLUSONE_MEM])
 
 # Cluster Verify error classes
 CV_TCLUSTER = "cluster"
+CV_TGROUP = "group"
 CV_TNODE = "node"
 CV_TINSTANCE = "instance"
 
@@ -1446,6 +1451,11 @@ CV_ECLUSTERDANGLINGNODES = \
 CV_ECLUSTERDANGLINGINST = \
   (CV_TNODE, "ECLUSTERDANGLINGINST",
    "Some instances have a non-existing primary node")
+CV_EGROUPMIXEDESFLAG = \
+  (CV_TGROUP, "EGROUPMIXEDESFLAG",
+   "exclusive_storage flag is not uniform within the group")
+CV_EGROUPDIFFERENTPVSIZE = \
+  (CV_TGROUP, "EGROUPDIFFERENTPVSIZE", "PVs in the group have different sizes")
 CV_EINSTANCEBADNODE = \
   (CV_TINSTANCE, "EINSTANCEBADNODE",
    "Instance marked as running lives on an offline node")
@@ -1466,6 +1476,9 @@ CV_EINSTANCESPLITGROUPS = \
 CV_EINSTANCEPOLICY = \
   (CV_TINSTANCE, "EINSTANCEPOLICY",
    "Instance does not meet policy")
+CV_EINSTANCEUNSUITABLENODE = \
+  (CV_TINSTANCE, "EINSTANCEUNSUITABLENODE",
+   "Instance running on nodes that are not suitable for it")
 CV_ENODEDRBD = \
   (CV_TNODE, "ENODEDRBD", "Error parsing the DRBD status file")
 CV_ENODEDRBDHELPER = \
@@ -1547,28 +1560,29 @@ CV_ALL_ECODES_STRINGS = \
   compat.UniqueFrozenset(estr for (_, estr, _) in CV_ALL_ECODES)
 
 # Node verify constants
+NV_BRIDGES = "bridges"
 NV_DRBDHELPER = "drbd-helper"
 NV_DRBDLIST = "drbd-list"
+NV_EXCLUSIVEPVS = "exclusive-pvs"
 NV_FILELIST = "filelist"
+NV_FILE_STORAGE_PATHS = "file-storage-paths"
 NV_HVINFO = "hvinfo"
-NV_HYPERVISOR = "hypervisor"
 NV_HVPARAMS = "hvparms"
+NV_HYPERVISOR = "hypervisor"
 NV_INSTANCELIST = "instancelist"
 NV_LVLIST = "lvlist"
 NV_MASTERIP = "master-ip"
 NV_NODELIST = "nodelist"
 NV_NODENETTEST = "node-net-test"
 NV_NODESETUP = "nodesetup"
+NV_OOB_PATHS = "oob-paths"
 NV_OSLIST = "oslist"
 NV_PVLIST = "pvlist"
 NV_TIME = "time"
+NV_USERSCRIPTS = "user-scripts"
 NV_VERSION = "version"
 NV_VGLIST = "vglist"
 NV_VMNODES = "vmnodes"
-NV_OOB_PATHS = "oob-paths"
-NV_BRIDGES = "bridges"
-NV_USERSCRIPTS = "user-scripts"
-NV_FILE_STORAGE_PATHS = "file-storage-paths"
 
 # Instance status
 INSTST_RUNNING = "running"
@@ -1918,6 +1932,7 @@ HVC_DEFAULTS = {
     HV_CPU_WEIGHT: 256,
     },
   HT_KVM: {
+    HV_KVM_PATH: KVM_PATH,
     HV_KERNEL_PATH: KVM_KERNEL,
     HV_INITRD_PATH: "",
     HV_KERNEL_ARGS: "ro",
@@ -1972,6 +1987,7 @@ HVC_DEFAULTS = {
     HV_USB_DEVICES: "",
     HV_VGA: "",
     HV_KVM_EXTRA: "",
+    HV_KVM_MACHINE_VERSION: "",
     },
   HT_FAKE: {},
   HT_CHROOT: {
@@ -2178,14 +2194,16 @@ CONFD_ERROR_ARGUMENT = 3
 # TODO: make this a default and allow the value to be more configurable
 CONFD_MAX_CLOCK_SKEW = 2 * NODE_MAX_CLOCK_SKEW
 
-# When we haven't reloaded the config for more than this amount of seconds, we
-# force a test to see if inotify is betraying us.
-CONFD_CONFIG_RELOAD_TIMEOUT = 60
+# When we haven't reloaded the config for more than this amount of
+# seconds, we force a test to see if inotify is betraying us. Using a
+# prime number to ensure we get less chance of 'same wakeup' with
+# other processes.
+CONFD_CONFIG_RELOAD_TIMEOUT = 17
 
-# If we receive more than one update in this amount of seconds, we move to
-# polling every RATELIMIT seconds, rather than relying on inotify, to be able
-# to serve more requests.
-CONFD_CONFIG_RELOAD_RATELIMIT = 2
+# If we receive more than one update in this amount of microseconds,
+# we move to polling every RATELIMIT seconds, rather than relying on
+# inotify, to be able to serve more requests.
+CONFD_CONFIG_RELOAD_RATELIMIT = 250000
 
 # Magic number prepended to all confd queries.
 # This allows us to distinguish different types of confd protocols and handle
@@ -2309,5 +2327,8 @@ AUTO_REPAIR_ALL_RESULTS = frozenset([
     AUTO_REPAIR_ENOPERM,
 ])
 
+# The version identifier for builtin data collectors
+BUILTIN_DATA_COLLECTOR_VERSION = "B"
+
 # Do not re-export imported modules
 del re, _vcsversion, _autoconf, socket, pathutils, compat