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>
Merge branch 'stable-2.9' into master
Design document for automatised upgrades
This design document describes how upgrade and downgradescan be made more automatic for future versions.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Merge branch 'stable-2.8' into stable-2.9
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Klaus Aehlig <aehlig@google.com>
Allow instance mods if only osparams are given
osparams are now recognized as changes, so changing only those withoutother changes works too now.
(cherry picked from commit 5eae613c2e1e65101c5d5f7d2e8ffd7cc6edc7d5)
Signed-off-by: Thomas Thrainer <thomasth@google.com>...
Use node UUIDs for locking instead of node names
LUInstanceMultiAlloc used node names instead of node UUIDs to lockrequired nodes. This patch fixes this bug.
Set pcre version to 0.94.4
Running 'make' in the chroot complains about pcre 0.94.4being required.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Fix a node name vs. UUID bug in instance import
This patch fixes a bug where node names were incorrectly used as nodeUUID's.
Typo in hroller man page
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Use node UUID for locking in LUInstanceMove
This LU (incorrectly) used the node name for locking. This patchcorrects this error.
Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Fix harep manpage title
The harep manpage title underline was one character short, leading inpandoc producing an invalid manpage header.
Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Add unit test for LUGroupVerifyDisks
This patch adds unit test coverage for LUGroupVerifyDisks.
Add unit test for LUGroupEvacuate
This patch adds unit test coverage for LUGroupEvacuate.
Add unit tests for LUGroupRename
This patch adds unit test coverage for LUGroupRename.
Add unit tests for LUGroupRemove
This patch adds unit test coverage for LUGroupRemove.
Add unit tests for LUGroupSetParams
This adds unit test coverage for LUGroupSetParams.
Add unit test for LUGroupQuery
Provide unit test coverage for LUGroupQuery.
Add unit tests for LUGroupAssignNodes
Add unit test coverage for LUGroupAssignNodes, including the splitinstances check.
Add unit tests for LUGroupAdd
Provide unit test coverage for LUGroupAdd.
Move TestLUGroupAssignNodes to group_unittest.py
While moving the test, it is adapted to the new test framework.
Fix IPolicy violation check in LUGroupSetParams
cfg.GetMultiInstanceInfoByName returns a list of tuples, not a list ofinstance objects which is required by ComputeNewInstanceViolations.This patch fixes this type error.
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.
Add test for LUClusterVerifyDisks
This LU only creates additional jobs as result, so this is a trivialunit test.
Extend unit tests for LUClusterVerifyGroup
- Add tests for additional Verify* methods- Converted test for VerifyFiles to the new test framework- Added possibility to prepare the LU in a test class before actually executing the test method with it
Revert "Display node name instead of UUID in error message"
This reverts commit fbff213691328562cc4029f3babaa2e72e2012c4.When running hooks, the node name is used to identify nodes, not (aswrongly assumed in the patch) the node UUID.
Display node name instead of UUID in error message
The hooks callback in LUClusterGroupVerify misinterpreted the key in thenode result as name instead of node UUID. This patch fixes this, whichleads to more user friendly error messages.
Use node name in error message
CheckNodeNotDrained displayed only the node UUID if the node is drained.In order to provide a more helpful error message, use the node nameinstead.
Remove duplicate argument from cabal install
network==2.3 is duplicate in cabal install. One occurrence can thus be removed.
Signed-off-by: Sebastian Gebhard <sege@fs.ei.tum.de>Reviewed-by: Guido Trotter <ultrotter@google.com>
Typo fix in lib/server/noded.py
QA: make ipolicy test respect enabled disk templates
This makes the 'gnt-cluster modify --ipolicy-*' testsrespect the enabled disk templates on the QA cluster.If the required disk templates are not enabled, thetest is skipped.
Signed-off-by: Helga Velroyen <helgav@google.com>...
QA: adjust tests wrt to ipolicy disk templates
This adjusts the cluster QA with respect to the new checksbetween the ipolicy disk templates and the enabled disktemplates.
ClusterSetParams: move vg-name checks from to CheckPrereq
This fixes a bug in the logic of 'gnt-cluster modify'.Some checks that should better be done in 'CheckPrereq'were actually done in 'Exec'. This lead to a strangebehavior in case the execution failed, because an...
man gnt-cluster: mention ipolicy check
This updates the 'gnt-cluster' man page to mention therelationship between the ipolicy's list of allowed disktemplates and the cluster-wide enabled-disk templates.
Update NEWS file regarding ipolicy checks
This patch updates the NEWS file to mention the new checksbetween the ipolicy's list of allowed disk tempaltes andthe cluster-wide enabled disk templates.
gnt-group add/modify: ipolicy vs disk templates
This patch adds a consistency check between the ipolicy'slist of allowed disk templates with the cluster-wideenable disk templates when a new node group is addedor a group is modified.
It also fixes a bug in gnt-group where the list of allowed...
Move Ipolicy utility function to cmdlib/common.py
Since the check of consistency between an ipolicy andthe list of enabled disk templates will not only beneeded on cluster modification, but also on groupmodification, we move the respective function and its...
bootstrap: restrict ipolicy to enabled disk templates
With this patch, on cluster creation, the initial instancepolicy's list of allowed disk templates will be modifiedin a way that it does not contain any disk templates whichare not enabled cluster-wise....
gnt-cluster modify: ipolicy vs enabled disk templates
This patch adds a check to LUClusterSetParams whichensures that the list of allowed disk templates is asubset of the list of cluster-wide enabled disktemplates. Unit tests are included.
gnt-cluster modify: factor out ipolicy check
This refactors the LUClusterSetParams to do all ipolicysanity / validity checks in a separate functionin order to increase testability. No function changesotherwise.
Disable pylint warning to fix build
The _CheckLUResult method gets overridden in a subclass which actuallyrequires the self parameter, so ignore the pylint remark about it.
Add possibility to access locked LU in tests
This features is useful to test (private) methods of LU's during tests,where those methods rely on the LU being completely initialized andlocking already performed.
An initial version of unit tests for LUClusterVerifyGroup makes use of...
Add test for LUClusterVerifyConfig
Add unit test covering LUClusterVerifyConfig.
Add test for LUClusterVerify
As this LU returns other jobs as result, submitting jobs from withinLU's is now mocked too.
Fix TINicParams type predicate
Change the value type of the 'TINicParams' dictionary predicate from'Maybe NonEmptyString' to 'Maybe String' to be compatible with theHaskell definition.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Generate text report of Haskell coverage
In order to generate a coverage graph, we generate also the coveragedata as text format. This eases parsing on Buildbot.
Fix opcodes and parameters
Add unit test for LUClusterRename
Also mock the netutils and ssh module in order to test all code paths.
Add unit test for LUClusterRepairDiskSizes
Also add build method for easy building of disk objects to the testframework.
Introduce shortcut properties for config objects
Some configuration objects are accessed quite often, so introduceshortcut properties for those.
Add unit test for LUClusterSetParams
Some changes to the test framework were performed while writing thistest: - Extended builder for disks - Introduced builder for NICs - Fixed bugs in RpcResultsBuilder
Add unit test for LUClusterPostInit
Also extract common assertion logic for hook invocations toCmdlibTestCase.
Add unit test for LUClusterQuery
Unit-test LUClusterQuery. Some changes in the mocked clusterconfiguration are made, because the configuration was not completelyvalid before.
Add unit test for LUClusterRedistConf
Unit-test LUClusterRedistConf. Given the simplicity of the LU, this unittest only exercises the LU code.
Use ConfigWriter.GetMasterNodeInfo() consistently
This shortcut method to get the node object of the master node directlymakes the code more readable and concise. Therefore, use it everywherewhere appropriate.
Add unit tests for LUClusterDestroy
This patch adds unit test for the LUClusterDestroy Logical Unit.
Move cmdlib-related unittests to cmdlib/
ganeti.cmdlib_unittest.py andganeti.cmdlib.instance_storage_unittest.py are moved to thetest/py/cmdlib directory. Also, they are renamed to match the names inthis module.
Additionally, instance_storage_unittest.py was added to the makefile, so...
Move cluster-related unittest to cluster_unittest
cmdlib_unittest should still be split further, but at least the clusterrelated tests are moved to the proper file yet.
Add unit tests for LUClusterConfigQuery
Also, proper initialization of the runtime architecture information wasadded.
Add unit test for LUClusterDeactivateMasterIp
This patch adds unit tests for the LUClusterDeactivateMasterIp LogicalUnit.
Add unit test for LUClusterActivateMasterIp
In order to properly assert the called RPC method, eq is implementedon ConfigObject as well.
Add unit test for LUTestAllocator
Additionally to adding unit tests for LUTestAllocator, the testframework was adapted for its requirements.
Remove unneeded checks
Those checks are already covered by the "types" in the opcodes, soremove them.
Enable pylint and PEP8 for test support code
The test support code is mainly written from scratch, so in order toensure to keep the code quality high, enable pylint and PEP8 checksfor it.
Due to some specialities of the test code, a dedicate pylintrc-test file...
Initial version of cmdlib test framework
The initial version of the cmdlib test framework is able to execute LU'swith the following components mocked:
A base test class is provided which makes it easy to execute opcodes and...
Install python mock using easy_install in chroot
We require a newer mock library, so install it using easy_install inchroot.
Require newer python mock library
Older Python mock libraries do not provide MagicMock, which easesmocking of complex objects quite a bit. As this is a build/testdependency only, requiring a new version is OK (it's available viaeasy_install).
Remove Python < 2.6 compatibility code
This code was used for Python versions < 2.6 which we don't support anymore.
Merge branch 'stable-2.9'
Merge branch 'stable-2.7' into stable-2.8
Fix batch creation of instances
During batch creation of instances the 'reason' field in opcodes is setto None (but the field is present). This caused problems when adding areasons to the reason trail.
Setting the default value for the 'reason' field to the empty list fixes...
Fix documentation of gnt-instance batch-create
The documentation of gnt-instance batch-create was outdated andcontained invalid examples. This patch corrects the man page andincludes working example inputs.
Support multi instance allocs without iallocator
If all instances in the multi allocation request have already theirprimary and secondary node set, there is no need for an iallocator. Thusdon't require it in this case and omit the call to it all together....
Update parameter variables
Because opcodes are generated, parameter variables no longerexist. This patch fixes the Python opcode tests not to refer to thesevariables.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Remove test for mutable default parameter values
Opcode parameters contain default values which can be, for example, alist, dict, or set. Because these values are mutable, 'Validate'performs a deepcopy before constructing the opcode dict and,therefore, changing these values will not affect the default value...
Remove Python opcode test 'TestClusterOsList'
Python opcode generation produces also calls to Python type predicatesin a more composable way compared to the previous hand-written typepredicates. As a result, some predicates, such as,'TestClusterOsList', became unused because they are achieved through a...
Remove "missing result" check in opcode tests
Some opcodes used 'None', others used 'ht.TNone', as a way torepresent the absence of a return type. This no longer applies,therefore, this patch updates the corresponding Python tests.
Signed-off-by: Jose A. Lopes <jabolopes@google.com>...
Remove Python type predicate 'NoType'
Type predicate 'NoType' is no longer necessary.
Update .gitignore with opcode generated files
Python opcode generation produces 'opcodes.py' and there is also theprogram 'hs2py' which must go in .gitignore.
Hook h2spy in Makefile.am
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
Fix spacing in opcode documentation generation
Opcode documentation is automatically generated from the Pythonopcodes in the reStructuredText format. This patch fixes the ill RSTdefinitions by adding the missing blank line.
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 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.
Move constants to the appropriate module
Move constants ALLOCATABLE_KEY and FAILED_KEY to the constants module.
Add predicates to test Python types in opcodes
Add helper functions to test Python types, which are used by opcodeparameters and return values.
Fix missing constant from Python constants
Add INIC_BRIDGE constant which is present in Haskell opcodes but notin Python opcodes.
Update version in TODO deprecation comment
Update comment containing a TODO for a future release.
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.
Document 'viridian' hypervisor parameter
List the 'viridian' hypervisor parameter (valid for Xen HVM) in thegnt-instance manpage.
Support 'viridian' parameter in Xen HVM
This parameter is required to prevent bluescreens in Windows instances.
This fixes issue 233.
Signed-off-by: Heiko Baumann <heibau@googlemail.com>Signed-off-by: Thomas Thrainer <thomasth@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>