Add Haskell hypervisor instance state
Add 'InstanceState' datatype which is the Haskell counterpart of thePython type 'HvInstanceState'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Hrvoje Ribicic <riba@google.com>
Add Luxi Request to pick up a job in the queue
During the transition to the new daemon layout, from step 2onwards, luxid will write to the queue but masterd will triggerthe execution. Therefore, add a new luxi request to tell masterdto pick up a job that has already been written to the queue....
Add a test for hsqueeze expansion
In this example, there are 7 nodes, each with capacity for4 instances. Two nodes are online and host 4 instances each,thus forming a cluster with no free resources. Four additionalnodes a standby, and two additional node is offline for other...
hsqueeze: add a test for the -v option
This test also verifies that the master node isnot considered for being offlined.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Change default for target resource to 2.0
The target resources, as used by hsqueeze, are supposed tobe strictly higher than the minimal resources. However,keeping minimal resources of less than a single instanceis not a useful reserve.
Signed-off-by: Klaus Aehlig <aehlig@google.com>...
Merge branch 'stable-2.10' into master
Support import with compressed instance moves
Support compressing instance data while sending it to the target node oninstance imports.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Add local compression to OpBackupExport
OpBackupExport is extended by a compress parameter. This parameter(either 'none' or 'gzip') controls if instance disks are compressedbefore being sent over the network to the destination node.
Signed-off-by: Thomas Thrainer <thomasth@google.com>...
Add possibility to compress to OpInstanceMove
OpInstanceMove now supports the 'compress' option. It allows to enablecompression for intra-cluster instance moves.
Fix expectation of the htools wrapping
With the addition of hsqueeze, htools obtained a new personality.Additionally, the longer htool name also changes the line wrapping ofthe descriptions. Adapt the expectation accordingly.
Add test for hsqueeze compression
In this example cluster, there are 6 nodes withcapacity for 4 instances each, holding a totalof 8 instances. So even after turning off 2 nodesand rebalancing, every node still has capacity for2 instances.
Hotplug: client support
Add --hotplug option. Only used in OpInstanceSetParams.If this is omitted, modifications become effective after reboot.
Ask user confirmation in case NIC modify + hotplug because it willbe done via removing old NIC (and the corresponding tap) and adding...
Tests for InstanceInfo retrieval added
As the retrieval of instance information is a tricky operation whichaffects the way the instance status is calculated, a few tests havebeen added to ensure its behaviour remains constant.
Signed-off-by: Hrvoje Ribicic <riba@google.com>...
Add a console information RPC call
As the instance queries need console information, and the informationis retrieved through python classes that should not be ported yet, anRPC call supplying the information has been added. Some tests as well.
Add aliases of existing instance fields
For legacy reasons, some instance fields are aliased. The aliases havethe same definition but appear under different names. Support for suchfields has been added to Query/Common.hsAs aliases can cause somewhat harder to find bugs, a new test was...
Enable 'AllInstancesInfo' RPC call in Haskell
The AllInstancesInfo call appears to have been implemented but neverused. The commit makes it usable by modifying the parameter type andserialization.
Signed-off-by: Hrvoje Ribicic <riba@google.com>Reviewed-by: Jose A. Lopes <jabolopes@google.com>
Add test suite for some names in 'AutoConf'
Add test suite for some names in 'AutoConf' to test whether the valuesgenerated from 'configure' and the 'Makefile' are valid filepaths,user names, group names, among others. Fixes issue 601.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>...
Correct properties of the cluster's file storage dir
This patch does:- Rename the haskell opcode parameter 'pGlobalFileStorageDir' and 'pGlobalSharedfileStorageDir' to 'pClusterFileStorageDir' and 'pClusterSharedfileStorageDir', respectively, because...
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...
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...
Disable hlint camelcase on test module
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Jose Lopes <jabolopes@google.com>
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>
Haskell test modules contain functions which have names containingunderscore. Add hlint annotation to disable this check.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
HUnit test for 'buildVersion'
Add 'HUnit' test for 'buildVersion'.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
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...
Add shelltest for the --ignore-dynu option of hbal
In the example, we have two nodes and 6 instances, all using externalstorage. There are four small instances on one node, and two biginstances, requiring twice the amount of resources of a small instance,...
Haskell to Python constants: more constants
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 opcodes and parameters
Merge branch 'stable-2.9'
Merge branch 'stable-2.8' into stable-2.9
Remove TagObject
The 'TagObject' datatype became useless because it was replaced by'TagKind'. This patch removes 'TagObject', its 'Arbitrary' instance,and related functions.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
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
Eliminate Haskell constant for opcode names
Modify 'autotools/convert-constants' not to generate the Haskellconstant that holds all opcode names. By having Haskell generate thePython opcopdes, it becomes impossible to generate this constant dueto a cyclic dependency. However, this constant is used only in tests,...
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.
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 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>...
Remove obsolete autoconf variable from remaining files
This removes the obsolete autoconf variable'ENABLE_SHARED_FILE_STORAGE' from all remaining files.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Thomas Thrainer <thomasth@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...
Conflicts: src/Ganeti/Utils.hs (trivial)trivial
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Fix permission problem related to Issue 477
Commit 91525dee856951ace940c78b6254a1c7344b4803 fixed Issue 477 but broke"gnt-cluster info".
This commit offers a solution to both problems, by changing the permissionof the socket instead of changing the permission the confd process is run...
Rename queryd to luxid
As queryd will, in the future, handle all LUXI request, queue jobs andmost likely perform various other tasks, it is renamed to luxid already.This will safe some headache when upgrading Ganeti installations, as wedon't have to deal with a daemon rename....
Add queryd daemon (split from confd)
queryd is added as a new daemon which handles configuration queries overLUXI. This functionality was removed from confd, which now only queriesover the network.
The queryd user is added to the master group such that it can access...
Merge branch 'stable-2.8' into master
Merge branch 'stable-2.7' into stable-2.8
Conflicts:...
Remove file storage path from autoconf
This patch removes the option to configure the filestorage path at configure time, because it is nowreplaced by a runtime option for gnt-cluster init.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Allow modify_etc_hosts to be changed
The modify_etc_hosts options, enabling the cluster to modify the /etc/hostsfiles of nodes, and to keep them in sync, could only be set at cluster inittime.
With this commit it can now be changed through modify_etc_hosts as well....
Add luxiReqQueryNetworks to LuxiOp
When the QueryNetwork was introduced as a method, apparentlyit was forgotten in the Haskell world. Add it here as well.
Add support for querying network timestamps
Add creation and modified timestamps when creating a new network, andextend the available query fields for networks with these fields,namely 'ctime' and 'mtime'.
Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>...
Fix single-execution of Haskell tests and shelltests
Add Makefile.am target hs-test-% for single-execution of Haskelltests.
Add Makefile.am target hs-shell-% for single-execution of Haskellshelltests.
Update documentation on running individual tests....
Only generate node lists with nodes having different names
genNodeList is used in testing to generate list of nodesthat could come up in cluster configurations. Since namesare used to assign indices to nodes, they have to be unique;this is also the case in all real clusters....
Include "instance" information in LV data collector
This commit enables the logical volume data collector to get information aboutthe instances and to link it to the information about logical volumes.
The list of parameters accepted by the collector is expanded to allow proper...
Add "includeLogicalId" function for Disks
This function checks whether a disk contains a given Lvm logical ID,directly or through its children.
Unit tests are added as well.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Add "instance" field to LVInfo
Extend the LVInfo data structure with the field for storing the name ofthe instance it is paired with.
Update the tests accordingly.
Also remove prop_IterateAlloc_sane from test list
In f4d1bb7 that test was removed, but forgotten to remove itfrom the list of tests to be executed. Fix that.
Fix documentation for prop_Alloc_sane
As discussed in the last commit, placing a new instance on the clustercan lead to a cluster that can be improved by moving previously addedinstances. For an empty cluster, however, there are no previousinstances. So add this to the test description to make obvious why...
Remove IterateAllocSane test
The test is testing for a property that just isn't true. Iteratedallocation greedily place one instance at a time taking the locallymost balanced solution. Then it is tested whether the resulting globalallocation can be improved....
Turn 'exclusive_storage' into storage parameter (hs)
This is the haskell implementation of my patch "Extend RPC call'node_info' by storage parameters". It turns the 'exclusivestorage' flag into a storage parameter of the LVM storage types.Besides that, this patch moves some types into the Types.hs....
Add htools shell test for VCPU handling
This tests that VCPUs used by both instances and node OS are correctlyaccounted in allocation.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Load CPUs used by the node OS in htools
A new field is added to the Node type, and it's used to initialize the usedCPUs field.
The signature of Node.create has been split among lines to match theparameter list.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>...
Add tests for the LV data collector
This commit adds a few shelltests for the logical volume data collector.
Also, it performs some cleanup of the comments already present in the file:given that the number of the tests should be changed manually, and this is...
Add tests for LVs parser
Add unit tests and Quickcheck tests for the LV parser.
Also, fix the alphabetic order of some imports in htest.hs.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Add function testing parsers with QuickCheck
Parsing a string automatically generated by QuickCheck can be useful in manycases. A function for doing this is added to the common test functions.
Add function for generating arbitrary UUID
Add a function for generating arbitrary UUIDs to be used for QuickCheck tests.
Add test for the --full-evacuation option
In this example cluster, there are four pairs of nodes, each hostingtwo instances. Each node has disk capacity for an additional instance.Therefore, for normal online rolling reboots, there are two node groups,...
Index instances by their UUID
No longer index instances by their name but by their UUID in the clusterconfig. This change changes large parts of the code, as the followingadjustments were necessary: * Change the index key to UUID in the configuration and the...
Merge branch 'stable-2.8' into 'master'
Rename directory 'Block' to 'Storage'
This patch renames the 'Block' directory to 'Storage' inthe Haskell code base. The same rename was done in thepython code base earlier this quarter. We generalize thename, because we needed a place for general storage...
Add test for shrink heuristics over different resources
In this example, memory prevents adding more than one instance onthe first node. Yet, on the other nodes, 2 instances can be placedeach, if disks are shrunk appropriately. This, however, requiresto courageous decision to shrink disks next, even though more nodes...
Conflicts: (trival, take union of added files/tests) Makefile.am test/hs/shelltests/htools-hspace.test...
Add a test for hspace to respect instance policy
In this example, the instance policy for disks prevents allocationof more than one instance per node. The test verifies that tieredallocation still respects this and doesn't attempt to place policyviolating instances on the cluster....
Make shrinkByType aware of individual disks
When shrinking an instances, you can't just get smaller disk footprintwhile leaving the individual disks as they are. Make the shrinkheuristic aware of that fact, and decrease all individual disks aswell. Fixes issue 484....
Index nodes by their UUID
No longer index nodes by their name but by their UUID in the clusterconfig. This change changes large parts of the code, as the followingadjustments were necessary: * Change the index key to UUID in the configuration and the ConfigWriter, including all methods....
Add hvparams to RPC call 'node_info'
This patch adds the hvparams parameter to the RPC call'node_info'. It also adjusts the related code in noded.pyand Query/Node.hs
New tests for hspace and exclusive storage
hspace is run on clusters with exclusive storage enabled.
Spindles become part of htools resource spec
Spindles are now part of resource spec. Instances get created with spindlesspecified (which are just ignored when exclusive storage is disabled).
htools cluster score takes spindles into account
When exclusive storage is enabled, spindles are used instead of disk spaceto compute the cluster score.
Comments and variable names in computePDsk has been changed to match theactual code.
Update spindles when moving instances in htools
Spindles get updated, and errors raised when not enough free spindlesexist. No new error is raised when exclusive storage is disabled.
Unit tests included.
Unit tests for htools and exclusive storage
The existing tests are run also on nodes with exclusive storage enabled. Thevalues for spindles and exclusive storage are set in a consistent way, forboth nodes and instances.
Load node spindles data in htools
The data structure for nodes gets a new field for free spindles, and theexisting field for total spindles gets renamed to avoid identifying it withthe node parameter that had the same name. These fields get filled with...
Add a force option to the ClusterSetParams Opcode
If set, the op code will, in particular, try to set the master IPon the new netdev, even if shutting down the master IP on the oldnetdev failed.
Fix shadowing of library function
The "reads" field shadows a library function from Prelude. This commitfixes the problem.
Add shelltests for diskstats
Check that the behavior of running the diskstats data collector is asexpected.
Add unit tests for the Diskstats parser
Add one test parsing an actual /proc/diskstats file and one QuickChecktest.
Add function for generating arbitrary non-negative numbers
In many tests it is useful to have the possibility to easily generatenon-negative integer numbers.
Factor out and rename testFile function
The testFile function used in the DRBD parser test file can actually beuseful in any case where a parser has to be tested.
This patch moves it to the TestCommon file, and renames it to a more meaningfultestParser....
Fix erroneous docstring
Unit tests for spindles and exclusive storage in htools
Everything should work the same when exclusive storage is active, asspindles are not yet handled as a resource. A new test has been added forthe interactions between spindles and policies.
Check real spindles in ipolicies
When exclusive storage is enabled, the spindles in instance disks are usedto check the instance policies (as outlined in design-partitioned.rst).
Add spindles to instance disks in htools
A new data type is introduced for disks to store both size and spindles.When available, spindles are filled with input data. Except for loading andstoring, spindles are ignored.
Load exclusive_storage in htools
The node parameter is loaded into the data structures. No behavior is yetmodified.
New function to load JSON arrays of optional values
This will be needed to load spindles in some htools backends. Unit testsprovided.
Add unit test for text backend + fix bug
Test serialization and deserialization of instances. Fix check of secondarynode.
Test with non-redundant instances and several node-groups
The example cluster contains two node groups. The first contains three nodes,with two non-redundant instances each. As each node has only capacity for threeinstances, the nodes have to be rebooted individually. Additionally, there is...