Safe HaskellSafe-Infered




Constants contains the Haskell constants

The constants in this module are used in Haskell and are also converted to Python.

Do not write any definitions in this file other than constants. Do not even write helper functions. The definitions in this module are automatically stripped to build the target hs. If there are helper functions in this module, they will also be dragged and it will cause compilation to fail. Therefore, all helper functions should go to a separate module and imported.


autoconf constants for Python only ('autotools/build-bash-completion')

htoolsProgs :: [String]Source

autoconf constants for Python only ('lib/')

autoconf constants for Python only ('lib/')

Build-time constants

exportDir :: StringSource

backupDir :: StringSource

osSearchPath :: [String]Source

esSearchPath :: [String]Source

toolsdir :: StringSource

Paths which don't change for a virtual cluster

pkglibdir :: StringSource

sharedir :: StringSource

autoconf constants for Python only ('lib/build/')

manPages :: Map String IntSource

autoconf constants for QA cluster only ('qa/')

autoconf constants for Python only ('tests/py/')

gntScripts :: [String]Source

Various versions

configRevision :: IntSource

The configuration is supposed to remain stable across revisions. Therefore, the revision number is cleared to '0'.

protocolVersion :: IntSource

Similarly to the configuration (see configRevision), the protocols are supposed to remain stable across revisions.

User separation

rapiUser :: StringSource

rapiGroup :: StringSource

confdUser :: StringSource

luxidUser :: StringSource

nodedUser :: StringSource

mondUser :: StringSource

mondGroup :: StringSource

Cpu pinning separators and constants

cpuPinningAllVal :: IntSource

Internal representation of all

cpuPinningOff :: [Int]Source

One all entry in a CPU list means CPU pinning is off

cpuPinningAllXen :: StringSource

A Xen-specific implementation detail is that there is no way to actually say use any cpu for pinning in a Xen configuration file, as opposed to the command line, where you can say xm vcpu-pin domain vcpu all

The workaround used in Xen is 0-63 (see source code function xm_vcpu_pin in xen-sourcetoolspythonxenxm/

To support future changes, the following constant is treated as a blackbox string that simply means use any cpu for pinning under xen.

cpuPinningAllKvm :: IntSource

A KVM-specific implementation detail - the following value is used to set CPU affinity to all processors (--0 through --31), per taskset man page.

FIXME: This only works for machines with up to 32 CPU cores


ddCmd :: StringSource


autoconf enable/disable

SSH constants

ssh :: StringSource

scp :: StringSource


confd :: StringSource

masterd :: StringSource

mond :: StringSource

noded :: StringSource

luxid :: StringSource

rapi :: StringSource

daemonsPorts :: Map String (Protocol, Int)Source

daemonsLogbase :: Map String StringSource

daemonsExtraLogbase :: Map String (Map String String)Source

Luxi (Local UniX Interface) related constants

luxiOverride :: StringSource

Environment variable for the luxi override socket


syslogNo :: StringSource

syslogYes :: StringSource


xenCmdXl :: StringSource

xenCmdXm :: StringSource

xenInitrd :: StringSource

xenKernel :: StringSource

KVM and socat

kvmPath :: StringSource

kvmKernel :: StringSource

socatPath :: StringSource

Console types

consMessage :: StringSource

Display a message for console access

consSpice :: StringSource

Console as SPICE server

consSsh :: StringSource

Console as SSH command

consVnc :: StringSource

Console as VNC server

rsaKeyBits :: IntSource

RSA key bit length

For RSA keys more bits are better, but they also make operations more expensive. NIST SP 800-131 recommends a minimum of 2048 bits from the year 2010 on.

opensslCiphers :: StringSource

Ciphers allowed for SSL connections.

For the format, see ciphers(1). A better way to disable ciphers would be to use the exclamation mark (!), but socat versions below 1.5 can't parse exclamation marks in options properly. When modifying the ciphers, ensure not to accidentially add something after it's been removed. Use the openssl utility to check the allowed ciphers, e.g. openssl ciphers -v HIGH:-DES.


x509CertCn :: StringSource

commonName (CN) used in certificates

x509CertDefaultValidity :: IntSource

Default validity of certificates in days

x509CertSignDigest :: StringSource

Digest used to sign certificates (openssl x509 uses SHA1 by default)

Import/export daemon mode

iemExport :: StringSource

iemImport :: StringSource

Import/export transport compression

iecGzip :: StringSource

iecNone :: StringSource

iecAll :: [String]Source

Importexport IO

ieioFile :: StringSource

Direct file IO, equivalent to a shell's IO redirection using < or >

ieioRawDisk :: StringSource

Raw block device I/O using dd

ieioScript :: StringSource

OS definition import/export script


valueAuto :: StringSource

valueNone :: StringSource

valueTrue :: StringSource


hooksPath :: StringSource

Hooks subject type (what object type does the LU deal with)

htypeNode :: StringSource


Storage types

stBlock :: StringSource

stExt :: StringSource

stFile :: StringSource

stLvmPv :: StringSource

stLvmVg :: StringSource

stRados :: StringSource

stsReport :: FrozenSet StringSource

The set of storage types for which storage reporting is available

FIXME: Remove this, once storage reporting is available for all types.

Storage fields

First two are valid in LU context only, not passed to backend

sfNode :: StringSource

sfType :: StringSource

and the rest are valid in backend

sfFree :: StringSource

sfName :: StringSource

sfSize :: StringSource

sfUsed :: StringSource

Storage operations

Volume fields

vfDev :: StringSource

vfName :: StringSource

vfNode :: StringSource

vfPhys :: StringSource

vfSize :: StringSource

vfVg :: StringSource

Local disk status

ldsNames :: Map Int StringSource

Disk template types

dtFile :: StringSource

dtPlain :: StringSource

dtBlock :: StringSource

dtDrbd8 :: StringSource

dtRbd :: StringSource

dtExt :: StringSource

diskTemplatePreference :: [String]Source

This is used to order determine the default disk template when the list of enabled disk templates is inferred from the current state of the cluster. This only happens on an upgrade from a version of Ganeti that did not support the enabled_disk_templates so far.

defaultEnabledDiskTemplates :: [String]Source

Disk templates that are enabled by default

mapDiskTemplateStorageType :: Map String StringSource

Mapping of disk templates to storage types

dtsIntMirror :: FrozenSet StringSource

The set of network-mirrored disk templates

dtsExtMirror :: FrozenSet StringSource

DTDiskless is trivially externally mirrored

dtsNotLvm :: FrozenSet StringSource

The set of non-lvm-based disk templates

dtsGrowable :: FrozenSet StringSource

The set of disk templates which can be grown

dtsMayAdopt :: FrozenSet StringSource

The set of disk templates that allow adoption

dtsMustAdopt :: FrozenSet StringSource

The set of disk templates that *must* use adoption

dtsMirrored :: FrozenSet StringSource

The set of disk templates that allow migrations

dtsFilebased :: FrozenSet StringSource

The set of file based disk templates

dtsCopyable :: FrozenSet StringSource

The set of disk templates that can be moved by copying

Note: a requirement is that they're not accessed externally or shared between nodes; in particular, sharedfile is not suitable.

dtsExclStorage :: FrozenSet StringSource

The set of disk templates that are supported by exclusive_storage

dtsNoFreeSpaceCheck :: FrozenSet StringSource

Templates for which we don't perform checks on free space

dtsLvm :: FrozenSet StringSource

The set of lvm-based disk templates


drbdMetaSize :: IntSource

Size of DRBD meta block device

Drbd barrier types

drbdBNone :: StringSource

drbdValidBarrierOpt :: FrozenSet (FrozenSet String)Source

Valid barrier combinations: n or any non-null subset of bfd

rbdCmd :: StringSource

Rbd tool command

File backend driver

fdBlktap :: StringSource

fdBlktap2 :: StringSource

fdLoop :: StringSource

fdDefault :: StringSource

dtsDrbd :: FrozenSet StringSource

The set of drbd-like disk types

Disk access mode

diskRdwr :: StringSource

Disk replacement mode

Instance export mode

Instance creation modes

Remote import/export handshake message and version

rieCertValidity :: IntSource

Remote import/export certificate validity (seconds)

rieConnectAttemptTimeout :: IntSource

Export only: how long to wait per connection attempt (seconds)

rieConnectRetries :: IntSource

Export only: number of attempts to connect

rieConnectTimeout :: IntSource

Overall timeout for establishing connection

childLingerTimeout :: DoubleSource

Give child process up to 5 seconds to exit after sending a signal

Import/export config options

Dynamic device modification

ddmAdd :: StringSource

ddmModify :: StringSource

ddmRemove :: StringSource

Common exit codes

exitConfirmation :: IntSource

Need user confirmation

exitUnknownField :: IntSource

Exit code for query operations with unknown fields


tagNode :: StringSource


classicDrbdSyncSpeed :: IntSource

60 MiBs, expressed in KiBs

defaultVg :: StringSource

defaultShutdownTimeout :: IntSource

Default maximum instance wait time (seconds)

nodeMaxClockSkew :: IntSource

Node clock skew (seconds)

diskTransferConnectTimeout :: IntSource

Time for an intra-cluster disk transfer to wait for a connection

diskSeparator :: StringSource

Disk index separator

jobIdsKey :: StringSource

Key for job IDs in opcode result

Runparts results


Timeout table

rpcTmo_4hrs :: IntSource

rpcTmo_4hrs contains an underscore to circumvent a limitation in the deCamelCase function and generate the correct Python name.

rpcTmo_1day :: IntSource

rpcTmo_1day contains an underscore to circumvent a limitation in the deCamelCase function and generate the correct Python name.

rpcConnectTimeout :: IntSource

Timeout for connecting to nodes (seconds)

osScripts :: [String]Source

osApiFile :: StringSource

esActionAttach :: StringSource

External Storage (ES) related constants

Reboot types

Instance reboot behaviors


vtypeSize :: VTypeSource

Size in MiBs

ifaceNoIpVersionSpecified :: IntSource

Constant representing that the user does not specify any IP version

HV parameter names (global namespace)

hvAcpi :: StringSource

hvCpuCap :: StringSource

hvCpuMask :: StringSource

hvCpuType :: StringSource

hvKeymap :: StringSource

hvKvmFlag :: StringSource

hvKvmPath :: StringSource

hvMemPath :: StringSource

hvNicType :: StringSource

hvPae :: StringSource

hvSoundhw :: StringSource

hvVga :: StringSource

hvVifType :: StringSource

hvVncTls :: StringSource

hvVncX509 :: StringSource

hvVnetHdr :: StringSource

hvXenCmd :: StringSource

hvsParameterTitles :: Map String StringSource

Migration statuses

hvKvmMigrationValidStatuses :: FrozenSet StringSource

KVM-specific statuses

FIXME: this constant seems unnecessary

hvNodeinfoKeyVersion :: StringSource

Node info keys

Hypervisor state

hvstDefaults :: Map String IntSource

Disk state

dsDefaults :: Map String IntSource

beMaxmem :: StringSource

beMemory :: StringSource

Deprecated and replaced by max and min mem

beMinmem :: StringSource

beVcpus :: StringSource

besParameterTitles :: Map String StringSource

ispecMemSize :: StringSource

Instance specs

FIXME: these should be associated with ISpec

ispecsMax :: StringSource

ispecsMin :: StringSource

ispecsStd :: StringSource

ndExclusiveStorage :: StringSource

Node parameter names

ndOvs :: StringSource

ndOvsLink :: StringSource

ndOvsName :: StringSource

ndsParameterTitles :: Map String StringSource

Logical Disks parameters

ldpAccess :: StringSource

ldpPool :: StringSource

diskLdTypes :: Map String VTypeSource

Disk template parameters

lvStripes :: StringSource

rbdAccess :: StringSource

rbdPool :: StringSource

diskDtTypes :: Map String VTypeSource

Dynamic disk parameters

ddpPort :: StringSource

OOB supported commands

oobHealth :: StringSource

oobTimeout :: IntSource

60 seconds

oobPowerDelay :: DoubleSource

2 seconds

ppDefault :: StringSource

Instance Parameters Profile

nic* constants are used inside the ganeti config

nicLink :: StringSource

nicMode :: StringSource

nicVlan :: StringSource

nicIpPool :: StringSource

idisk* constants are used in opcodes, to create/change disks

idiskMode :: StringSource

idiskName :: StringSource

idiskSize :: StringSource

idiskVg :: StringSource

inic* constants are used in opcodes, to create/change nics

inicIp :: StringSource

inicLink :: StringSource

inicMac :: StringSource

inicMode :: StringSource

inicName :: StringSource

inicVlan :: StringSource

Hypervisor constants

htXenPvm :: StringSource

htFake :: StringSource

htXenHvm :: StringSource

htKvm :: StringSource

htChroot :: StringSource

htLxc :: StringSource

NIC types

Vif types

htHvmVifIoemu :: StringSource

Default vif type in xen-hvm

Disk types

htDiskIde :: StringSource

htDiskMtd :: StringSource

htDiskSd :: StringSource

Mouse types

Boot order

htBoCdrom :: StringSource

htBoDisk :: StringSource

SPICE lossless image compression options

SPICE video stream detection

Security models

htSmNone :: StringSource

htSmPool :: StringSource

htSmUser :: StringSource

Kvm flag values

Migration type

Cluster verify steps

Cluster Verify error classes

cvTgroup :: StringSource

cvTnode :: StringSource

Cluster Verify error codes and documentation

cvEclustercert :: (String, String, String)Source

cvEclustercfg :: (String, String, String)Source

cvEclusterdanglinginst :: (String, String, String)Source

cvEclusterdanglingnodes :: (String, String, String)Source

cvEclusterfilecheck :: (String, String, String)Source

cvEgroupdifferentpvsize :: (String, String, String)Source

cvEinstancebadnode :: (String, String, String)Source

cvEinstancedown :: (String, String, String)Source

cvEinstancefaultydisk :: (String, String, String)Source

cvEinstancelayout :: (String, String, String)Source

cvEinstancemissingcfgparameter :: (String, String, String)Source

cvEinstancemissingdisk :: (String, String, String)Source

cvEinstancepolicy :: (String, String, String)Source

cvEinstancesplitgroups :: (String, String, String)Source

cvEinstanceunsuitablenode :: (String, String, String)Source

cvEinstancewrongnode :: (String, String, String)Source

cvEnodedrbd :: (String, String, String)Source

cvEnodedrbdhelper :: (String, String, String)Source

cvEnodedrbdversion :: (String, String, String)Source

cvEnodefilecheck :: (String, String, String)Source

cvEnodefilestoragepaths :: (String, String, String)Source

cvEnodefilestoragepathunusable :: (String, String, String)Source

cvEnodehooks :: (String, String, String)Source

cvEnodehv :: (String, String, String)Source

cvEnodelvm :: (String, String, String)Source

cvEnoden1 :: (String, String, String)Source

cvEnodenet :: (String, String, String)Source

cvEnodeoobpath :: (String, String, String)Source

cvEnodeorphaninstance :: (String, String, String)Source

cvEnodeorphanlv :: (String, String, String)Source

cvEnodeos :: (String, String, String)Source

cvEnoderpc :: (String, String, String)Source

cvEnodesetup :: (String, String, String)Source

cvEnodesharedfilestoragepathunusable :: (String, String, String)Source

cvEnodessh :: (String, String, String)Source

cvEnodetime :: (String, String, String)Source

cvEnodeuserscripts :: (String, String, String)Source

cvEnodeversion :: (String, String, String)Source

cvAllEcodes :: FrozenSet (String, String, String)Source

Node verify constants

nvBridges :: StringSource

nvHvinfo :: StringSource

nvLvlist :: StringSource

nvOslist :: StringSource

nvPvlist :: StringSource

nvTime :: StringSource

nvVersion :: StringSource

nvVglist :: StringSource

Instance status

Admin states

adminstUp :: StringSource

Node roles

nrDrained :: StringSource

nrMaster :: StringSource

nrOffline :: StringSource

nrRegular :: StringSource

SSL certificate check constants (in days)

Allocator framework constants

Node evacuation

Job queue

Unchanged job return

Job status

OpCode status

Not yet finalized opcodes

Finalized opcodes

OpCode priority

Lock recalculate mode

Lock timeout

Execution log types

etchosts modification

Job queue test

jqtExec :: StringSource

jqtLogmsg :: StringSource

Query resources

qrCluster :: StringSource

qrExport :: StringSource

qrGroup :: StringSource

qrJob :: StringSource

qrLock :: StringSource

qrNetwork :: StringSource

qrNode :: StringSource

qrOs :: StringSource

qrViaOp :: FrozenSet StringSource

List of resources which can be queried using OpQuery

qrViaLuxi :: FrozenSet StringSource

List of resources which can be queried using Local UniX Interface

qrViaRapi :: FrozenSet StringSource

List of resources which can be queried using RAPI

Query field types

qftBool :: StringSource

qftNumber :: StringSource

qftOther :: StringSource

qftText :: StringSource

qftUnit :: StringSource

Query result field status

rsNodata :: IntSource

No data (e.g. RPC error), can be used instead of rsOffline

rsOffline :: IntSource

Resource marked offline

rsUnavail :: IntSource

Value unavailable/unsupported for item; if this field is supported but we cannot get the data for the moment, rsNodata or rsOffline should be used

rssDescription :: Map Int (String, String)Source

Special field cases and their verbose/terse formatting

Max dynamic devices

ssconfFileprefix :: StringSource

SSCONF file prefix


ssUidPool :: StringSource

ssHvparamsPref :: StringSource

This is not a complete SSCONF key, but the prefix for the hypervisor keys

Hvparams keys

defaultEnabledHypervisor :: StringSource

Cluster wide default parameters

defaultDelayTarget :: IntSource

Default delay target measured in sectors

defaultFillTarget :: IntSource

Default fill target measured in sectors

defaultMinRate :: IntSource

Default mininum rate measured in KiB/s

defaultPlanAhead :: IntSource

Default plan ahead measured in sectors

The default values for the DRBD dynamic resync speed algorithm are taken from the drbsetup 8.3.11 man page, except for c-plan-ahead (that we don't need to set to 0, because we have a separate option to enable it) and for c-max-rate, that we cap to the default value for the static resync rate.

ispecsMinmaxDefaults :: Map String (Map String Int)Source

All of the following values are quite arbitrary - there are no good defaults, these must be customised per-site

Exclusive storage

partMargin :: DoubleSource

Error margin used to compare physical disks

partReserved :: DoubleSource

Space reserved when creating instance disks


Confd request type

Confd repl status

Confd node role

A few common errors for confd

Confd request query fields

confdMaxClockSkew :: IntSource

Each request is salted by the current timestamp.

This constant decides how many seconds of skew to accept.

TODO: make this a default and allow the value to be more configurable

confdConfigReloadTimeout :: IntSource

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.

confdConfigReloadRatelimit :: IntSource

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.

confdMagicFourcc :: StringSource

Magic number prepended to all confd queries.

This allows us to distinguish different types of confd protocols and handle them. For example by changing this we can move the whole payload to be compressed, or move away from json.

confdDefaultReqCoverage :: IntSource

By default a confd request is sent to the minimum between this number and all MCs. 6 was chosen because even in the case of a disastrous 50% response rate, we should have enough answers to be able to compare more than one.

confdClientExpireTimeout :: IntSource

Timeout in seconds to expire pending query request in the confd client library. We don't actually expect any answer more than 10 seconds after we sent a request.

maxUdpDataSize :: IntSource

Maximum UDP datagram size.

On IPv4: 64K - 20 (ip header size) - 8 (udp header size) = 65507 On IPv6: 64K - 40 (ip6 header size) - 8 (udp header size) = 65487 (assuming we can't use jumbo frames) We just set this to 60K, which should be enough

User-id pool minimum/maximum acceptable user-ids

uidpoolUidMax :: IntegerSource

Assuming 32 bit user-ids

pgrep :: StringSource

Name or path of the pgrep command

initialNodeGroupName :: StringSource

Name of the node group that gets created at cluster init or upgrade

Possible values for NodeGroup.alloc_policy

blockdevDriverManual :: StringSource

Temporary external/shared storage parameters

qemuimgPath :: StringSource

'qemu-img' path, required for ovfconverter

htools :: BoolSource

Whether htools was enabled at compilation time

FIXME: this should be moved next to the other enable constants, such as, enableConfd, and renamed to enableHtools.

iallocHail :: StringSource

The hail iallocator

Fake opcodes for functions that have hooks attached to them via

SSH key types

sshkDsa :: StringSource

sshkRsa :: StringSource

SSH authorized key types

sshakDss :: StringSource

sshakRsa :: StringSource

SSH setup

Key files for SSH daemon

sshDaemonKeyfiles :: Map String (String, String)Source

Node daemon setup

ndsSsconf :: StringSource

The source reasons for the execution of an OpCode

randomUuidFile :: StringSource

Path generating random UUID

Auto-repair tag prefixes

Auto-repair levels

Auto-repair results

builtinDataCollectorVersion :: StringSource

The version identifier for builtin data collectors

opcodeReason :: StringSource

The reason trail opcode parameter name

opcodeSequential :: StringSource

The reason trail opcode parameter name

CPU load collector

statFile :: StringSource

Monitoring daemon

mondTimeInterval :: IntSource

Mond's variable for periodical data collection

mondLatestApiVersion :: IntSource

Mond's latest API version

Disk access modes

upgradeQueueDrainTimeout :: IntSource

Timeout for queue draining in upgrades

upgradeQueuePollInterval :: IntSource

Intervall at which the queue is polled during upgrades

Hotplug Actions

Hotplug Device Targets

diskRemoveRetryTimeout :: IntSource

Timeout for disk removal (seconds)

diskRemoveRetryInterval :: IntSource

Interval between disk removal retries (seconds)

UUID regex

uuidRegex :: StringSource

Luxi constants

luxiWfjcTimeout :: IntSource

WaitForJobChange timeout

Query language constants

Logic operators with one or more operands, each of which is a

qlangOpOr :: StringSource

Unary operators with exactly one operand

Binary operators with exactly two operands, the field name and

qlangOpGe :: StringSource

qlangOpGt :: StringSource

qlangOpLe :: StringSource

qlangOpLt :: StringSource

qlangFilterDetectionChars :: FrozenSet StringSource

Characters used for detecting user-written filters (see L{_CheckFilter})

qlangGlobDetectionChars :: FrozenSet StringSource

Characters used to detect globbing filters

Error related constants

errorsEcodeEnviron :: StringSource

Environment error (e.g. node disk error)

errorsEcodeExists :: StringSource

Entity already exists

errorsEcodeFault :: StringSource

Internal cluster error

errorsEcodeInval :: StringSource

Wrong arguments (at syntax level)

errorsEcodeNoent :: StringSource

Entity not found

errorsEcodeNores :: StringSource

Not enough resources (iallocator failure, disk space, memory, etc)

errorsEcodeNotunique :: StringSource

Resource not unique (e.g. MAC or IP duplication)

errorsEcodeResolver :: StringSource

Resolver errors

errorsEcodeState :: StringSource

Wrong entity state

errorsEcodeTempNores :: StringSource

Temporarily out of resources; operation can be tried again

Jstore related constants