Hs2Py constants: storage related groups
Add several groups of storage related constants to the Haskell to Python constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Hs2Py constants: add several groups of constants
Add several groups of constants, namely, console types, security, I/Ocompression, import/export, hooks, and hkr related, to the Haskell toPython constant generation.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>...
Hs2Py constants: add 2 more constants
Add 2 more constants to the Haskell to Python constant generation.
Hs2Py constants: add CPU pinning
Add CPU pinning constants to the Haskell to Python constantgeneration.
Hs2Py constants: add export versions
Add export version constants to the Haskell to Python constantgeneration.
Move VTypes to the appropriate place
Move 'VType' related constants to the appropriate place to matchPython's constants module.
Hs2Py constants: add SSH key files
Add SSH key file constants to the Haskell to Python constantgeneration.
Hs2Py constants: add network mirrored disk templates
Add network mirrored disk template constants to the Haskell to Pythonconstant generation.
Fix documentation comment
Fix documentation comment in 'Ganeti.ConstantUtils'.
Hs2Py constants: add Luxi constants
Add Luxi related constants to the Haskell to Python constantgeneration. A new Haskell type is added 'Ganeti.Types.PythonChar' towrap the Python character type.
Hs2Py constants: add 'fileDriver'
Add constant 'fileDriver' to the Haskell to Python constantgeneration. The constant 'FILE_DRIVER' is also moved to theappropriate place in 'lib/constants.py'.
Hs2Py constants: add local disk status
Add constants related to local disk status to the Haskell to Pythonconstant generation. A new Haskell type 'LocalDiskStatus' is addedsimilarly to the constants that have been added previously in otherHs2Py patches....
Hs2Py constants: constants related to 'Ganeti.Htools.Types'
Add constants related to the Haskell types defined in'Ganeti.Htools.Types' to the Haskell to Python constant generation.
Hs2Py constants: add node parameter related constants
Add node parameter related constants to the Haskell to Python constantgeneration. This patch also fixes a type inconsistency betweenHaskell and Python, namely, 'ndsParameterTypes' and'ndsParameterTitles' become 'Map's instead of 'Tuple's, which allows...
Hs2Py constants: add RPC timeout constants
Add RPC timeout related constants to the Haskell to Python constantgeneration. The Haskell data type 'RpcTimeout' is moved from'Ganeti.Rpc' to 'Ganeti.Types' so it can be used by'Ganeti.HsConstants' without causing circularity problems with...
Hs2Py constants: add 'ReplaceDisksMode' related constants
Add constants related to the Haskell type 'ReplaceDisksMode'. Thedata type declaration for 'ReplaceDisksMode' is also moved from'Ganeti.OpParams' to 'Ganeti.Types' because it used to be used only by...
Hs2Py constants: add 'osApiVersions'
Add constant 'osApiVersions' to the Haskell to Python constantgeneration. This patch fixes the type of this constant, by changingfrom 'List' to 'Set', therefore, 'Ganeti.Query.Server' is updatedaccordingly.
Fix indentation
Fix indentation in 'Ganeti.OpCodes'.
Fix typo in documentation
Fix typo in documentation in 'Ganeti.JSON'.
Hs2Py constants: add more constants
Add more constants to the Haskell to Python constant generation.
Hs2Py constants: add 'Ganeti.Confd' types
Hs2Py constants: add 'Ganeti.Confd' types.
Add 'declareILADT' to declare integer literal datatypes
Add 'declareILADT' to declare integer literal datatypes.
Update reference to proper module
Update reference to constant 'confdMagicFourcc' to fetch its valuefrom 'Ganeti.Constants' instead of the re-export from module'Ganeti.Confd.Types'.
Hs2Py constants: add confd requests
Add confd request related constants to the Haskell to Python constantgeneration.
Move confd request constants to 'Ganeti.ConstantUtils'
Provide the DIRVERSION as a constant
Depending on configure options, the version string used in the nameof the version specific directory differs. Provide this string alsoas a constant, as it is needed for the upgrade procedure, in order tobe able to roll back....
Provide time constants related to upgrades
During upgrades, gnt-cluster needs to wait for all jobsin the queue to finish. Provide constants for timeout andpolling interval.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Jose Lopes <jabolopes@google.com>
Provide means of submitting jobs to a drained queue
During an upgrade, the job queue needs to be drained in order to avoidnew jobs coming to the cluster. Nevertheless, the upgrade processneeds to carry out some maintenance, like redistributing the new...
Expose sharedir in pathutils
This path is needed to construct the link targetfor $(sysconfdir)/ganeti/share for a different version.The latter will happen in the automated upgrade procedure.
Also provide the program version
Conceptionally, the versions of the program, the protocols, and theconfiguration are three different things, even though, currently thereis a tight coupling. So export the version as well, as the upgradesare designed to make decisions based on the version....
Define 'access' disk-parameter type
Add the "access" parameter to the RBD configuration. Fix test brokenby this change.
Signed-off-by: Santi Raffa <rsanti@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Merge 'EvacNode' and 'NodeEvacMode'
Merge 'EvacMode' and 'NodeEvacMode' which are associated with theduplicated constants 'IALLOCATOR_NEVAC_*' and 'NODE_EVAC_*'. Thismerge moves the type 'EvacMode' to 'Ganeti.Types' in order to avoid acircular dependency between 'Ganeti.HsConstants' and...
Remove duplicate 'IALLOCATOR_NEVAC_*' constants
Constants 'IALLOCATOR_NEVAC_*' are duplicates of 'NODE_EVAC_*' and areno longer being used so they can be removed. Fixes issue 583.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Merge branch 'stable-2.9' into master
Add test for mond-data mock file
Test if the input file imported with the --mond-data option isparsed properly.
Signed-off-by: Spyros Trigazis <strigazi@gmail.com>Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Import MonD data from file
Implement functionality to import MonD data from a mock file toHTools (mainly for testing purposes) with the --mond-dataoption.
Signed-off-by: Spyros Trigazis <strigazi@gmail.com>Signed-off-by: Michele Tartara <mtartara@google.com>...
Implement readJSON functions for DC Types
Implement readJSON functions for DCCategory, DCVersion andDCKind in Data Collectors's Types to be parsable from a JSONformatted file. Also, implement a utility function tocapitalize the first character of a string....
Fetch data from MonD to HTools
Contact all MonDs from HTools to fetch data from its DataCollectors (only CPUload Data Collector is queried at themoment). This information is available to all HTools with the--mond option and can be ignored if the --ignore-dynu option is...
Add MonD's latest API Version in lib/constants.py
Extract the version number from MonD's own file into the constants file, so thatis can be accessed from other parts of the system as well (e.g.: to performqueries over the MonD protocol).
Signed-off-by: Spyros Trigazis <strigazi@gmail.com>...
Make the inst-status-xen collector more resilient
The data collectors should be able to provide as much information as possibleeven when the system is badly degraded. This patch modifies the instance statuscollector for xen so that it can keep providing as much data as possible, even...
Add 'generated from' comments in Hs2py constants
Modify Hs2Py constants to include a comment in the generated commentsdescribing the source of those constants. Fixes issue 588.
Merge branch 'stable-2.8' into stable-2.9
Signed-off-by: Klaus Aehlig <aehlig@google.com>...
Hs2Py constants: add remaining '_autoconf.*' constants
Add remaining constants which in Python are imported from thegenerated 'lib/_autoconf.py'. This will allow to completely removethis module.
Hs2Py constants: add all 'AutoConf' and related constants
Add all constants in 'AutoConf' to the Hs2Py constant generation and'socatEscapeCode' because it is part of the group containing'socatPath', 'socatUseCompress', and 'socatUseEscape'.
Add 'buildVersion' for calculating Ganeti versions
Add 'buildVersion' which calculates Ganeti versions and it is theHaskell counterpart of 'BuildVersion' in 'lib/constants.py'.
Hs2Py constants: add 'confd' related constants
Add 'confd' related constants to the Hs2Py constant generation.
Hs2Py constants: add some constants
Add 'opcodeReason', 'diskstatsFile', 'statFile', and'mondTimeInterval', to the Hs2Py constant generation.
Organize Haskell constants
Reorder Haskell constants to match the order in the Python constantsmodule 'lib/constants.py' to make it easier to debug/trace the Hs2Pyconstant migration process.
Remove physical_id field from disk object
The 'physical_id' field of disk objects is no longer used, so remove it.Also, all references are removed together with the code which made surethat the physical_id is up to date when transmitted over RPC.
Signed-off-by: Thomas Thrainer <thomasth@google.com>...
Hs2Py constants: add storage fields
Add storage fields constants to the Haskell to Python constantgeneration. These constants fetch their values from the Haskell datatype 'StorageField'.
Move 'StorageField' to 'Ganeti.Types'
Move 'StorageField' to 'Ganeti.Types' in order to break thecircularity of 'Ganeti.Rpc' and be able to generate constants fromthis Haskell data type.
Hs2Py constants: add constants from types
Add the constants to the Hs2Py constant generation from the Haskelldata types moved in the previous patch.
Move data types from 'Objects' to 'Types'
Move several Haskell data types from 'Ganeti.Objects' to'Ganeti.Types' in order to be able to generate constants whileavoiding module circularity.
Fix conflicting path values from 'configure'
Because the Hs2Py constant generation infrastructure is transitional,there are two generated 'autoconf' modules, namely, 'src/AutoConf.hs'and 'lib/_autoconf.py'. However, conflicting values were beinggenerated for Haskell and Python concerning the variables...
Fix constants for OOB commands
Fix values of the constants for OOB commands, namely, 'oobPowerOn' and'oobPowerCycle'.
Hs2Py constants: add constants from 'Ganeti.Types'
Add to Hs2Py constant generation all constants that are defined by theHaskell defined declared in 'Ganeti.Types'. This patch also fixes atype inconsistency between Haskell and Python, namely, the constant...
Fix alloc related constants value
Fix alloc related constants to fetch their value from the respectiveHaskell types, which are defined in 'Ganeti.Types'.
Add 'Ganeti.Types.OobStatus' for Hs2Py constants
Add 'Ganeti.Types.OobStatus' which is the Haskell counterpart to the'OOB_STATUS_*' Python constants.
Add 'PyValue' instance for triple
Add 'PyValue' instance for triple which is necessary for the'CvErrorCode' related constants.
Fetch 'randomUuidFile' from 'ConstantUtils'
In 'Ganeti.Utils', update the reference to 'randomUuidFile' to fetchthe value from 'Ganeti.ConstantUtils' instead of the Python to Haskellgenerated constant. This allows breaking the dependency of'Ganeti.Utils' on the constants module, which in turn will allow...
Fix indentation to match Haskell coding conventions.
Fix missing constructors to 'CvErrorCode'
Data type 'Ganeti.Types.CvErrorCode' is missing several constructors,namely, 'CvEINSTANCEUNSUITABLENODE', 'CvEGROUPDIFFERENTPVSIZE','CvENODEDRBDVERSION', and 'CvEINSTANCEMISSINGCFGPARAMETER'. Thisfixes issue 580....
Add constructor 'TagKindNetwork' to 'TagKind'
Add missing constructor 'TagKindNetwork' to 'Ganeti.Types.TagKind'which is the counterpart of the Python constant 'TAG_NETWORK'. Thisfixes issue 578.
Rename 'ExportModeRemove' to 'ExportModeRemote'
In "Ganeti.Types", rename constructor "ExportModeRemove" of"ExportMode" to "ExportModeRemote". This fixes issue 577.
Fix 'NICMode' missing 'NIC_IP_POOL'
Fix, in 'Ganeti.Types', data type 'NICMode', which is missing aconstructor which is the counterpart of the Python constant'NIC_IP_POOL'. This fixes issue 576.
Change all types in 'Types' to use String
Haskell types should be the source of information related toconstants. Therefore, instead of building the Haskell types from theconstants, the constants should be taken from the Haskell types. Thispatch updates all the types defined in 'Ganeti.Types' to follow this...
Add missing exports in 'Ganeti.Types'
Add missing exports in 'Ganeti.Types' which are necessary for'Ganeti.HsConstants'. These exports concern the '*ToRaw' functionswhich convert a Haskell type into JSON. These functions are needed bythe constants which we want to generate from Haskell to Python based...
Perform proper cleanup on termination of Haskell daemons
Haskell deamons did not perform proper cleanup at termination. There was no codefor removing the pid file, and the code in LuxiD for removing the unix socketfile was not working, because it is implemented with a "finally" statement,...
Hs2Py constants: add xen related constants
Add xen related constants, such as, 'xenBootloader' and 'xenCmdXm' tothe Haskell to Python constant generation.
Hs2Py constants: add 'devConsole' and syslog related
Add 'devConsole' and syslog related constants to the Haskell to Pythonconstant generation.
Add Template Haskell 'declareLADT'
Add 'declareLADT' in Template Haskell module to declare Haskelldatatypes using 'String's directly as values for the JSONserialization, as opposed to 'Name's which is what the current'declareADT' allows. To achieve this, 'genFromRaw' must be...
Haskell to Python constants: add exit code constants
Add exit code constants to Haskell to Python constant generationinfrastructure. The module 'Ganeti.ConstantUtils' must be importedqualified in order to avoid a clash between'Ganeti.ConstantUtils.exitFailure' and...
Haskell to Python constants: add 'daemonsLogbase'
Move constant 'DAEMONS_LOGBASE' from Python to Haskell to beautomatically generated.
Flip dependency between Haskell types and constants
Before this patch, Haskell types, such as, 'GanetiDaemon' and'GanetiGroup', and related functions were taking their values fromHaskell constants. However, given that the role of Haskell to Pythonconstants is to leverage Haskell and its typesystem, it makes sense to...
Replace import in 'Ganeti.Path'
Given that Haskell has its own generated 'AutoConf' module, it makessense that other Haskell modules import 'configure' variables directlyfrom 'AutoConf' instead of importing the Python to Haskell generatedconstants.
Fix monitoring daemon extra log filepaths
Haskell constants 'daemonsExtraLogfilesGanetiMondAccess' and'daemonsExtraLogfilesGanetiMondError' cannot be constants becausetheir Python counterparts are calculated through'pathutils.GetLogFilename', which indirectly depends on the...
Make CPUload Data Collector aware of clock ticks
Modify CPUload data collector to get the number of clock ticksper second from Posix.Unistd. Since CPUload collector convertsclock ticks (jiffies) to seconds and the clock ticks to secondsratio varies between linux distributions, it must be read from...
Make hbal support the option --ignore-dynu
This will allow to do balancing based only on static information.In particular, the effect of balancing towards same number ofinstances per node that the dynamic usage consideration hasif no usage file is provided, can be turned off, if this is...
Make ExtLoader honor the --ignore-dynu option
Make the external data loader correctly honor the --ignore-dynu optionby clearing the dynamic utilisation data from all instances if the optionis given.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Provide utility function to clear utilisation data
Using this utility function, the dynamic utilisation of all instancescan be set to 0. This will have the effect of all utilisation being ignored.
Define a new option --ignore-dynu
This option, if set, will tell htools to ignore any dynamicuse data.
Add 'daemonsPorts' and related constants
Add 'Protocol' datatype
Add 'Protocol' datatype which is necessary for the 'daemonsPorts'constant.
Fix instances of 'PyValue'
Fix instances of 'PyValue', namely, for tuples and maps.
Haskell to Python constants: more constants
Add user separation constants
Add user separation constants, such as, 'daemonsGroup', 'rapiGroup',and 'rapiUser', to the Haskell to Python constant generationinfrastructure.
Haskell to Python constants: add 'adminstAll'
Add constant 'adminstAll' to Haskell to Python constant generation.
Add 'FrozenSet'
Add type 'FrozenSet' that wrap a Haskell 'Set', and a guardedconstructor for this type and a 'PyValue' instance.
Fix module documentation
Fix 'Ganeti.Hs2Py.ListContants.hs.in' template module documentation towarn about automatic module generation.
Fix 'HsConstants' module documentation to warn about proper moduleusage.
Wrap 'Set' in 'ListSet' for the opcodes
In what Haskell to Python opcodes are concerned, a Haskell 'Set' istranslated into a Python 'list'. In other words, currently, opcodesthat handle sets of parameters are actually handling lists becausethis is how sets are currently encoded. This patch introduces a new...
Fix 'List' instance of 'PyValue'
Fix 'List' instance of 'PyValue' to properly convert Haskell lists toPython lists.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Mark the DSA host pubkey as optional
Commit a9542a4 introduced support for DSA SSH keys. However, the dsahostkeypubfield added to the config is not marked as optional in the Haskell components.As a result, luxid thinks the config file is corrupt and refuses to start. We...
Haskell to Python opcodes: fix Unit
Fix how Haskell to Python opcode generation handles unit. It seemsthat, in 'template-haskell-2.7.0', unit is represented by TemplateHaskell as a constructor of the form '(ConT name)', where 'name' isthe constructor name for 'Unit'. However, in 'template-haskell-2.8.0'...
Import original constants instead of generated
Haskell to Python constant generation introduced duplicated constantsin Haskell. This patch eliminates the duplication and fixes Haskellto import the correct constants, instead of the generated ones.
Setup constant generation infrastructure
Setup a transitional Haskell to Python constant generationinfrastructure. This infrastructure is transitional and Pythonconstants will not be migrated to Haskell all at once. Instead, someconstants will be incrementally pulled from Python and moved to...
Rename 'Constants.hs' to 'PyConstants.hs'
Rename the generated 'Constants.hs' module, which contains the Haskellconstants generated from Python, to 'PyConstants.hs' in order toeliminate duplicated constants in Haskell, a problem introduced by theHaskell to Python constant generation, and to circumvent a problem...