1 {-| HsConstants contains the Haskell constants
3 This is a transitional module complementary to 'Ganeti.Constants'. It
4 is intended to contain the Haskell constants that are meant to be
7 Do not write any definitions in this file other than constants. Do
8 not even write helper functions. The definitions in this module are
9 automatically stripped to build the Makefile.am target
10 'ListConstants.hs'. If there are helper functions in this module,
11 they will also be dragged and it will cause compilation to fail.
12 Therefore, all helper functions should go to a separate module and
19 Copyright (C) 2013 Google Inc.
21 This program is free software; you can redistribute it and/or modify
22 it under the terms of the GNU General Public License as published by
23 the Free Software Foundation; either version 2 of the License, or
24 (at your option) any later version.
26 This program is distributed in the hope that it will be useful, but
27 WITHOUT ANY WARRANTY; without even the implied warranty of
28 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
29 General Public License for more details.
31 You should have received a copy of the GNU General Public License
32 along with this program; if not, write to the Free Software
33 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
37 module Ganeti.HsConstants where
39 import Control.Arrow ((***))
40 import Data.List ((\\))
42 import qualified Data.Map as Map (fromList, keys, insert)
45 import Ganeti.ConstantUtils (PythonChar(..), FrozenSet, Protocol(..),
47 import qualified Ganeti.ConstantUtils as ConstantUtils
48 import Ganeti.Runtime (GanetiDaemon(..), MiscGroup(..), GanetiGroup(..),
50 import Ganeti.HTools.Types (AutoRepairResult(..), AutoRepairType(..))
51 import qualified Ganeti.HTools.Types as Types
52 import Ganeti.Logging (SyslogUsage(..))
53 import qualified Ganeti.Logging as Logging (syslogUsageToRaw)
54 import qualified Ganeti.Runtime as Runtime
56 import qualified Ganeti.Types as Types
57 import Ganeti.Confd.Types (ConfdRequestType(..), ConfdReqField(..),
58 ConfdReplyStatus(..), ConfdNodeRole(..),
60 import qualified Ganeti.Confd.Types as Types
62 {-# ANN module "HLint: ignore Use camelCase" #-}
64 -- * 'autoconf' constants for Python only ('autotools/build-bash-completion')
66 htoolsProgs :: [String]
67 htoolsProgs = AutoConf.htoolsProgs
69 -- * 'autoconf' constants for Python only ('lib/constants.py')
71 drbdBarriers :: String
72 drbdBarriers = AutoConf.drbdBarriers
74 drbdNoMetaFlush :: Bool
75 drbdNoMetaFlush = AutoConf.drbdNoMetaFlush
78 lvmStripecount = AutoConf.lvmStripecount
80 -- * 'autoconf' constants for Python only ('lib/pathutils.py')
82 -- ** Build-time constants
85 exportDir = AutoConf.exportDir
87 osSearchPath :: [String]
88 osSearchPath = AutoConf.osSearchPath
90 esSearchPath :: [String]
91 esSearchPath = AutoConf.esSearchPath
93 sshConfigDir :: String
94 sshConfigDir = AutoConf.sshConfigDir
96 xenConfigDir :: String
97 xenConfigDir = AutoConf.xenConfigDir
100 sysconfdir = AutoConf.sysconfdir
103 toolsdir = AutoConf.toolsdir
105 localstatedir :: String
106 localstatedir = AutoConf.localstatedir
108 -- ** Paths which don't change for a virtual cluster
111 pkglibdir = AutoConf.pkglibdir
114 sharedir = AutoConf.sharedir
116 -- * 'autoconf' constants for Python only ('lib/build/sphinx_ext.py')
118 manPages :: Map String Int
119 manPages = Map.fromList AutoConf.manPages
121 -- * 'autoconf' constants for QA cluster only ('qa/qa_cluster.py')
123 versionedsharedir :: String
124 versionedsharedir = AutoConf.versionedsharedir
126 -- * 'autoconf' constants for Python only ('tests/py/docs_unittest.py')
128 gntScripts :: [String]
129 gntScripts = AutoConf.gntScripts
131 -- * Various versions
133 releaseVersion :: String
134 releaseVersion = AutoConf.packageVersion
137 versionMajor = AutoConf.versionMajor
140 versionMinor = AutoConf.versionMinor
142 versionRevision :: Int
143 versionRevision = AutoConf.versionRevision
146 dirVersion = AutoConf.dirVersion
157 osApiVersions :: FrozenSet Int
158 osApiVersions = ConstantUtils.mkSet [osApiV10, osApiV15, osApiV20]
167 configMajor = AutoConf.versionMajor
170 configMinor = AutoConf.versionMinor
172 -- | The configuration is supposed to remain stable across
173 -- revisions. Therefore, the revision number is cleared to '0'.
174 configRevision :: Int
178 configVersion = buildVersion configMajor configMinor configRevision
180 -- | Similarly to the configuration (see 'configRevision'), the
181 -- protocols are supposed to remain stable across revisions.
182 protocolVersion :: Int
183 protocolVersion = buildVersion configMajor configMinor configRevision
187 daemonsGroup :: String
188 daemonsGroup = Runtime.daemonGroup (ExtraGroup DaemonsGroup)
191 adminGroup = Runtime.daemonGroup (ExtraGroup AdminGroup)
193 masterdUser :: String
194 masterdUser = Runtime.daemonUser GanetiMasterd
196 masterdGroup :: String
197 masterdGroup = Runtime.daemonGroup (DaemonGroup GanetiMasterd)
200 rapiUser = Runtime.daemonUser GanetiRapi
203 rapiGroup = Runtime.daemonGroup (DaemonGroup GanetiRapi)
206 confdUser = Runtime.daemonUser GanetiConfd
209 confdGroup = Runtime.daemonGroup (DaemonGroup GanetiConfd)
212 luxidUser = Runtime.daemonUser GanetiLuxid
215 luxidGroup = Runtime.daemonGroup (DaemonGroup GanetiLuxid)
218 nodedUser = Runtime.daemonUser GanetiNoded
221 nodedGroup = Runtime.daemonGroup (DaemonGroup GanetiNoded)
224 mondUser = Runtime.daemonUser GanetiMond
227 mondGroup = Runtime.daemonGroup (DaemonGroup GanetiMond)
229 sshLoginUser :: String
230 sshLoginUser = AutoConf.sshLoginUser
232 sshConsoleUser :: String
233 sshConsoleUser = AutoConf.sshConsoleUser
235 -- * Cpu pinning separators and constants
237 cpuPinningSep :: String
240 cpuPinningAll :: String
241 cpuPinningAll = "all"
243 -- | Internal representation of "all"
244 cpuPinningAllVal :: Int
245 cpuPinningAllVal = -1
247 -- | One "all" entry in a CPU list means CPU pinning is off
248 cpuPinningOff :: [Int]
249 cpuPinningOff = [cpuPinningAllVal]
251 -- | A Xen-specific implementation detail is that there is no way to
252 -- actually say "use any cpu for pinning" in a Xen configuration file,
253 -- as opposed to the command line, where you can say
255 -- xm vcpu-pin <domain> <vcpu> all
258 -- The workaround used in Xen is "0-63" (see source code function
259 -- "xm_vcpu_pin" in @<xen-source>/tools/python/xen/xm/main.py@).
261 -- To support future changes, the following constant is treated as a
262 -- blackbox string that simply means "use any cpu for pinning under
264 cpuPinningAllXen :: String
265 cpuPinningAllXen = "0-63"
267 -- | A KVM-specific implementation detail - the following value is
268 -- used to set CPU affinity to all processors (--0 through --31), per
271 -- FIXME: This only works for machines with up to 32 CPU cores
272 cpuPinningAllKvm :: Int
273 cpuPinningAllKvm = 0xFFFFFFFF
284 minWipeChunkPercent :: Int
285 minWipeChunkPercent = 10
293 secureDirMode = 0o700
295 secureFileMode :: Int
296 secureFileMode = 0o600
298 adoptableBlockdevRoot :: String
299 adoptableBlockdevRoot = "/dev/disk/"
301 -- * 'autoconf' enable/disable
304 enableConfd = AutoConf.enableConfd
307 enableMond = AutoConf.enableMond
309 enableRestrictedCommands :: Bool
310 enableRestrictedCommands = AutoConf.enableRestrictedCommands
312 enableSplitQuery :: Bool
313 enableSplitQuery = AutoConf.enableSplitQuery
326 confd = Runtime.daemonName GanetiConfd
329 masterd = Runtime.daemonName GanetiMasterd
332 mond = Runtime.daemonName GanetiMond
335 noded = Runtime.daemonName GanetiNoded
338 luxid = Runtime.daemonName GanetiLuxid
341 rapi = Runtime.daemonName GanetiRapi
343 daemons :: FrozenSet String
345 ConstantUtils.mkSet [confd,
352 defaultConfdPort :: Int
353 defaultConfdPort = 1814
355 defaultMondPort :: Int
356 defaultMondPort = 1815
358 defaultNodedPort :: Int
359 defaultNodedPort = 1811
361 defaultRapiPort :: Int
362 defaultRapiPort = 5080
364 daemonsPorts :: Map String (Protocol, Int)
366 Map.fromList [(confd, (Udp, defaultConfdPort)),
367 (mond, (Tcp, defaultMondPort)),
368 (noded, (Tcp, defaultNodedPort)),
369 (rapi, (Tcp, defaultRapiPort)),
373 firstDrbdPort = 11000
378 daemonsLogbase :: Map String String
381 [ (Runtime.daemonName d, Runtime.daemonLogBase d) | d <- [minBound..] ]
383 extraLogreasonAccess :: String
384 extraLogreasonAccess = Runtime.daemonsExtraLogbase GanetiMond AccessLog
386 extraLogreasonError :: String
387 extraLogreasonError = Runtime.daemonsExtraLogbase GanetiMond ErrorLog
390 devConsole = ConstantUtils.devConsole
393 procMounts = "/proc/mounts"
395 -- * Luxi (Local UniX Interface) related constants
397 luxiEom :: PythonChar
398 luxiEom = PythonChar '\x03'
400 -- | Environment variable for the luxi override socket
401 luxiOverride :: String
402 luxiOverride = "FORCE_LUXI_SOCKET"
404 luxiOverrideMaster :: String
405 luxiOverrideMaster = "master"
407 luxiOverrideQuery :: String
408 luxiOverrideQuery = "query"
411 luxiVersion = configVersion
415 syslogUsage :: String
416 syslogUsage = AutoConf.syslogUsage
419 syslogNo = Logging.syslogUsageToRaw SyslogNo
422 syslogYes = Logging.syslogUsageToRaw SyslogYes
425 syslogOnly = Logging.syslogUsageToRaw SyslogOnly
427 syslogSocket :: String
428 syslogSocket = "/dev/log"
430 exportConfFile :: String
431 exportConfFile = "config.ini"
435 xenBootloader :: String
436 xenBootloader = AutoConf.xenBootloader
445 xenInitrd = AutoConf.xenInitrd
448 xenKernel = AutoConf.xenKernel
450 -- FIXME: perhaps rename to 'validXenCommands' for consistency with
452 knownXenCommands :: FrozenSet String
453 knownXenCommands = ConstantUtils.mkSet [xenCmdXl, xenCmdXm]
458 kvmPath = AutoConf.kvmPath
461 kvmKernel = AutoConf.kvmKernel
463 socatEscapeCode :: String
464 socatEscapeCode = "0x1d"
467 socatPath = AutoConf.socatPath
469 socatUseCompress :: Bool
470 socatUseCompress = AutoConf.socatUseCompress
472 socatUseEscape :: Bool
473 socatUseEscape = AutoConf.socatUseEscape
477 -- | Display a message for console access
478 consMessage :: String
481 -- | Console as SPICE server
485 -- | Console as SSH command
489 -- | Console as VNC server
493 consAll :: FrozenSet String
494 consAll = ConstantUtils.mkSet [consMessage, consSpice, consSsh, consVnc]
496 -- | RSA key bit length
498 -- For RSA keys more bits are better, but they also make operations
499 -- more expensive. NIST SP 800-131 recommends a minimum of 2048 bits
500 -- from the year 2010 on.
504 -- | Ciphers allowed for SSL connections.
506 -- For the format, see ciphers(1). A better way to disable ciphers
507 -- would be to use the exclamation mark (!), but socat versions below
508 -- 1.5 can't parse exclamation marks in options properly. When
509 -- modifying the ciphers, ensure not to accidentially add something
510 -- after it's been removed. Use the "openssl" utility to check the
511 -- allowed ciphers, e.g. "openssl ciphers -v HIGH:-DES".
512 opensslCiphers :: String
513 opensslCiphers = "HIGH:-DES:-3DES:-EXPORT:-ADH"
517 -- | commonName (CN) used in certificates
519 x509CertCn = "ganeti.example.com"
521 -- | Default validity of certificates in days
522 x509CertDefaultValidity :: Int
523 x509CertDefaultValidity = 365 * 5
525 x509CertSignatureHeader :: String
526 x509CertSignatureHeader = "X-Ganeti-Signature"
528 -- | Digest used to sign certificates ("openssl x509" uses SHA1 by default)
529 x509CertSignDigest :: String
530 x509CertSignDigest = "SHA1"
532 -- * Import/export daemon mode
540 -- * Import/export transport compression
549 iecAll = [iecGzip, iecNone]
551 ieCustomSize :: String
554 -- * Import/export I/O
556 -- | Direct file I/O, equivalent to a shell's I/O redirection using
561 -- | Raw block device I/O using "dd"
562 ieioRawDisk :: String
565 -- | OS definition import/export script
567 ieioScript = "script"
571 hooksNameCfgupdate :: String
572 hooksNameCfgupdate = "config-update"
574 hooksNameWatcher :: String
575 hooksNameWatcher = "watcher"
578 hooksPath = "/sbin:/bin:/usr/sbin:/usr/bin"
580 hooksPhasePost :: String
581 hooksPhasePost = "post"
583 hooksPhasePre :: String
584 hooksPhasePre = "pre"
589 -- * Hooks subject type (what object type does the LU deal with)
591 htypeCluster :: String
592 htypeCluster = "CLUSTER"
597 htypeInstance :: String
598 htypeInstance = "INSTANCE"
600 htypeNetwork :: String
601 htypeNetwork = "NETWORK"
620 stBlock = Types.storageTypeToRaw StorageBlock
623 stDiskless = Types.storageTypeToRaw StorageDiskless
626 stExt = Types.storageTypeToRaw StorageExt
629 stFile = Types.storageTypeToRaw StorageFile
632 stLvmPv = Types.storageTypeToRaw StorageLvmPv
635 stLvmVg = Types.storageTypeToRaw StorageLvmVg
638 stRados = Types.storageTypeToRaw StorageRados
640 storageTypes :: FrozenSet String
641 storageTypes = ConstantUtils.mkSet $ map Types.storageTypeToRaw [minBound..]
643 -- | The set of storage types for which storage reporting is available
645 -- FIXME: Remove this, once storage reporting is available for all
647 stsReport :: FrozenSet String
648 stsReport = ConstantUtils.mkSet [stFile, stLvmPv, stLvmVg]
651 -- ** First two are valid in LU context only, not passed to backend
659 -- ** and the rest are valid in backend
661 sfAllocatable :: String
662 sfAllocatable = Types.storageFieldToRaw SFAllocatable
665 sfFree = Types.storageFieldToRaw SFFree
668 sfName = Types.storageFieldToRaw SFName
671 sfSize = Types.storageFieldToRaw SFSize
674 sfUsed = Types.storageFieldToRaw SFUsed
676 validStorageFields :: FrozenSet String
678 ConstantUtils.mkSet $ map Types.storageFieldToRaw [minBound..] ++
681 modifiableStorageFields :: Map String (FrozenSet String)
682 modifiableStorageFields =
683 Map.fromList [(Types.storageTypeToRaw StorageLvmPv,
684 ConstantUtils.mkSet [sfAllocatable])]
686 -- * Storage operations
688 soFixConsistency :: String
689 soFixConsistency = "fix-consistency"
691 validStorageOperations :: Map String (FrozenSet String)
692 validStorageOperations =
693 Map.fromList [(Types.storageTypeToRaw StorageLvmVg,
694 ConstantUtils.mkSet [soFixConsistency])]
702 vfInstance = "instance"
719 -- * Local disk status
722 ldsFaulty = Types.localDiskStatusToRaw DiskStatusFaulty
725 ldsOkay = Types.localDiskStatusToRaw DiskStatusOk
728 ldsUnknown = Types.localDiskStatusToRaw DiskStatusUnknown
730 ldsNames :: Map Int String
732 Map.fromList [ (Types.localDiskStatusToRaw ds,
733 localDiskStatusName ds) | ds <- [minBound..] ]
735 -- * Disk template types
738 dtDiskless = Types.diskTemplateToRaw DTDiskless
741 dtFile = Types.diskTemplateToRaw DTFile
743 dtSharedFile :: String
744 dtSharedFile = Types.diskTemplateToRaw DTSharedFile
747 dtPlain = Types.diskTemplateToRaw DTPlain
750 dtBlock = Types.diskTemplateToRaw DTBlock
753 dtDrbd8 = Types.diskTemplateToRaw DTDrbd8
756 dtRbd = Types.diskTemplateToRaw DTRbd
759 dtExt = Types.diskTemplateToRaw DTExt
761 -- | This is used to order determine the default disk template when
762 -- the list of enabled disk templates is inferred from the current
763 -- state of the cluster. This only happens on an upgrade from a
764 -- version of Ganeti that did not support the 'enabled_disk_templates'
766 diskTemplatePreference :: [String]
767 diskTemplatePreference =
768 map Types.diskTemplateToRaw
769 [DTBlock, DTDiskless, DTDrbd8, DTExt, DTFile, DTPlain, DTRbd, DTSharedFile]
771 diskTemplates :: FrozenSet String
772 diskTemplates = ConstantUtils.mkSet $ map Types.diskTemplateToRaw [minBound..]
774 -- | Disk templates that are enabled by default
775 defaultEnabledDiskTemplates :: [String]
776 defaultEnabledDiskTemplates = map Types.diskTemplateToRaw [DTDrbd8, DTPlain]
778 -- | Mapping of disk templates to storage types
779 mapDiskTemplateStorageType :: Map String String
780 mapDiskTemplateStorageType =
782 map (Types.diskTemplateToRaw *** Types.storageTypeToRaw)
783 [(DTBlock, StorageBlock),
784 (DTDrbd8, StorageLvmVg),
786 (DTSharedFile, StorageFile),
787 (DTFile, StorageFile),
788 (DTDiskless, StorageDiskless),
789 (DTPlain, StorageLvmVg),
790 (DTRbd, StorageRados)]
792 -- | The set of network-mirrored disk templates
793 dtsIntMirror :: FrozenSet String
794 dtsIntMirror = ConstantUtils.mkSet [dtDrbd8]
796 -- | 'DTDiskless' is 'trivially' externally mirrored
797 dtsExtMirror :: FrozenSet String
799 ConstantUtils.mkSet $
800 map Types.diskTemplateToRaw [DTDiskless, DTBlock, DTExt, DTSharedFile, DTRbd]
802 -- | The set of non-lvm-based disk templates
803 dtsNotLvm :: FrozenSet String
805 ConstantUtils.mkSet $
806 map Types.diskTemplateToRaw
807 [DTSharedFile, DTDiskless, DTBlock, DTExt, DTFile, DTRbd]
809 -- | The set of disk templates which can be grown
810 dtsGrowable :: FrozenSet String
812 ConstantUtils.mkSet $
813 map Types.diskTemplateToRaw
814 [DTSharedFile, DTDrbd8, DTPlain, DTExt, DTFile, DTRbd]
816 -- | The set of disk templates that allow adoption
817 dtsMayAdopt :: FrozenSet String
819 ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTBlock, DTPlain]
821 -- | The set of disk templates that *must* use adoption
822 dtsMustAdopt :: FrozenSet String
823 dtsMustAdopt = ConstantUtils.mkSet [Types.diskTemplateToRaw DTBlock]
825 -- | The set of disk templates that allow migrations
826 dtsMirrored :: FrozenSet String
827 dtsMirrored = dtsIntMirror `ConstantUtils.union` dtsExtMirror
829 -- | The set of file based disk templates
830 dtsFilebased :: FrozenSet String
832 ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTSharedFile, DTFile]
834 -- | The set of disk templates that can be moved by copying
836 -- Note: a requirement is that they're not accessed externally or
837 -- shared between nodes; in particular, sharedfile is not suitable.
838 dtsCopyable :: FrozenSet String
840 ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTPlain, DTFile]
842 -- | The set of disk templates that are supported by exclusive_storage
843 dtsExclStorage :: FrozenSet String
844 dtsExclStorage = ConstantUtils.mkSet $ map Types.diskTemplateToRaw [DTPlain]
846 -- | Templates for which we don't perform checks on free space
847 dtsNoFreeSpaceCheck :: FrozenSet String
848 dtsNoFreeSpaceCheck =
849 ConstantUtils.mkSet $
850 map Types.diskTemplateToRaw [DTExt, DTSharedFile, DTFile, DTRbd]
852 dtsBlock :: FrozenSet String
854 ConstantUtils.mkSet $
855 map Types.diskTemplateToRaw [DTPlain, DTDrbd8, DTBlock, DTRbd, DTExt]
859 drbdHmacAlg :: String
862 drbdDefaultNetProtocol :: String
863 drbdDefaultNetProtocol = "C"
865 drbdMigrationNetProtocol :: String
866 drbdMigrationNetProtocol = "C"
868 drbdStatusFile :: String
869 drbdStatusFile = "/proc/drbd"
871 -- | Size of DRBD meta block device
875 -- * Drbd barrier types
877 drbdBDiskBarriers :: String
878 drbdBDiskBarriers = "b"
880 drbdBDiskDrain :: String
883 drbdBDiskFlush :: String
889 -- | Rbd tool command
893 -- * File backend driver
896 fdBlktap = Types.fileDriverToRaw FileBlktap
899 fdLoop = Types.fileDriverToRaw FileLoop
901 fileDriver :: FrozenSet String
903 ConstantUtils.mkSet $
904 map Types.fileDriverToRaw [minBound..]
906 -- | The set of drbd-like disk types
907 ldsDrbd :: FrozenSet String
908 ldsDrbd = ConstantUtils.mkSet [Types.diskTemplateToRaw DTDrbd8]
910 -- * Disk access mode
913 diskRdonly = Types.diskModeToRaw DiskRdOnly
916 diskRdwr = Types.diskModeToRaw DiskRdWr
918 diskAccessSet :: FrozenSet String
919 diskAccessSet = ConstantUtils.mkSet $ map Types.diskModeToRaw [minBound..]
921 -- * Disk replacement mode
923 replaceDiskAuto :: String
924 replaceDiskAuto = Types.replaceDisksModeToRaw ReplaceAuto
926 replaceDiskChg :: String
927 replaceDiskChg = Types.replaceDisksModeToRaw ReplaceNewSecondary
929 replaceDiskPri :: String
930 replaceDiskPri = Types.replaceDisksModeToRaw ReplaceOnPrimary
932 replaceDiskSec :: String
933 replaceDiskSec = Types.replaceDisksModeToRaw ReplaceOnSecondary
935 replaceModes :: FrozenSet String
937 ConstantUtils.mkSet $ map Types.replaceDisksModeToRaw [minBound..]
939 -- * Instance export mode
941 exportModeLocal :: String
942 exportModeLocal = Types.exportModeToRaw ExportModeLocal
944 exportModeRemote :: String
945 exportModeRemote = Types.exportModeToRaw ExportModeRemote
947 exportModes :: FrozenSet String
948 exportModes = ConstantUtils.mkSet $ map Types.exportModeToRaw [minBound..]
950 -- * Instance creation modes
952 instanceCreate :: String
953 instanceCreate = Types.instCreateModeToRaw InstCreate
955 instanceImport :: String
956 instanceImport = Types.instCreateModeToRaw InstImport
958 instanceRemoteImport :: String
959 instanceRemoteImport = Types.instCreateModeToRaw InstRemoteImport
961 instanceCreateModes :: FrozenSet String
962 instanceCreateModes =
963 ConstantUtils.mkSet $ map Types.instCreateModeToRaw [minBound..]
965 -- * Remote import/export handshake message and version
967 rieHandshake :: String
968 rieHandshake = "Hi, I'm Ganeti"
973 -- | Remote import/export certificate validity in seconds
974 rieCertValidity :: Int
975 rieCertValidity = 24 * 60 * 60
977 -- | Export only: how long to wait per connection attempt (seconds)
978 rieConnectAttemptTimeout :: Int
979 rieConnectAttemptTimeout = 20
981 -- | Export only: number of attempts to connect
982 rieConnectRetries :: Int
983 rieConnectRetries = 10
985 -- | Overall timeout for establishing connection
986 rieConnectTimeout :: Int
987 rieConnectTimeout = 180
989 -- | Give child process up to 5 seconds to exit after sending a signal
990 childLingerTimeout :: Double
991 childLingerTimeout = 5.0
993 -- * Import/export config options
996 inisectBep = "backend"
999 inisectExp = "export"
1001 inisectHyp :: String
1002 inisectHyp = "hypervisor"
1004 inisectIns :: String
1005 inisectIns = "instance"
1007 inisectOsp :: String
1010 -- * Dynamic device modification
1013 ddmAdd = Types.ddmFullToRaw DdmFullAdd
1016 ddmModify = Types.ddmFullToRaw DdmFullModify
1019 ddmRemove = Types.ddmFullToRaw DdmFullRemove
1021 ddmsValues :: FrozenSet String
1022 ddmsValues = ConstantUtils.mkSet [ddmAdd, ddmRemove]
1024 ddmsValuesWithModify :: FrozenSet String
1025 ddmsValuesWithModify = ConstantUtils.mkSet $ map Types.ddmFullToRaw [minBound..]
1027 -- * Common exit codes
1033 exitFailure = ConstantUtils.exitFailure
1035 exitNotcluster :: Int
1038 exitNotmaster :: Int
1041 exitNodesetupError :: Int
1042 exitNodesetupError = 12
1044 -- | Need user confirmation
1045 exitConfirmation :: Int
1046 exitConfirmation = 13
1048 -- | Exit code for query operations with unknown fields
1049 exitUnknownField :: Int
1050 exitUnknownField = 14
1054 tagCluster :: String
1055 tagCluster = Types.tagKindToRaw TagKindCluster
1057 tagInstance :: String
1058 tagInstance = Types.tagKindToRaw TagKindInstance
1060 tagNetwork :: String
1061 tagNetwork = Types.tagKindToRaw TagKindNetwork
1064 tagNode = Types.tagKindToRaw TagKindNode
1066 tagNodegroup :: String
1067 tagNodegroup = Types.tagKindToRaw TagKindGroup
1069 validTagTypes :: FrozenSet String
1070 validTagTypes = ConstantUtils.mkSet $ map Types.tagKindToRaw [minBound..]
1075 maxTagsPerObj :: Int
1076 maxTagsPerObj = 4096
1080 defaultBridge :: String
1081 defaultBridge = "xen-br0"
1083 defaultOvs :: String
1084 defaultOvs = "switch1"
1086 -- | 60 MiB, expressed in KiB
1087 classicDrbdSyncSpeed :: Int
1088 classicDrbdSyncSpeed = 60 * 1024
1090 ip4AddressAny :: String
1091 ip4AddressAny = "0.0.0.0"
1093 ip4AddressLocalhost :: String
1094 ip4AddressLocalhost = "127.0.0.1"
1096 ip6AddressAny :: String
1097 ip6AddressAny = "::"
1099 ip6AddressLocalhost :: String
1100 ip6AddressLocalhost = "::1"
1108 validIpVersions :: FrozenSet Int
1109 validIpVersions = ConstantUtils.mkSet [ip4Version, ip6Version]
1111 tcpPingTimeout :: Int
1117 defaultDrbdHelper :: String
1118 defaultDrbdHelper = "/bin/true"
1123 defaultMacPrefix :: String
1124 defaultMacPrefix = "aa:00:00"
1126 -- | Default maximum instance wait time, in seconds.
1127 defaultShutdownTimeout :: Int
1128 defaultShutdownTimeout = 120
1130 -- | Node clock skew in seconds
1131 nodeMaxClockSkew :: Int
1132 nodeMaxClockSkew = 150
1134 -- | Time for an intra-cluster disk transfer to wait for a connection
1135 diskTransferConnectTimeout :: Int
1136 diskTransferConnectTimeout = 60
1138 -- | Disk index separator
1139 diskSeparator :: String
1140 diskSeparator = AutoConf.diskSeparator
1142 ipCommandPath :: String
1143 ipCommandPath = AutoConf.ipPath
1145 -- | Key for job IDs in opcode result
1149 -- * Runparts results
1160 runpartsStatus :: [Int]
1161 runpartsStatus = [runpartsErr, runpartsRun, runpartsSkip]
1165 rpcEncodingNone :: Int
1168 rpcEncodingZlibBase64 :: Int
1169 rpcEncodingZlibBase64 = 1
1173 -- Various time constants for the timeout table
1176 rpcTmoUrgent = Types.rpcTimeoutToRaw Urgent
1179 rpcTmoFast = Types.rpcTimeoutToRaw Fast
1182 rpcTmoNormal = Types.rpcTimeoutToRaw Normal
1185 rpcTmoSlow = Types.rpcTimeoutToRaw Slow
1187 -- | 'rpcTmo_4hrs' contains an underscore to circumvent a limitation
1188 -- in the 'Ganeti.THH.deCamelCase' function and generate the correct
1191 rpcTmo_4hrs = Types.rpcTimeoutToRaw FourHours
1193 -- | 'rpcTmo_1day' contains an underscore to circumvent a limitation
1194 -- in the 'Ganeti.THH.deCamelCase' function and generate the correct
1197 rpcTmo_1day = Types.rpcTimeoutToRaw OneDay
1199 -- | Timeout for connecting to nodes (seconds)
1200 rpcConnectTimeout :: Int
1201 rpcConnectTimeout = 5
1205 osScriptCreate :: String
1206 osScriptCreate = "create"
1208 osScriptExport :: String
1209 osScriptExport = "export"
1211 osScriptImport :: String
1212 osScriptImport = "import"
1214 osScriptRename :: String
1215 osScriptRename = "rename"
1217 osScriptVerify :: String
1218 osScriptVerify = "verify"
1220 osScripts :: [String]
1221 osScripts = [osScriptCreate, osScriptExport, osScriptImport, osScriptRename,
1225 osApiFile = "ganeti_api_version"
1227 osVariantsFile :: String
1228 osVariantsFile = "variants.list"
1230 osParametersFile :: String
1231 osParametersFile = "parameters.list"
1233 osValidateParameters :: String
1234 osValidateParameters = "parameters"
1236 osValidateCalls :: FrozenSet String
1237 osValidateCalls = ConstantUtils.mkSet [osValidateParameters]
1239 -- | External Storage (ES) related constants
1241 esActionAttach :: String
1242 esActionAttach = "attach"
1244 esActionCreate :: String
1245 esActionCreate = "create"
1247 esActionDetach :: String
1248 esActionDetach = "detach"
1250 esActionGrow :: String
1251 esActionGrow = "grow"
1253 esActionRemove :: String
1254 esActionRemove = "remove"
1256 esActionSetinfo :: String
1257 esActionSetinfo = "setinfo"
1259 esActionVerify :: String
1260 esActionVerify = "verify"
1262 esScriptCreate :: String
1263 esScriptCreate = esActionCreate
1265 esScriptRemove :: String
1266 esScriptRemove = esActionRemove
1268 esScriptGrow :: String
1269 esScriptGrow = esActionGrow
1271 esScriptAttach :: String
1272 esScriptAttach = esActionAttach
1274 esScriptDetach :: String
1275 esScriptDetach = esActionDetach
1277 esScriptSetinfo :: String
1278 esScriptSetinfo = esActionSetinfo
1280 esScriptVerify :: String
1281 esScriptVerify = esActionVerify
1283 esScripts :: FrozenSet String
1285 ConstantUtils.mkSet [esScriptAttach,
1293 esParametersFile :: String
1294 esParametersFile = "parameters.list"
1298 instanceRebootSoft :: String
1299 instanceRebootSoft = Types.rebootTypeToRaw RebootSoft
1301 instanceRebootHard :: String
1302 instanceRebootHard = Types.rebootTypeToRaw RebootHard
1304 instanceRebootFull :: String
1305 instanceRebootFull = Types.rebootTypeToRaw RebootFull
1307 rebootTypes :: FrozenSet String
1308 rebootTypes = ConstantUtils.mkSet $ map Types.rebootTypeToRaw [minBound..]
1310 -- * Instance reboot behaviors
1312 instanceRebootAllowed :: String
1313 instanceRebootAllowed = "reboot"
1315 instanceRebootExit :: String
1316 instanceRebootExit = "exit"
1318 rebootBehaviors :: [String]
1319 rebootBehaviors = [instanceRebootAllowed, instanceRebootExit]
1324 vtypeBool = VTypeBool
1329 vtypeMaybeString :: VType
1330 vtypeMaybeString = VTypeMaybeString
1334 vtypeSize = VTypeSize
1336 vtypeString :: VType
1337 vtypeString = VTypeString
1339 enforceableTypes :: FrozenSet VType
1340 enforceableTypes = ConstantUtils.mkSet [minBound..]
1342 -- | Constant representing that the user does not specify any IP version
1343 ifaceNoIpVersionSpecified :: Int
1344 ifaceNoIpVersionSpecified = 0
1346 validSerialSpeeds :: [Int]
1367 -- * HV parameter names (global namespace)
1372 hvBlockdevPrefix :: String
1373 hvBlockdevPrefix = "blockdev_prefix"
1375 hvBootloaderArgs :: String
1376 hvBootloaderArgs = "bootloader_args"
1378 hvBootloaderPath :: String
1379 hvBootloaderPath = "bootloader_path"
1381 hvBootOrder :: String
1382 hvBootOrder = "boot_order"
1384 hvCdromImagePath :: String
1385 hvCdromImagePath = "cdrom_image_path"
1388 hvCpuCap = "cpu_cap"
1390 hvCpuCores :: String
1391 hvCpuCores = "cpu_cores"
1394 hvCpuMask = "cpu_mask"
1396 hvCpuSockets :: String
1397 hvCpuSockets = "cpu_sockets"
1399 hvCpuThreads :: String
1400 hvCpuThreads = "cpu_threads"
1403 hvCpuType = "cpu_type"
1405 hvCpuWeight :: String
1406 hvCpuWeight = "cpu_weight"
1408 hvDeviceModel :: String
1409 hvDeviceModel = "device_model"
1411 hvDiskCache :: String
1412 hvDiskCache = "disk_cache"
1414 hvDiskType :: String
1415 hvDiskType = "disk_type"
1417 hvInitrdPath :: String
1418 hvInitrdPath = "initrd_path"
1420 hvInitScript :: String
1421 hvInitScript = "init_script"
1423 hvKernelArgs :: String
1424 hvKernelArgs = "kernel_args"
1426 hvKernelPath :: String
1427 hvKernelPath = "kernel_path"
1432 hvKvmCdrom2ImagePath :: String
1433 hvKvmCdrom2ImagePath = "cdrom2_image_path"
1435 hvKvmCdromDiskType :: String
1436 hvKvmCdromDiskType = "cdrom_disk_type"
1438 hvKvmExtra :: String
1439 hvKvmExtra = "kvm_extra"
1442 hvKvmFlag = "kvm_flag"
1444 hvKvmFloppyImagePath :: String
1445 hvKvmFloppyImagePath = "floppy_image_path"
1447 hvKvmMachineVersion :: String
1448 hvKvmMachineVersion = "machine_version"
1451 hvKvmPath = "kvm_path"
1453 hvKvmSpiceAudioCompr :: String
1454 hvKvmSpiceAudioCompr = "spice_playback_compression"
1456 hvKvmSpiceBind :: String
1457 hvKvmSpiceBind = "spice_bind"
1459 hvKvmSpiceIpVersion :: String
1460 hvKvmSpiceIpVersion = "spice_ip_version"
1462 hvKvmSpiceJpegImgCompr :: String
1463 hvKvmSpiceJpegImgCompr = "spice_jpeg_wan_compression"
1465 hvKvmSpiceLosslessImgCompr :: String
1466 hvKvmSpiceLosslessImgCompr = "spice_image_compression"
1468 hvKvmSpicePasswordFile :: String
1469 hvKvmSpicePasswordFile = "spice_password_file"
1471 hvKvmSpiceStreamingVideoDetection :: String
1472 hvKvmSpiceStreamingVideoDetection = "spice_streaming_video"
1474 hvKvmSpiceTlsCiphers :: String
1475 hvKvmSpiceTlsCiphers = "spice_tls_ciphers"
1477 hvKvmSpiceUseTls :: String
1478 hvKvmSpiceUseTls = "spice_use_tls"
1480 hvKvmSpiceUseVdagent :: String
1481 hvKvmSpiceUseVdagent = "spice_use_vdagent"
1483 hvKvmSpiceZlibGlzImgCompr :: String
1484 hvKvmSpiceZlibGlzImgCompr = "spice_zlib_glz_wan_compression"
1486 hvKvmUseChroot :: String
1487 hvKvmUseChroot = "use_chroot"
1490 hvMemPath = "mem_path"
1492 hvMigrationBandwidth :: String
1493 hvMigrationBandwidth = "migration_bandwidth"
1495 hvMigrationDowntime :: String
1496 hvMigrationDowntime = "migration_downtime"
1498 hvMigrationMode :: String
1499 hvMigrationMode = "migration_mode"
1501 hvMigrationPort :: String
1502 hvMigrationPort = "migration_port"
1505 hvNicType = "nic_type"
1510 hvPassthrough :: String
1511 hvPassthrough = "pci_pass"
1513 hvRebootBehavior :: String
1514 hvRebootBehavior = "reboot_behavior"
1516 hvRootPath :: String
1517 hvRootPath = "root_path"
1519 hvSecurityDomain :: String
1520 hvSecurityDomain = "security_domain"
1522 hvSecurityModel :: String
1523 hvSecurityModel = "security_model"
1525 hvSerialConsole :: String
1526 hvSerialConsole = "serial_console"
1528 hvSerialSpeed :: String
1529 hvSerialSpeed = "serial_speed"
1532 hvSoundhw = "soundhw"
1534 hvUsbDevices :: String
1535 hvUsbDevices = "usb_devices"
1537 hvUsbMouse :: String
1538 hvUsbMouse = "usb_mouse"
1540 hvUseBootloader :: String
1541 hvUseBootloader = "use_bootloader"
1543 hvUseLocaltime :: String
1544 hvUseLocaltime = "use_localtime"
1549 hvVhostNet :: String
1550 hvVhostNet = "vhost_net"
1552 hvVifScript :: String
1553 hvVifScript = "vif_script"
1556 hvVifType = "vif_type"
1558 hvViridian :: String
1559 hvViridian = "viridian"
1561 hvVncBindAddress :: String
1562 hvVncBindAddress = "vnc_bind_address"
1564 hvVncPasswordFile :: String
1565 hvVncPasswordFile = "vnc_password_file"
1568 hvVncTls = "vnc_tls"
1571 hvVncX509 = "vnc_x509_path"
1573 hvVncX509Verify :: String
1574 hvVncX509Verify = "vnc_x509_verify"
1577 hvVnetHdr = "vnet_hdr"
1580 hvXenCmd = "xen_cmd"
1582 hvXenCpuid :: String
1583 hvXenCpuid = "cpuid"
1585 hvsParameterTitles :: Map String String
1586 hvsParameterTitles =
1589 (hvBootOrder, "Boot_order"),
1590 (hvCdromImagePath, "CDROM_image_path"),
1591 (hvCpuType, "cpu_type"),
1592 (hvDiskType, "Disk_type"),
1593 (hvInitrdPath, "Initrd_path"),
1594 (hvKernelPath, "Kernel_path"),
1595 (hvNicType, "NIC_type"),
1597 (hvPassthrough, "pci_pass"),
1598 (hvVncBindAddress, "VNC_bind_address")]
1602 -- FIXME: these should be associated with 'Ganeti.HTools.Types.ISpec'
1604 ispecMemSize :: String
1605 ispecMemSize = ConstantUtils.ispecMemSize
1607 ispecCpuCount :: String
1608 ispecCpuCount = ConstantUtils.ispecCpuCount
1610 ispecDiskCount :: String
1611 ispecDiskCount = ConstantUtils.ispecDiskCount
1613 ispecDiskSize :: String
1614 ispecDiskSize = ConstantUtils.ispecDiskSize
1616 ispecNicCount :: String
1617 ispecNicCount = ConstantUtils.ispecNicCount
1619 ispecSpindleUse :: String
1620 ispecSpindleUse = ConstantUtils.ispecSpindleUse
1622 ispecsParameterTypes :: Map String VType
1623 ispecsParameterTypes =
1625 [(ConstantUtils.ispecDiskSize, VTypeInt),
1626 (ConstantUtils.ispecCpuCount, VTypeInt),
1627 (ConstantUtils.ispecSpindleUse, VTypeInt),
1628 (ConstantUtils.ispecMemSize, VTypeInt),
1629 (ConstantUtils.ispecNicCount, VTypeInt),
1630 (ConstantUtils.ispecDiskCount, VTypeInt)]
1632 ispecsParameters :: FrozenSet String
1634 ConstantUtils.mkSet [ConstantUtils.ispecCpuCount,
1635 ConstantUtils.ispecDiskCount,
1636 ConstantUtils.ispecDiskSize,
1637 ConstantUtils.ispecMemSize,
1638 ConstantUtils.ispecNicCount,
1639 ConstantUtils.ispecSpindleUse]
1641 ispecsMinmax :: String
1642 ispecsMinmax = ConstantUtils.ispecsMinmax
1651 ispecsStd = ConstantUtils.ispecsStd
1653 ipolicyDts :: String
1654 ipolicyDts = ConstantUtils.ipolicyDts
1656 ipolicyVcpuRatio :: String
1657 ipolicyVcpuRatio = ConstantUtils.ipolicyVcpuRatio
1659 ipolicySpindleRatio :: String
1660 ipolicySpindleRatio = ConstantUtils.ipolicySpindleRatio
1662 ispecsMinmaxKeys :: FrozenSet String
1663 ispecsMinmaxKeys = ConstantUtils.mkSet [ispecsMax, ispecsMin]
1665 ipolicyParameters :: FrozenSet String
1667 ConstantUtils.mkSet [ConstantUtils.ipolicyVcpuRatio,
1668 ConstantUtils.ipolicySpindleRatio]
1670 ipolicyAllKeys :: FrozenSet String
1672 ConstantUtils.union ipolicyParameters $
1673 ConstantUtils.mkSet [ConstantUtils.ipolicyDts,
1674 ConstantUtils.ispecsMinmax,
1677 -- | Node parameter names
1679 ndExclusiveStorage :: String
1680 ndExclusiveStorage = "exclusive_storage"
1682 ndOobProgram :: String
1683 ndOobProgram = "oob_program"
1685 ndSpindleCount :: String
1686 ndSpindleCount = "spindle_count"
1692 ndOvsLink = "ovs_link"
1695 ndOvsName = "ovs_name"
1697 ndsParameterTypes :: Map String VType
1700 [(ndExclusiveStorage, VTypeBool),
1701 (ndOobProgram, VTypeString),
1703 (ndOvsLink, VTypeMaybeString),
1704 (ndOvsName, VTypeMaybeString),
1705 (ndSpindleCount, VTypeInt)]
1707 ndsParameters :: FrozenSet String
1708 ndsParameters = ConstantUtils.mkSet (Map.keys ndsParameterTypes)
1710 ndsParameterTitles :: Map String String
1711 ndsParameterTitles =
1713 [(ndExclusiveStorage, "ExclusiveStorage"),
1714 (ndOobProgram, "OutOfBandProgram"),
1715 (ndOvs, "OpenvSwitch"),
1716 (ndOvsLink, "OpenvSwitchLink"),
1717 (ndOvsName, "OpenvSwitchName"),
1718 (ndSpindleCount, "SpindleCount")]
1726 -- * OOB supported commands
1728 oobPowerOn :: String
1729 oobPowerOn = Types.oobCommandToRaw OobPowerOn
1731 oobPowerOff :: String
1732 oobPowerOff = Types.oobCommandToRaw OobPowerOff
1734 oobPowerCycle :: String
1735 oobPowerCycle = Types.oobCommandToRaw OobPowerCycle
1737 oobPowerStatus :: String
1738 oobPowerStatus = Types.oobCommandToRaw OobPowerStatus
1741 oobHealth = Types.oobCommandToRaw OobHealth
1743 oobCommands :: FrozenSet String
1744 oobCommands = ConstantUtils.mkSet $ map Types.oobCommandToRaw [minBound..]
1746 oobPowerStatusPowered :: String
1747 oobPowerStatusPowered = "powered"
1754 oobPowerDelay :: Double
1757 oobStatusCritical :: String
1758 oobStatusCritical = Types.oobStatusToRaw OobStatusCritical
1760 oobStatusOk :: String
1761 oobStatusOk = Types.oobStatusToRaw OobStatusOk
1763 oobStatusUnknown :: String
1764 oobStatusUnknown = Types.oobStatusToRaw OobStatusUnknown
1766 oobStatusWarning :: String
1767 oobStatusWarning = Types.oobStatusToRaw OobStatusWarning
1769 oobStatuses :: FrozenSet String
1770 oobStatuses = ConstantUtils.mkSet $ map Types.oobStatusToRaw [minBound..]
1772 -- * NIC_* constants are used inside the ganeti config
1783 nicModeBridged :: String
1784 nicModeBridged = Types.nICModeToRaw NMBridged
1786 nicModeRouted :: String
1787 nicModeRouted = Types.nICModeToRaw NMRouted
1789 nicModeOvs :: String
1790 nicModeOvs = Types.nICModeToRaw NMOvs
1793 nicIpPool = Types.nICModeToRaw NMPool
1795 nicValidModes :: FrozenSet String
1796 nicValidModes = ConstantUtils.mkSet $ map Types.nICModeToRaw [minBound..]
1798 -- * Hypervisor constants
1801 htXenPvm = Types.hypervisorToRaw XenPvm
1804 htFake = Types.hypervisorToRaw Fake
1807 htXenHvm = Types.hypervisorToRaw XenHvm
1810 htKvm = Types.hypervisorToRaw Kvm
1813 htChroot = Types.hypervisorToRaw Chroot
1816 htLxc = Types.hypervisorToRaw Lxc
1818 hyperTypes :: FrozenSet String
1819 hyperTypes = ConstantUtils.mkSet $ map Types.hypervisorToRaw [minBound..]
1821 htsReqPort :: FrozenSet String
1822 htsReqPort = ConstantUtils.mkSet [htXenHvm, htKvm]
1826 htMigrationLive :: String
1827 htMigrationLive = Types.migrationModeToRaw MigrationLive
1829 htMigrationNonlive :: String
1830 htMigrationNonlive = Types.migrationModeToRaw MigrationNonLive
1832 htMigrationModes :: FrozenSet String
1834 ConstantUtils.mkSet $ map Types.migrationModeToRaw [minBound..]
1836 -- * Cluster verify steps
1838 verifyNplusoneMem :: String
1839 verifyNplusoneMem = Types.verifyOptionalChecksToRaw VerifyNPlusOneMem
1841 verifyOptionalChecks :: FrozenSet String
1842 verifyOptionalChecks =
1843 ConstantUtils.mkSet $ map Types.verifyOptionalChecksToRaw [minBound..]
1845 -- * Cluster Verify error classes
1847 cvTcluster :: String
1848 cvTcluster = "cluster"
1856 cvTinstance :: String
1857 cvTinstance = "instance"
1859 -- * Cluster Verify error codes and documentation
1861 cvEclustercert :: (String, String, String)
1864 Types.cVErrorCodeToRaw CvECLUSTERCERT,
1865 "Cluster certificate files verification failure")
1867 cvEclustercfg :: (String, String, String)
1870 Types.cVErrorCodeToRaw CvECLUSTERCFG,
1871 "Cluster configuration verification failure")
1873 cvEclusterdanglinginst :: (String, String, String)
1874 cvEclusterdanglinginst =
1876 Types.cVErrorCodeToRaw CvECLUSTERDANGLINGINST,
1877 "Some instances have a non-existing primary node")
1879 cvEclusterdanglingnodes :: (String, String, String)
1880 cvEclusterdanglingnodes =
1882 Types.cVErrorCodeToRaw CvECLUSTERDANGLINGNODES,
1883 "Some nodes belong to non-existing groups")
1885 cvEclusterfilecheck :: (String, String, String)
1886 cvEclusterfilecheck =
1888 Types.cVErrorCodeToRaw CvECLUSTERFILECHECK,
1889 "Cluster configuration verification failure")
1891 cvEgroupdifferentpvsize :: (String, String, String)
1892 cvEgroupdifferentpvsize =
1894 Types.cVErrorCodeToRaw CvEGROUPDIFFERENTPVSIZE,
1895 "PVs in the group have different sizes")
1897 cvEinstancebadnode :: (String, String, String)
1898 cvEinstancebadnode =
1900 Types.cVErrorCodeToRaw CvEINSTANCEBADNODE,
1901 "Instance marked as running lives on an offline node")
1903 cvEinstancedown :: (String, String, String)
1906 Types.cVErrorCodeToRaw CvEINSTANCEDOWN,
1907 "Instance not running on its primary node")
1909 cvEinstancefaultydisk :: (String, String, String)
1910 cvEinstancefaultydisk =
1912 Types.cVErrorCodeToRaw CvEINSTANCEFAULTYDISK,
1913 "Impossible to retrieve status for a disk")
1915 cvEinstancelayout :: (String, String, String)
1918 Types.cVErrorCodeToRaw CvEINSTANCELAYOUT,
1919 "Instance has multiple secondary nodes")
1921 cvEinstancemissingcfgparameter :: (String, String, String)
1922 cvEinstancemissingcfgparameter =
1924 Types.cVErrorCodeToRaw CvEINSTANCEMISSINGCFGPARAMETER,
1925 "A configuration parameter for an instance is missing")
1927 cvEinstancemissingdisk :: (String, String, String)
1928 cvEinstancemissingdisk =
1930 Types.cVErrorCodeToRaw CvEINSTANCEMISSINGDISK,
1931 "Missing volume on an instance")
1933 cvEinstancepolicy :: (String, String, String)
1936 Types.cVErrorCodeToRaw CvEINSTANCEPOLICY,
1937 "Instance does not meet policy")
1939 cvEinstancesplitgroups :: (String, String, String)
1940 cvEinstancesplitgroups =
1942 Types.cVErrorCodeToRaw CvEINSTANCESPLITGROUPS,
1943 "Instance with primary and secondary nodes in different groups")
1945 cvEinstanceunsuitablenode :: (String, String, String)
1946 cvEinstanceunsuitablenode =
1948 Types.cVErrorCodeToRaw CvEINSTANCEUNSUITABLENODE,
1949 "Instance running on nodes that are not suitable for it")
1951 cvEinstancewrongnode :: (String, String, String)
1952 cvEinstancewrongnode =
1954 Types.cVErrorCodeToRaw CvEINSTANCEWRONGNODE,
1955 "Instance running on the wrong node")
1957 cvEnodedrbd :: (String, String, String)
1960 Types.cVErrorCodeToRaw CvENODEDRBD,
1961 "Error parsing the DRBD status file")
1963 cvEnodedrbdhelper :: (String, String, String)
1966 Types.cVErrorCodeToRaw CvENODEDRBDHELPER,
1967 "Error caused by the DRBD helper")
1969 cvEnodedrbdversion :: (String, String, String)
1970 cvEnodedrbdversion =
1972 Types.cVErrorCodeToRaw CvENODEDRBDVERSION,
1973 "DRBD version mismatch within a node group")
1975 cvEnodefilecheck :: (String, String, String)
1978 Types.cVErrorCodeToRaw CvENODEFILECHECK,
1979 "Error retrieving the checksum of the node files")
1981 cvEnodefilestoragepaths :: (String, String, String)
1982 cvEnodefilestoragepaths =
1984 Types.cVErrorCodeToRaw CvENODEFILESTORAGEPATHS,
1985 "Detected bad file storage paths")
1987 cvEnodefilestoragepathunusable :: (String, String, String)
1988 cvEnodefilestoragepathunusable =
1990 Types.cVErrorCodeToRaw CvENODEFILESTORAGEPATHUNUSABLE,
1991 "File storage path unusable")
1993 cvEnodehooks :: (String, String, String)
1996 Types.cVErrorCodeToRaw CvENODEHOOKS,
1997 "Communication failure in hooks execution")
1999 cvEnodehv :: (String, String, String)
2002 Types.cVErrorCodeToRaw CvENODEHV,
2003 "Hypervisor parameters verification failure")
2005 cvEnodelvm :: (String, String, String)
2008 Types.cVErrorCodeToRaw CvENODELVM,
2009 "LVM-related node error")
2011 cvEnoden1 :: (String, String, String)
2014 Types.cVErrorCodeToRaw CvENODEN1,
2015 "Not enough memory to accommodate instance failovers")
2017 cvEnodenet :: (String, String, String)
2020 Types.cVErrorCodeToRaw CvENODENET,
2021 "Network-related node error")
2023 cvEnodeoobpath :: (String, String, String)
2026 Types.cVErrorCodeToRaw CvENODEOOBPATH,
2027 "Invalid Out Of Band path")
2029 cvEnodeorphaninstance :: (String, String, String)
2030 cvEnodeorphaninstance =
2032 Types.cVErrorCodeToRaw CvENODEORPHANINSTANCE,
2033 "Unknown intance running on a node")
2035 cvEnodeorphanlv :: (String, String, String)
2038 Types.cVErrorCodeToRaw CvENODEORPHANLV,
2039 "Unknown LVM logical volume")
2041 cvEnodeos :: (String, String, String)
2044 Types.cVErrorCodeToRaw CvENODEOS,
2045 "OS-related node error")
2047 cvEnoderpc :: (String, String, String)
2050 Types.cVErrorCodeToRaw CvENODERPC,
2051 "Error during connection to the primary node of an instance")
2053 cvEnodesetup :: (String, String, String)
2056 Types.cVErrorCodeToRaw CvENODESETUP,
2059 cvEnodesharedfilestoragepathunusable :: (String, String, String)
2060 cvEnodesharedfilestoragepathunusable =
2062 Types.cVErrorCodeToRaw CvENODESHAREDFILESTORAGEPATHUNUSABLE,
2063 "Shared file storage path unusable")
2065 cvEnodessh :: (String, String, String)
2068 Types.cVErrorCodeToRaw CvENODESSH,
2069 "SSH-related node error")
2071 cvEnodetime :: (String, String, String)
2074 Types.cVErrorCodeToRaw CvENODETIME,
2075 "Node returned invalid time")
2077 cvEnodeuserscripts :: (String, String, String)
2078 cvEnodeuserscripts =
2080 Types.cVErrorCodeToRaw CvENODEUSERSCRIPTS,
2081 "User scripts not present or not executable")
2083 cvEnodeversion :: (String, String, String)
2086 Types.cVErrorCodeToRaw CvENODEVERSION,
2087 "Protocol version mismatch or Ganeti version mismatch")
2089 cvAllEcodes :: FrozenSet (String, String, String)
2094 cvEclusterdanglinginst,
2095 cvEclusterdanglingnodes,
2096 cvEclusterfilecheck,
2097 cvEgroupdifferentpvsize,
2100 cvEinstancefaultydisk,
2102 cvEinstancemissingcfgparameter,
2103 cvEinstancemissingdisk,
2105 cvEinstancesplitgroups,
2106 cvEinstanceunsuitablenode,
2107 cvEinstancewrongnode,
2112 cvEnodefilestoragepaths,
2113 cvEnodefilestoragepathunusable,
2120 cvEnodeorphaninstance,
2125 cvEnodesharedfilestoragepathunusable,
2131 cvAllEcodesStrings :: FrozenSet String
2132 cvAllEcodesStrings =
2133 ConstantUtils.mkSet $ map Types.cVErrorCodeToRaw [minBound..]
2135 -- * Instance status
2137 inststAdmindown :: String
2138 inststAdmindown = Types.instanceStatusToRaw StatusDown
2140 inststAdminoffline :: String
2141 inststAdminoffline = Types.instanceStatusToRaw StatusOffline
2143 inststErrordown :: String
2144 inststErrordown = Types.instanceStatusToRaw ErrorDown
2146 inststErrorup :: String
2147 inststErrorup = Types.instanceStatusToRaw ErrorUp
2149 inststNodedown :: String
2150 inststNodedown = Types.instanceStatusToRaw NodeDown
2152 inststNodeoffline :: String
2153 inststNodeoffline = Types.instanceStatusToRaw NodeOffline
2155 inststRunning :: String
2156 inststRunning = Types.instanceStatusToRaw Running
2158 inststWrongnode :: String
2159 inststWrongnode = Types.instanceStatusToRaw WrongNode
2161 inststAll :: FrozenSet String
2162 inststAll = ConstantUtils.mkSet $ map Types.instanceStatusToRaw [minBound..]
2166 adminstDown :: String
2167 adminstDown = Types.adminStateToRaw AdminDown
2169 adminstOffline :: String
2170 adminstOffline = Types.adminStateToRaw AdminOffline
2173 adminstUp = Types.adminStateToRaw AdminUp
2175 adminstAll :: FrozenSet String
2176 adminstAll = ConstantUtils.mkSet $ map Types.adminStateToRaw [minBound..]
2181 nrDrained = Types.nodeRoleToRaw NRDrained
2184 nrMaster = Types.nodeRoleToRaw NRMaster
2186 nrMcandidate :: String
2187 nrMcandidate = Types.nodeRoleToRaw NRCandidate
2190 nrOffline = Types.nodeRoleToRaw NROffline
2193 nrRegular = Types.nodeRoleToRaw NRRegular
2195 nrAll :: FrozenSet String
2196 nrAll = ConstantUtils.mkSet $ map Types.nodeRoleToRaw [minBound..]
2198 -- * Allocator framework constants
2200 iallocatorVersion :: Int
2201 iallocatorVersion = 2
2203 iallocatorDirIn :: String
2204 iallocatorDirIn = Types.iAllocatorTestDirToRaw IAllocatorDirIn
2206 iallocatorDirOut :: String
2207 iallocatorDirOut = Types.iAllocatorTestDirToRaw IAllocatorDirOut
2209 validIallocatorDirections :: FrozenSet String
2210 validIallocatorDirections =
2211 ConstantUtils.mkSet $ map Types.iAllocatorTestDirToRaw [minBound..]
2213 iallocatorModeAlloc :: String
2214 iallocatorModeAlloc = Types.iAllocatorModeToRaw IAllocatorAlloc
2216 iallocatorModeChgGroup :: String
2217 iallocatorModeChgGroup = Types.iAllocatorModeToRaw IAllocatorChangeGroup
2219 iallocatorModeMultiAlloc :: String
2220 iallocatorModeMultiAlloc = Types.iAllocatorModeToRaw IAllocatorMultiAlloc
2222 iallocatorModeNodeEvac :: String
2223 iallocatorModeNodeEvac = Types.iAllocatorModeToRaw IAllocatorNodeEvac
2225 iallocatorModeReloc :: String
2226 iallocatorModeReloc = Types.iAllocatorModeToRaw IAllocatorReloc
2228 validIallocatorModes :: FrozenSet String
2229 validIallocatorModes =
2230 ConstantUtils.mkSet $ map Types.iAllocatorModeToRaw [minBound..]
2232 iallocatorSearchPath :: [String]
2233 iallocatorSearchPath = AutoConf.iallocatorSearchPath
2235 defaultIallocatorShortcut :: String
2236 defaultIallocatorShortcut = "."
2238 -- * Node evacuation
2240 nodeEvacPri :: String
2241 nodeEvacPri = Types.evacModeToRaw ChangePrimary
2243 nodeEvacSec :: String
2244 nodeEvacSec = Types.evacModeToRaw ChangeSecondary
2246 nodeEvacAll :: String
2247 nodeEvacAll = Types.evacModeToRaw ChangeAll
2249 nodeEvacModes :: FrozenSet String
2250 nodeEvacModes = ConstantUtils.mkSet $ map Types.evacModeToRaw [minBound..]
2254 jobStatusQueued :: String
2255 jobStatusQueued = Types.jobStatusToRaw JOB_STATUS_QUEUED
2257 jobStatusWaiting :: String
2258 jobStatusWaiting = Types.jobStatusToRaw JOB_STATUS_WAITING
2260 jobStatusCanceling :: String
2261 jobStatusCanceling = Types.jobStatusToRaw JOB_STATUS_CANCELING
2263 jobStatusRunning :: String
2264 jobStatusRunning = Types.jobStatusToRaw JOB_STATUS_RUNNING
2266 jobStatusCanceled :: String
2267 jobStatusCanceled = Types.jobStatusToRaw JOB_STATUS_CANCELED
2269 jobStatusSuccess :: String
2270 jobStatusSuccess = Types.jobStatusToRaw JOB_STATUS_SUCCESS
2272 jobStatusError :: String
2273 jobStatusError = Types.jobStatusToRaw JOB_STATUS_ERROR
2275 jobsPending :: FrozenSet String
2277 ConstantUtils.mkSet [jobStatusQueued, jobStatusWaiting, jobStatusCanceling]
2279 jobsFinalized :: FrozenSet String
2281 ConstantUtils.mkSet $ map Types.finalizedJobStatusToRaw [minBound..]
2283 jobStatusAll :: FrozenSet String
2284 jobStatusAll = ConstantUtils.mkSet $ map Types.jobStatusToRaw [minBound..]
2288 -- ** Not yet finalized opcodes
2290 opStatusCanceling :: String
2291 opStatusCanceling = "canceling"
2293 opStatusQueued :: String
2294 opStatusQueued = "queued"
2296 opStatusRunning :: String
2297 opStatusRunning = "running"
2299 opStatusWaiting :: String
2300 opStatusWaiting = "waiting"
2302 -- ** Finalized opcodes
2304 opStatusCanceled :: String
2305 opStatusCanceled = "canceled"
2307 opStatusError :: String
2308 opStatusError = "error"
2310 opStatusSuccess :: String
2311 opStatusSuccess = "success"
2313 opsFinalized :: FrozenSet String
2315 ConstantUtils.mkSet [opStatusCanceled, opStatusError, opStatusSuccess]
2317 -- * OpCode priority
2322 opPrioHighest :: Int
2326 opPrioLow = Types.opSubmitPriorityToRaw OpPrioLow
2329 opPrioNormal = Types.opSubmitPriorityToRaw OpPrioNormal
2332 opPrioHigh = Types.opSubmitPriorityToRaw OpPrioHigh
2334 opPrioSubmitValid :: FrozenSet Int
2335 opPrioSubmitValid = ConstantUtils.mkSet [opPrioLow, opPrioNormal, opPrioHigh]
2337 opPrioDefault :: Int
2338 opPrioDefault = opPrioNormal
2340 -- * Execution log types
2342 elogMessage :: String
2343 elogMessage = Types.eLogTypeToRaw ELogMessage
2345 elogRemoteImport :: String
2346 elogRemoteImport = Types.eLogTypeToRaw ELogRemoteImport
2348 elogJqueueTest :: String
2349 elogJqueueTest = Types.eLogTypeToRaw ELogJqueueTest
2353 confdProtocolVersion :: Int
2354 confdProtocolVersion = ConstantUtils.confdProtocolVersion
2356 -- Confd request type
2359 confdReqPing = Types.confdRequestTypeToRaw ReqPing
2361 confdReqNodeRoleByname :: Int
2362 confdReqNodeRoleByname = Types.confdRequestTypeToRaw ReqNodeRoleByName
2364 confdReqNodePipByInstanceIp :: Int
2365 confdReqNodePipByInstanceIp = Types.confdRequestTypeToRaw ReqNodePipByInstPip
2367 confdReqClusterMaster :: Int
2368 confdReqClusterMaster = Types.confdRequestTypeToRaw ReqClusterMaster
2370 confdReqNodePipList :: Int
2371 confdReqNodePipList = Types.confdRequestTypeToRaw ReqNodePipList
2373 confdReqMcPipList :: Int
2374 confdReqMcPipList = Types.confdRequestTypeToRaw ReqMcPipList
2376 confdReqInstancesIpsList :: Int
2377 confdReqInstancesIpsList = Types.confdRequestTypeToRaw ReqInstIpsList
2379 confdReqNodeDrbd :: Int
2380 confdReqNodeDrbd = Types.confdRequestTypeToRaw ReqNodeDrbd
2382 confdReqNodeInstances :: Int
2383 confdReqNodeInstances = Types.confdRequestTypeToRaw ReqNodeInstances
2385 confdReqs :: FrozenSet Int
2387 ConstantUtils.mkSet .
2388 map Types.confdRequestTypeToRaw $
2389 [minBound..] \\ [ReqNodeInstances]
2391 -- * Confd request type
2393 confdReqfieldName :: Int
2394 confdReqfieldName = Types.confdReqFieldToRaw ReqFieldName
2396 confdReqfieldIp :: Int
2397 confdReqfieldIp = Types.confdReqFieldToRaw ReqFieldIp
2399 confdReqfieldMnodePip :: Int
2400 confdReqfieldMnodePip = Types.confdReqFieldToRaw ReqFieldMNodePip
2402 -- * Confd repl status
2404 confdReplStatusOk :: Int
2405 confdReplStatusOk = Types.confdReplyStatusToRaw ReplyStatusOk
2407 confdReplStatusError :: Int
2408 confdReplStatusError = Types.confdReplyStatusToRaw ReplyStatusError
2410 confdReplStatusNotimplemented :: Int
2411 confdReplStatusNotimplemented = Types.confdReplyStatusToRaw ReplyStatusNotImpl
2413 confdReplStatuses :: FrozenSet Int
2415 ConstantUtils.mkSet $ map Types.confdReplyStatusToRaw [minBound..]
2417 -- * Confd node role
2419 confdNodeRoleMaster :: Int
2420 confdNodeRoleMaster = Types.confdNodeRoleToRaw NodeRoleMaster
2422 confdNodeRoleCandidate :: Int
2423 confdNodeRoleCandidate = Types.confdNodeRoleToRaw NodeRoleCandidate
2425 confdNodeRoleOffline :: Int
2426 confdNodeRoleOffline = Types.confdNodeRoleToRaw NodeRoleOffline
2428 confdNodeRoleDrained :: Int
2429 confdNodeRoleDrained = Types.confdNodeRoleToRaw NodeRoleDrained
2431 confdNodeRoleRegular :: Int
2432 confdNodeRoleRegular = Types.confdNodeRoleToRaw NodeRoleRegular
2434 -- * A few common errors for confd
2436 confdErrorUnknownEntry :: Int
2437 confdErrorUnknownEntry = Types.confdErrorTypeToRaw ConfdErrorUnknownEntry
2439 confdErrorInternal :: Int
2440 confdErrorInternal = Types.confdErrorTypeToRaw ConfdErrorInternal
2442 confdErrorArgument :: Int
2443 confdErrorArgument = Types.confdErrorTypeToRaw ConfdErrorArgument
2445 -- * Confd request query fields
2447 confdReqqLink :: String
2448 confdReqqLink = ConstantUtils.confdReqqLink
2450 confdReqqIp :: String
2451 confdReqqIp = ConstantUtils.confdReqqIp
2453 confdReqqIplist :: String
2454 confdReqqIplist = ConstantUtils.confdReqqIplist
2456 confdReqqFields :: String
2457 confdReqqFields = ConstantUtils.confdReqqFields
2459 -- | Each request is "salted" by the current timestamp.
2461 -- This constant decides how many seconds of skew to accept.
2463 -- TODO: make this a default and allow the value to be more
2465 confdMaxClockSkew :: Int
2466 confdMaxClockSkew = 2 * nodeMaxClockSkew
2468 -- | When we haven't reloaded the config for more than this amount of
2469 -- seconds, we force a test to see if inotify is betraying us. Using a
2470 -- prime number to ensure we get less chance of 'same wakeup' with
2472 confdConfigReloadTimeout :: Int
2473 confdConfigReloadTimeout = 17
2475 -- | If we receive more than one update in this amount of
2476 -- microseconds, we move to polling every RATELIMIT seconds, rather
2477 -- than relying on inotify, to be able to serve more requests.
2478 confdConfigReloadRatelimit :: Int
2479 confdConfigReloadRatelimit = 250000
2481 -- | Magic number prepended to all confd queries.
2483 -- This allows us to distinguish different types of confd protocols
2484 -- and handle them. For example by changing this we can move the whole
2485 -- payload to be compressed, or move away from json.
2486 confdMagicFourcc :: String
2487 confdMagicFourcc = "plj0"
2489 -- | By default a confd request is sent to the minimum between this
2490 -- number and all MCs. 6 was chosen because even in the case of a
2491 -- disastrous 50% response rate, we should have enough answers to be
2492 -- able to compare more than one.
2493 confdDefaultReqCoverage :: Int
2494 confdDefaultReqCoverage = 6
2496 -- | Timeout in seconds to expire pending query request in the confd
2497 -- client library. We don't actually expect any answer more than 10
2498 -- seconds after we sent a request.
2499 confdClientExpireTimeout :: Int
2500 confdClientExpireTimeout = 10
2502 -- * Possible values for NodeGroup.alloc_policy
2504 allocPolicyLastResort :: String
2505 allocPolicyLastResort = Types.allocPolicyToRaw AllocLastResort
2507 allocPolicyPreferred :: String
2508 allocPolicyPreferred = Types.allocPolicyToRaw AllocPreferred
2510 allocPolicyUnallocable :: String
2511 allocPolicyUnallocable = Types.allocPolicyToRaw AllocUnallocable
2513 validAllocPolicies :: [String]
2514 validAllocPolicies = map Types.allocPolicyToRaw [minBound..]
2516 -- | Temporary external/shared storage parameters
2517 blockdevDriverManual :: String
2518 blockdevDriverManual = Types.blockDriverToRaw BlockDrvManual
2520 -- | 'qemu-img' path, required for 'ovfconverter'
2521 qemuimgPath :: String
2522 qemuimgPath = AutoConf.qemuimgPath
2524 -- | Whether htools was enabled at compilation time
2526 -- FIXME: this should be moved next to the other enable constants,
2527 -- such as, 'enableConfd', and renamed to 'enableHtools'.
2529 htools = AutoConf.htools
2531 -- * Key files for SSH daemon
2533 sshHostDsaPriv :: String
2534 sshHostDsaPriv = sshConfigDir ++ "/ssh_host_dsa_key"
2536 sshHostDsaPub :: String
2537 sshHostDsaPub = sshHostDsaPriv ++ ".pub"
2539 sshHostRsaPriv :: String
2540 sshHostRsaPriv = sshConfigDir ++ "/ssh_host_rsa_key"
2542 sshHostRsaPub :: String
2543 sshHostRsaPub = sshHostRsaPriv ++ ".pub"
2545 -- | Path generating random UUID
2546 randomUuidFile :: String
2547 randomUuidFile = ConstantUtils.randomUuidFile
2549 -- * Auto-repair tag prefixes
2551 autoRepairTagPrefix :: String
2552 autoRepairTagPrefix = "ganeti:watcher:autorepair:"
2554 autoRepairTagEnabled :: String
2555 autoRepairTagEnabled = autoRepairTagPrefix
2557 autoRepairTagPending :: String
2558 autoRepairTagPending = autoRepairTagPrefix ++ "pending:"
2560 autoRepairTagResult :: String
2561 autoRepairTagResult = autoRepairTagPrefix ++ "result:"
2563 autoRepairTagSuspended :: String
2564 autoRepairTagSuspended = autoRepairTagPrefix ++ "suspend:"
2566 -- * Auto-repair levels
2568 autoRepairFailover :: String
2569 autoRepairFailover = "failover"
2571 autoRepairFixStorage :: String
2572 autoRepairFixStorage = "fix-storage"
2574 autoRepairMigrate :: String
2575 autoRepairMigrate = "migrate"
2577 autoRepairReinstall :: String
2578 autoRepairReinstall = "reinstall"
2580 autoRepairAllTypes :: FrozenSet String
2581 autoRepairAllTypes =
2582 ConstantUtils.mkSet [autoRepairFailover,
2583 autoRepairFixStorage,
2585 autoRepairReinstall]
2587 -- * Auto-repair results
2589 autoRepairEnoperm :: String
2590 autoRepairEnoperm = "enoperm"
2592 autoRepairFailure :: String
2593 autoRepairFailure = "failure"
2595 autoRepairSuccess :: String
2596 autoRepairSuccess = "success"
2598 autoRepairAllResults :: FrozenSet String
2599 autoRepairAllResults =
2600 ConstantUtils.mkSet [autoRepairEnoperm, autoRepairFailure, autoRepairSuccess]
2602 -- | The version identifier for builtin data collectors
2603 builtinDataCollectorVersion :: String
2604 builtinDataCollectorVersion = "B"
2606 -- | The reason trail opcode parameter name
2607 opcodeReason :: String
2608 opcodeReason = "reason"
2610 diskstatsFile :: String
2611 diskstatsFile = "/proc/diskstats"
2613 -- * CPU load collector
2616 statFile = "/proc/stat"
2618 cpuavgloadBufferSize :: Int
2619 cpuavgloadBufferSize = 150
2621 cpuavgloadWindowSize :: Int
2622 cpuavgloadWindowSize = 600
2624 -- | Mond's variable for periodical data collection
2625 mondTimeInterval :: Int
2626 mondTimeInterval = 5
2628 -- * Disk access modes
2630 diskUserspace :: String
2631 diskUserspace = Types.diskAccessModeToRaw DiskUserspace
2633 diskKernelspace :: String
2634 diskKernelspace = Types.diskAccessModeToRaw DiskKernelspace
2636 diskValidAccessModes :: FrozenSet String
2637 diskValidAccessModes =
2638 ConstantUtils.mkSet $ map Types.diskAccessModeToRaw [minBound..]
2640 -- | Timeout for queue draining in upgrades
2641 upgradeQueueDrainTimeout :: Int
2642 upgradeQueueDrainTimeout = 36 * 60 * 60 -- 1.5 days
2644 -- | Intervall at which the queue is polled during upgrades
2645 upgradeQueuePollInterval :: Int
2646 upgradeQueuePollInterval = 10