Fix lint errors in fix keyerrors patch
This patch fixes one lint error introduced by my recent patch tofix keyerrors in lib/cmdlib/node.py.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Fix example IPs and hostnames in tests
Our tests are a form of documentation, and hence should useIPs from the TEST-NET ranges according to RFC 5737. They definitelyshould not use real public IP addresses.
Similarly, example host names should be from one of the reserved...
Fix keyerrors in cmdlib node
This patch fixes potential key errors in the OpenvSwitch implementationin cmdlib/node.py. The checks in that file expected to have a ndparams dictwith certain keys to be present. This should not be the case as it willresult in KeyErrors when those keys are not present....
design update: symlink structure
Update the upgrade design document according to the outcomeof the design discussion at GanetiCon 2013. There are twochanges in the design.
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...
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,...
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 unit test for LUInstanceQuery and -QueryData
This patch provides rudimentary unit test coverage for LUInstanceQueryand LUInstanceQueryData.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Add unit tests for LUInstanceMigrate and -Failover
This patch adds rudimentary unit test coverage for LUInstanceMigrate andLUInstanceFailover.
Add unit tests for LUInstanceChangeGroup
This patch provides unit test coverage for LUInstanceChangeGroup.
Use RpcResult.Warn where appropriate
Those two occurrences of warnings can be replaced the RpcResult.Warnmethod, which is done in this patch.
Remove unneeded except block
The validation of the opcodes already checks the size parameter for theright type, so this except block is not required.
Rename variable to reflect its content
Rename the "node" variable to "node_uuid" as that's the content itactually receives.
Add unit tests for LUInstanceSetParams
This patch adds unit tests for LUInstanceSetParams. It does not provide100% coverage, but covers a significant portion.
Fix testMasterNetmask in TestLUClusterSetParams
The netmask was previously wrongly given as a bitmask, now it's given asthe net prefix length.
Fix missing dependency in 'src/hs2py-constants'
Fix target 'src/hs2py-constants' because it must depend on'src/AutoConf.hs'. Fixes issue 573.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Merge branch 'stable-2.9' into master
Update reference to Python constants
Update reference to 'DAEMONS_PORTS' and related constants that areused on the Haskell side to construct the 'daemonsPorts' constant.
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.
Update references to Python constants
Update references to the Python constants introduced by the previouspatch.
Haskell to Python constants: more constants
Merge branch 'stable-2.8' into stable-2.9
Make tools/users-setup explain its actions first
Before doing any changes, make tools/users-setup explain itsactions first, and ask the user for confirmation. If the firstargument is --yes-do-it, this step will be skipped.
Signed-off-by: Klaus Aehlig <aehlig@google.com>...
Generate tools/users-setup from descriptions
Now that we have a machine readable description of the usersto be added to the system, use it to generate the tools/users-setupscript, so that we again have only one authoritative source ofthe user and group requirements. This also has the advantage of...
Provide ganeti user and group data in easy-to-parse form
Upon build time, also generate, in the directory doc/users, filescontaining the groups, the users with their primary group, and theadditional groupmemberships to be added. In this way, packages can use...
Inconsistent auto repair related constant
In 'lib/constants.py', fix inconsistency in the value of'AUTO_REPAIR_TAG_SUSPENDED'. Fixes issue 569.
Update constant references
Update Python user separation constants to reference the generatedmodule 'lib/_constants.py' instead of 'lib/_autoconf.py'.
Add user separation constants
Add user separation constants, such as, 'daemonsGroup', 'rapiGroup',and 'rapiUser', to the Haskell to Python constant generationinfrastructure.
Add target 'AutoConf.hs'
Add Makefile target to generate 'AutoConf.hs' and add this file to'.gitignore'.
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'....
Also clean up top-level *.tix files
Haskell to Python constants: Update 'ADMINST_ALL' reference
Update constant 'ADMINST_ALL' to take its value from the generated'lib/_constants.py' module.
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 'lib/_constants.py.in' documentation to be consistent with othermodules.
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>
Replace literals with constants
In "lib/cmdlib/node.py", in lines 1315-1316, 1354, and 1359-1370,replace string literals with constants. Fixes issue 558.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Fix bridging in net-common
Bridging does not work correctly in net-common. The parameters passedby Ganeti are put in /var/run/ganeti/xen-hypervisor/nic/$domname/$devidand read again from there before running the setup functions accordingto the $MODE which is read from the file....
Remove dsahostkeypub during config downgrade
Remove the newly-added DSA host public key field from the configuration filewhen downgrading to 2.7, if present. Otherwise masterd will refuse to start.
Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.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...
Sync build_chroot with buildbot slack role
Keep the build_chroot script as similar as possible to the buildbot's slack rolefor squeeze.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Don't install dangling symlink for hail
hail is installed to the iallocators directory, not to the binarydirectory. Hence, if --enable-symlinks is given (the default), donot install a symbolic links there either.
Auto-upgrade of disks' config wrt LD-renaming
This patch adds auto-upgrade functionality to the diskobjects with respected to the switch from LD constantsto DT constants. Unit tests are provided.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
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.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>...
Update Python constants references to '_constants.py'
Update Python constants 'ADMINST_{DOWN,UP,OFFLINE}' to take theirvalues from the Haskell generated module 'lib/_constants.py'.
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....
Fix tests regarding DISK_LD_DEFAULTS
This fixes two remaining issues regarding the renamingof DISK_LD_DEFAULTS:
- The keys of the map DISK_LD_DEFAULTS cannot be comparedto DISK_TEMPLATES right away, because there are nodefaults for the diskless template. This patch adjusts...
Fixing renaming of DISK_LD_DEFAULTS
This fixes the somewhat over-eager renaming ofDISK_LD_DEFAULTS to DISK_DT_DEFAULTS, which clasheswith another occurence of DISK_DT_DEFAULTS. Thispatch just undoes the renaming and additionally fixesa test regarding shared file storage....
Fix documentation for gnt-node evacuate -p option
Update the documentation to remove the claim that the --primary-onlyoption results in data copies while in fact it only fails over/migratesthe all primary instances.
Signed-off-by: Leon Handreke <lhandreke@google.com>...
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...
QA: fix file storage QA wrt ipolicy
Ipolicy-allowed disk templates are now dependend on thecluster-wide enabled disk-templates. The QA for filestorage did not consider this updated logic so far.
Bump versions to release 2.9~beta1
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Add design-2.9 to docinput
While design-2.9.rst was already created earlier, itwasn't registered in the Makefile. Fix this.
Provide symlinks for all myexeclib_SCRIPTS
As we also install the nodist_myexeclib_SCRIPTS, we also need toprovide symbolic links for them if symlink installation is desired.
CLI: actually remove the --no-drbd-storage option
This removes the '--no-drbd-storage' option completelyfrom the command line interface. The hugepages designdoc still had a left-over reference to --no-lvm-storage,which is removed in this patch as well....
cluster init/modify: set helper without DRBD being enabled
The logic around the DRBD usermode helper so far was thatsetting it was only possible when DRDB was not explicitelydisabled. This patches changes it in a way that it isconsistent to how Ganeti handles the volume group name....
QA: adapt changes wrt DRBD usermode helper
This adjusts and extends the QA for 'gnt-cluster modify'with respect to the changes regarding the DRBDusermode helper.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
objects.py: upgrade config
Upgrading the config with respect to the DRBD usermodehelper was so far based on a guess whether or not DRBDis enabled by checking if there are any DRBD instancesrunning. This check can now be replaced to look at thelist of enabled disk templates in the cluster's...
cluster modify: deprecate --no-drbd-storage
As in the previous patch, the option '--no-drbd-storage'is deprectated, because it is subsumed by the non-inclusionof 'drbd' in the list of enabled disk templates.
Signed-off-by: Helga Velroyen <helgav@google.com>...
cluster init: deprecate --no-drbd-storage
Whether or not a particular type of storage is enabledor not is determined by the list of enabled disk templatesin the cluster's configuration. This makes the option'--no-drbd-storage' obsolete, because it is subsumed by...
cluster verify: check drbd helper only when drbd enabled
This change makes sure that 'gnt-cluster verify' onlychecks for the DRBD usermode helper, if DRBD is actuallyenabled.
cmdlib/cluster.py: unit tests for usermode helper
This patch factors out the functions that deal with settingand modifying the DRBD usermode helper in cluster.py inorder to make them more unittestable. The unit tests areprovided as well. No functional changes otherwise....
gnt_cluster.py: unit test for usermode helper
This patch factors out the functions in gnt_cluster(related to cluster init and cluster modify) whichdeal with setting / determining the drbd usermode helperto make them more testable. Unit tests for the extracted...
bootstrap.py: unit tests for setting the usermode helper
This patch factors out the function that checks the DRBDusermode helper in bootstrap (cluster init) in order to makeit more testable. It also contains the unit tests. Otherwise,no functional changes....
In the manpages, use unversioned paths
Ganeti now installs all its files into a version-specific directoryand only adds symbolic links at the canonical installation places.Nevertheless, make documentation, in particular man pages, still containthe old places, i.e., the places where the symbolic links are added....
Change versiondir to adhere the changed design
Change design to install to ${PREFIX}/lib/ganeti-${VERSION}
Even though the ${PREFIX}/opt/ only came into the design in the reviewprocess, it is not the best choice, as /opt is reserverd for manuallyinstalled software, but Ganeti intends to be packaged. Use ${libdir}...
NEWS update and version bump for 2.8 rc2
Latest modifications and fixes added to the NEWS file.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Simplify '_CheckOutputFields'
Function '_CheckOutputFields' was receiving three field sets, two ofwhich were simply being merged together. This was complicated andunnecessary. This patch simplifies '_CheckOutputFields' to takesimply two field sets....
Add 'SF_NODE' to 'VALID_STORAGE_FIELDS'
Constant 'SF_NODE' is a storage field and, therefore, should be in'VALID_STORAGE_FIELDS'. This patch fixes this and also reference tothese constants, namely, in 'cmdlib' and 'qa'.
Remove storage field duplication in 'qa'
QA was adding 'SF_TYPE' to a list containing all storage fields (i.e.,'VALID_STORAGE_FIELDS'). However, 'SF_TYPE' is already part of'VALID_STORAGE_FIELDS', which means this element was occurring twicein the list....
Update iallocator design to include MonD data
Add "MonD data" sub-section.
Signed-off-by: Spyros Trigazis <strigazi@gmail.com>Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Lint improvements to regexps
Fix some regular expressions so that they pass lint checks with newer versionsof pylint.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Add name for the Parameter ND_OVS
That was forgotten when the parameter was added.
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.
Add unit test for GetLinuxNodeInfo
The function was not unit tested previously.
Prepare GetLinuxNodeInfo for testing
The names of the input files are not hardcoded anymore, but they are now defaultparameters.
No changes for the callers, but it's now possible to test the function moreeasily.
Signed-off-by: Michele Tartara <mtartara@google.com>...
Add configure option on whether to install symlinks
As of Ganeti 2.10, all files are installed into a single, versionspecific, directory. In this way, several Ganeti versions can beinstalled in parallel. Appropriate symbolic links in the search pathwill be added by the Ganeti upgrade procedure. For the initial...
Move installation to a single Ganeti specific directory
As first step of implementing the new upgrade procedure (see designdocument), make Ganeti install all files into a single directory,$(prefix)/opt/Ganeti-$(VERSION). Symbolic links outside to this directory...
Check right disk template in inst set params
While checking the parameters of the opcode for LUInstanceSetParams, thealready set disk_template was checked instead of the new one in theopcode. This patch fixes this bug.
Signed-off-by: Thomas Thrainer <thomasth@google.com>...
Minor documentations fixed to gnt-node man page
Fix two grammatical errors in gnt-node man page
Documentation of new node parameters
This will add the new node parameters to the ganeti man page.
Add parameters for OpenvSwitch to gnt-node
Extend gnt-node by parameters for OpenvSwitch. --ovs Flag to enableOpenvSwitch, --ovs-name for the name of the OpenvSwitch and --ovs-linkfor the interface to connect to.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>...
Add RPC functionality for creating OpenvSwitches
This patches adds the needed RPC functions in order to create theOpenvSwitches on the nodes.
Add OpenvSwitch functionality to LUNodeAdd
This patch adds functionality to LUNodeAdd to - check the arguments given. It will warn if no physical link is given and fail if OpenvSwitch is not enabled, but parameters are given - call the RPC to configure OpenvSwitch on the node...
Backend: Create openvswitches on the nodes
This is the functionality to create the OpenvSwitches on the nodes.Parameters are given via opcode and checked as well as extended withthe defaults.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>Signed-off-by: Klaus Aehlig <aehlig@google.com>...
Add params for OpenvSwitch to ndparams
This patch introduces the needed fields for OpenvSwitch parametersinto ndparams and also provides the default values.
The parameters are:ND_OVS: boolean, to show whether OpenvSwitch is enabled or notND_OVS_NAME: the name of the OpenvSwitch to create...