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.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
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'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>...
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.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
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>...
Export VERSIONEDSHAREDIR to _autoconf.py
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Jose Lopes <jabolopes@google.com>
Fix 'AutoConf.hs.in' template substitution
Fix 'AutoConf.hs.in' template substitution, namely, change 'SOCAT' to'SOCAT_PATH' to match the value used in the invocation of 'm4' in thetarget 'src/AutoConf.hs' in 'Makefile.am'.
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
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...
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.
Merge branch 'stable-2.9' into master
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
Merge branch 'stable-2.8' into stable-2.9
Add user separation constants
Add user separation constants, such as, 'daemonsGroup', 'rapiGroup',and 'rapiUser', to the Haskell to Python constant generationinfrastructure.
Add AutoConf.hs.in
Add 'AutoConf.hs.in' which is the template for generating the file'AutoConf.hs'. This file mimics the Python equivalent'lib/_autoconf.py' and it is necessary for Haskell constants to beable to retrieve their values from 'configure'....
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...
Add Template Haskell code for constant generation
Add Template Haskell functions that generate a list in Haskellcontaining all the constants to be generated in Python. This list isan association list mapping the constant name to its Python value,which is stored as a string....
Move some 'PyValue' instances to a separate file
Move some 'PyValue' instances to a separate file so they can beavailable to other modules which need these instances but do not wantto depend on the constants module, which led to compilationconstraints....
Replace LD_* constants with DT_* constants
LD_* constants are basically like DT_* constants, exceptfor that both file and shared file were mapped to file.In order to not having to maintain three slightly differentsets of disk-related constants (DT, LD and ST), we merge...
Add new node parameters to Object.hs
In commit 807d8853, new node parameters were introduced in the python world.Add them to the haskell world as well to restore consistency.
Make the DRBD collector more failure-resilient
If information about instances is not available, just log the error andcontinue without it.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Add function to unwrap Results logging failures
Add logWarningIfBad, a utility function similar to exitIfBad, that logs awarning and returns a default value instead of just crashing the program ifthe unpacked value is Bad.
Signed-off-by: Michele Tartara <mtartara@google.com>...
disk_template param is optional in instance create
The disk_template parameter is optional during disk create (the firstenabled disk template is taken in this case), so don't require it.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Use FQDN to check master node status
The master node name in SS conf is stored as FQDN, so also use the FQDNon each node to check if it is the master node.
This fixes issue 551.
Fix opcodes and parameters
Merge branch 'stable-2.9'
Add hs2py program that generates Python opcodes
Add hs2py which is a Haskell program that uses the 'Hs2Py' module tooutput the actual Python opcode strings.
Generate Python opcodes from opcode descriptors
Add Haskell module Hs2Py which contains the helper functions thatgenerate the Python opcodes as strings from the Haskell opcodedescriptors produced by Template Haskell.
Remove TagType
By removing 'TagObject' in the previous patch, 'TagType' also becameuseless, since it was only used by 'TagObject'. This patch removes 'TagType'.
Remove TagObject
The 'TagObject' datatype became useless because it was replaced by'TagKind'. This patch removes 'TagObject', its 'Arbitrary' instance,and related functions.
Update Harep, Query server, and tests
Update Harep, Haskell query server, and tests concerning Luxi andopcodes to reflect the changes to Haskell to Python opcodegeneration. This change is necessary because TagObject is replaced byTagKind and some types in opcodes and parameters changed to be...
Add Python opcode generation
Add opcode documentation
Add Haskell module containing opcode documentation for all theopcodes.
Add Haskell types for opcodes and parameters
Add Haskell types for IP addresses (version 4 and 6), IP networkaddresses, tag kind, and query result code.
Support DSA SSH keys in bootstrap
As outlined in issue 338, Ganeti failed to initialize a cluster if noRSA SSH key is present on the master node. This patch extends Ganetissupport to DSA keys, so clusters with only DSA keys are possible now.
This fixes issue 338....
Include VCS version in `gnt-cluster version`
Also print the VCS version in the output of `gnt-cluster version`. Thismakes the VCS version also available over RAPI, etc.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
mond: Introduce a new threading mechanism
Change mond's interface in order to be able to call periodically thecollection functions of the data collectors that support suchfunctionality. The data of such a collector is stored in a map with thedata collector's name as the key....
Add CPUload collector
Introduce CPUload data collector as described in the correspondingdesign document. Add two data types in Datacollectors's Types.
Signed-off-by: Spyros Trigazis <strigazi@gmail.com>Signed-off-by: Michele Tartara <mtartara@google.com>...
Introduce LoadParser and Types for a new Collector
Introduce the Parser and Types for a new Data Collector.
Signed-off-by: Spyros Trigazis <strigazi@gmail.com>Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Factor out utility functions from DiskstatsP
Remove the utility functions from DiskstatsP and import them fromParsers. Also modify the parser implementation to a more readable form.
Add generic Parsers file
Extract the utility functions of Diskstats's collectorParser so other collector Parsers can be able to use them.
Add cleanup parameter to instance failover
Most of the code is shared with instance migrate, so we actually only needto add the parameter and pass its value along the the common code.
Also, tests and harep are updated to support the right set of options to...
gnt-cluster verify: consider shared file storage
This patch enhances 'gnt-cluster verify' in a way that itnow validates the acceptance and existance of the sharedstorage directory.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
gnt-cluster modify --shared-file-storage-dir
This patch introduces to 'gnt-cluster modify' the option'--shared-file-storage-dir' to change the default directoryfor instances using shared file storage at cluster runtime.
Signed-off-by: Helga Velroyen <helgav@google.com>...
Extend gnt-instance show to show vlan parameter
Extensions for "gnt-instance show" to output the vlan parameter whichwas introduced by my recent patch series.This is done by extending the nic object that is used to output theinfo. Every other occurrence of this object is adopted as well....
gnt-cluster {init, modify} --file-storage-dir
This patch implements consistent usage and behavior ofthe --file-storage-dir option in 'gnt-cluster init'and 'gnt-cluster modify'. It includes a bunch of unittests as well.
Additionally, it enables the previously written unit...
Remove extra whitespace
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Fix permission errors for split users
Correctly set ownership and permissions for daemon log files, correctthe name of the luxid logfile and set the ownership of the query socketcorrectly.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Conflicts: src/Ganeti/Utils.hs (trivial)trivial
Let ReqNodeInstances work with node UUIDs
The "primaryNode" and "secondaryNode" fields of "Instance" entities in thecluster configuration where changed to use UUIDs instead of names. TheReqNodeInstances query inside Confd was not upgraded yet, and was thus...