gnt-cluster info: show enabled storage types
This extends the 'gnt-cluster info' command to list the storage typesthat are enabled on the cluster. It also fixes the broken indentationin the 'handleCall' function.
Signed-off-by: Helga Velroyen <helgav@google.com>...
Add 'enabled_storage_types' to the cluster config
This patch adds the cluster's new field 'enabled_storage_types'to the configuration objects in python and haskell.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Add constants for storage types to constants.py
This patch adds the currently known and used storage methods to theconstants.py file. Note that storage types are different from disktemplates. For example both disk templates, drbd and plain, use lvmstorage types....
Fix Mond man page
Remove some erroneous formatting from the Mond man page.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Add monitoring HTTP API structure
Add all the supported commands to the API.The actual response is still to be implemented.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Add basic HTTP server functionalities to Mond
Add a stub implementation of the Mond HTTP server to Mond using the Haskellsnap-server library.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Update documentation for monitoring daemon
This commit updates the installation instructions and the user guide.
Merge branch 'devel-2.7'
Trivial merge: no conflicts...
Add the core of the monitoring daemon
This commit adds the core infrastructure of the monitoring daemon,and integrates it in the build and test systems.
The actual functionality of the monitoring daemon is still completelymissing.
Signed-off-by: Michele Tartara <mtartara@google.com>...
cfgupgrade: Fix error messages
Messages were inconsistent. You could get both an error and a messagesaying that everything was fine.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Update "FIXME" string in RAPI
We are not ready for this change yet. Let's push it to 2.8.
Typo 'repot' in Server.hs
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fix typo 'VolumeN' in bdev.py
Add design document for the "reason trail"
This commit adds the design document for introducing "reason trails",tracing the reason why opcodes are executed, step by step.
Add Mond to the list of possible daemons
Also, add its logfiles and extra log files.
Add infrastructure for allowing additional logfiles
Some daemons will need more than the single logfile that is currentlyallowed. This patch introduces the infrastructure to allow this.
Add user and group for the monitoring agent
This commit adds the user and group variables for the monitoring agent in allthe configuration files where they are required.
rapi client: add target_node to migrate instance
This allows migrating to any node, as it is already possible forfailover, when instances are externally mirrored.
Signed-off-by: Daniel Krambrock <danielk_lists@z9d.de>Signed-off-by: Guido Trotter <ultrotter@google.com>...
Make diskless instances externally mirrored
This addresses Issue 237.
Mirroring no disk is a no-op. As such we can treat them like mirroredinstances, since the data they need (none) will be present on all nodes.
This is definitely enough to failover or migrate instances with a manual...
Fix migrate/failover -n for ext mirror storage
This fixes issue 396.
- Fix a wrong comment that mentions drbd8 when actually the code acts only on externally mirrored instances.- Fix a wrong assert that requires failover/migrate to acquire the NAL on externally mirrored instances: this is the case only when a...
Enable split queries for the network
Now that all fields are implemented, and (I think) behave equivalentto the Python implementation, we can switch on the split queries fornetworks.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Add a simple tool for checking split-query equivalence
This is not run automatically (although it could/should), but is veryuseful during development.
Fix network query field types/names in the Haskell code
The headers/type/descriptions had some differences from the Pythoncode, when checked for exact equivalence.
Introduce better item getter helper in query.py
And also use it for simple network fields. Currently the Pythonlibrary returns jsnull, which is formatted as 'None' by the Pythonclient, which (IMHO) is not nice, since these fields are strings (someof them) or "other". An undeclared gateway is easier to diagnose when...
Fix gnt-backup list -o node via confd
Currently, the 'node' field is declared as a simple config field, sowhen only selecting this fields, the runtime gathering is no longerrun and it's presumed that all nodes have a backup. So the output isnot truthful (instead of just listing the nodes with at least one...
Make gnt-node list -o(p|s)inst_list output stable
Currently, both the Python and Haskell code return the internalinstance list unsorted, which means the output can vary depending onthe phase of the moon (well, the Haskell code actually uses internallya tree, sorted by the instance name, but it's implementation detail)....
Sort instance list in gnt-group list -opinst_list
The Python code currently sorts this, but the Haskell code not.
This should maybe have a test, but I'm not sure how far we want toencode such properties in tests… (and the real reason I'm not addingone is that we don't have a way to generate a random cluster with...
Change node disk/hv_state query in confd
Currently, the Python code returns either FS_UNAVAIL (if theseattributes are None) or the proper dicts. As we don't allow editing ofthese attributes, in most cases they will therefore be FS_UNAVAIL onthe client....
A few style fixes in Ganeti.Network
Side-effects of working on some other network-related stuff…
Expand TestHelper to allow non-underscore prefixes
HLint 1.8.28 requires us to always add "ignore CamelCase", which canbe problematic sometimes (e.g. when using OverloadedStrings). Let'sexpand TestHelper to also support less-standard 'caseFooBar' names, so...
Change to CamelCase format in Test/Ganeti/Objects.hs
This is in preparation for using OverloadedString extensions in thisfile, which conflicts with hlint 1.8.28's handling of annotations.
Add simple Ip4Address/Ip4Network types
This patch adds some very simple IPv4 address/network types, and usesthem in the 'Network' config object.
We need these in order to properly compute the reserved IP addresses,without depending on an external library (which I haven't found, by...
Add missing external_reservations query field in confd
Based on the implemented Ip4Network/Address types, we can now computethe (external) reservations.
Update design doc about free space reporting
This patch updates the design doc "Design correct reporting of storagefree space". The modifications were chosen to not conflict with anyfuture changes of Ganeti regarding storage pools.
Fix QA: skip reinstall for diskless instances
Diskless instances cannot really be reinstalled, not even through RAPI.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fix typo in the monitoring agent design doc
Fix style error in hconfd
The first line of a function should be blank, unless it is able to contain thewhole function.
Add QA for instance creation with policy violation
When instance policy is violated, creation fails.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Add QA for policy-instance interactions
Violations on policy changes are checked.
Add QA for cluster policies
qa_cluster.TestClusterSetISpecs() is exported as it will be used in futuretests.
Unit tests for objects.InstancePolicy + a fix
Tests for: objects.InstancePolicy.CheckParameterSyntax() objects.InstancePolicy.CheckDiskTemplates() objects.InstancePolicy.CheckISpecSyntax()
Instance policies with an empty disk-template list now are reported....
Unit tests for objects.FillIPolicy() + small fix
IPOLICY_DEFAULTS is now a legal policy (the disk-templates entry was a setinstead of a list, before).
Fix upgrade of policy in objects.Cluster
Unknown elements were silently removed on startup. This means that asoftware upgrade could result in lost configuration information ifcfgupgrade wasn't run promptly.
Added unit test for Cluster.UpgradeConfig() to cover this case....
Fix instance policy checks for default back-end parameters
Policy violations of back-end parameters that used the cluster defaultvalue were not reported in cluster-verify.
Fix restoring default instance specs in group policies
"default" was not accepted as a valid input value for instance specs ingroup policies, due to a bug introduced in 2cc673a3e (and released with2.6.0). Added QA for this and another similar case.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>...
Unit tests for cmdlib._GetUpdatedIPolicy()
Not 100% coverage, though.
Fix policy check for disk templates
Instance disk template is checked against the policy, and disklessinstances aren't checked for the number of disks.
Fix merge 8e09e801 that resulted in duplicated code
A fragment in LUInstanceCreate.CheckPrereq() removed in commit ba147ff8 wasreintroduced in merge 8e09e801 due to a change in df28c49b.
GanetiRapiClient: fix the no_remember option
There was a typo which prevented the correct option from being passed toRAPI
Signed-off-by: Daniel Krambrock <danielk_lists@z9d.de>Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>...
Change hbal behaviour in case of early exit
Currently, hbal exits with status 1 if early exit is requested, evenwhen all jobs are successful. This is counter-intuitive behaviour, solet's fix it (Issue 386).
Note that the man page had conflicting information already, so it's a...
Fix "reason" opcode parameter description
The "reason" opcode parameter can now apply to multiple opcodes, not just theone for rebooting instances.
Fix build/sphinx_ext.py with tuple defaults for op params
When an OpCode's parameter has a tuple as default value, this codewill break:
buf.write("defaults to ``%s``" % default)
The patch fixes this and other potential cases by always passing atuple to '%'....
Fix bug in man build rule
Currently the man page build rule is run without ‘-e’, so the actualchecks in there are just warnings (check-man-warnings,check-man-dashes).
The patch fixes this and also fixes the man pages which made me see theproblem.
Additionally, check-man-dashes is now verbose, otherwise it's hard to...
Fix hscolour style sheet building
Currently we only symlink this into two hard-coded directories, whichbreaks the source code viewing for all the others.
The patch replaces this with automatic building; as playing withrelative symlinks is non-trivial, I just generate it many times (the...
Make "reason" a common opcode attribute
The "reason" attribute will be common to many opcodes.This patch factors it out so that it will be possible for the next commitsto use it without code duplication.
Conflicts: Makefile.am (curl changes and new hs directories)...
Update required pylint version
This should help a lot of users, since pylint 0.21.1 was quite an oldversion…
The tree is "clean" w.r.t. the new pylint version.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Constants.hs.in: improve Haddock markup in the template
convert-constants: generate better Haddock markup
Currently the Python source constants are used as-is, which is notnice on the eyes (especially for unqualified names, it was hard toseparate them visually).
Expand Haddock to run over test files as well
This patch does multiple enhancements to the way we build the Haddockdocs, motivated by the fact that if we don't run Haddock over testfiles as well, bad formatting can be submitted and will accumulateover time (without any checks)....
Switch LispConfig double comparison to relative error
This further improves the comparison for "non-trivial" numbers. Without this patch, there are still cases where the absoluteerror is too big, and we need to switch to relative error.
Concept has been taken from...
Switch Attoparsec parser from double to rational
According to the documentation, “This function is almost ten timesfaster than rational, but is slightly less accurate. For 94.2% ofnumbers, this function and rational give identical results, but forthe remaining 5.8%, this function loses precision around the 15th...
Make the XmParser config test runtime more consistent
Currently, the test uses a frequency of 5 string/5 double/1 list forgenerating Arbitrary instances of ListConfig. However, the list casehas simply a "choose (1, 20)" `vectorOf` arbitrary, which means it...
Improve output of the XmParser config test
Currently, this tests and its helper function 'isAlmostEqual' usesplain booleans to signify failures, which means you can't really debuga failed test. The patch changes the call chain to use annotatedproperties all through, which results in messages like:...
Fix node partial name matching in Haskell code
This implements QffHostname and fixes the node listing (as well asexport listing when filtering on node name).
This bug was hidden by the fact that node listing with "gnt-node listaa" works if you don't have live queries (as it was originally), as...
Fix bug in group queries related to node/instance fields
Since we use the primitive string type for group UUIDs, the groupfields have a bug where we pass the group name as filter for nodetests, whereas the nodes themselves use the group UUID. This results...
Abstract the individual query functions
After implementing a few of the query executor functions, it turns outthat we have the same general pattern:
- compile the filter- extract the selected fields- determine whether we need to run collectors- do a first pass filtering...
Allow confd to serve network list-fields queries
The fields are not yet complete, but at least we can enable thelist-field query to see what is there already.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Rename/make uniform the other query entities
Following the new naming style introduced in Exports.hs, this patchrenames the other resources to export non-qualified names (fieldMap asopposed to nodeFieldMap), and to use qualified module imports.
Also fixes a haddock issue in a docstring....
Add export lists for files which didn't have them
Two test helper files didn't have export lists (lost during the splitof tests). This patch finally reintroduces them, to hopefully make theexport list saner and with fewer changes for purely-internal changes....
Fix Haskell compatibility tests with disabled file storage
When file storage is disabled at ./configure time, we shouldn't passopcodes containing DTFile/DTSharedFile/StorageFile to Python forvalidation, as they will fail.
This patch implements this by simply tweaking the Arbitrary instances...
Fix QA with disabled file storage
Currently QA tries to use “gnt-node list-storage” with all storagetypes, but when file storage is disabled this will fail.
The patch changes it so that if file storage is disabled, we test thatindeed fails, and otherwise we include it in the regular tests....
Fix convert-constants handling of booleans
It turns out that, in Python, booleans are also integers. So they fallunder the “isinstance(value, int)” case, resulting in all enable*constants being integers in Haskell, which is not nice, even thoughwe're not using them directly today....
Fix handling of disabled (shared) file storage
The vcluster changes broke the disabling of file storage; we canworkaround by (manually) skipping the virtualisation of file storagepaths if they are not enabled.
Note that tests/QA are still broken with disabled file storage; this...
Fix LUTestAllocator with instance alloc
This is similar to commit 8775e62a; the addition of node_whitelistbroke this LU as well.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Allow rpc.MakeLegacyNodeInfo to parse non-LVM results
'MakeLegacyNodeInfo' is not the best place for this, but we'd have toduplicate it if we wanted a LVM-less version, so the easiest is to addan optional parameter that allows it to accept/skip LVM-less results....
Allow iallocator to work without LVM storage
Currently, the iallocator interface requires LVM storage, due to theway it computes the node storage information.
By changing the code to understand that GetVGName() can return None,and by setting the disk_total/disk_free node parameters to the value...
Fix improperly formatted docstring
Change the docstring of chompPrefix to prevent the error"doc comment parse failed" that was raised by some version ofhaddock while generating the documentation for this function.
Fix low verbosity levels in htools
In a few cases, we tested the verbosity level for (== 0), instead ofhigher/lower than a certain value. If the user passes multiple"--quiet" options, this can result in negative verbosity levels, whichbehave like "extra verbosity"....
Fix confd issue regarding --no-lvm-storage
If cluster is initialized with --no-lvm-storage then volume_group_namedoes not exist in config.data. Thus we must define it as optional inconfd.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>[iustin@google.com: fixed Haskell RPC definition]...
Fix networks in _PrepareNicModifications()
Passing --net 0:add,ip=5.5.5.5 failed due to a referenceof a non initialized variable (new_net_obj). Reorder the checksand add some comments to be readable.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>...
Fix sphinx label namespace
Thanks Michael for pointing out the error!
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Clarify use of move-instance with self-signed certificates
The document doesn't mention which certificates need to be passed asca-file, so let's try to clarify that.
QA: Support diskless instances
This is an initial implementation of diskless instances.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
QA: Compare ipolicy directly with None
If a value was set to numeric 0, the parameter wouldn't be passed to thecommand.
QA: List all ipolicy options in example configuration
This makes it easier to know what options are available.
QA: Update assertion for diskless instances
QA: Disable reinstall test for diskless instances
QA: Fix dictionary formatting
Make it match the style guide.
QA: Disable drbd-offline test if no DRBD instance is used
If “instance-add-drbd-disk” is not enabled it usually also means to notuse DRBD at all.
Remove early returns in network LUs
Remove any early returns in LUNetworkDisconnect/LUNetworkConnectand replace them with if-else statements.
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Test AsyncStreamServer with abstract unix sockets
This was meant to be since "the beginning" but was never submitted assomehow it failed with python 2.4. Now that the minimum python versionhas been increased it can be added.
Signed-off-by: Guido Trotter <ultrotter@google.com>...
QA: Disable RAPI tests for virtual clusters
The QA script connects to the RAPI daemon. In virtual cluster setups thedaemon is usually listening on a local interface not reachable from theoutside.
QA: Add virtual cluster support to queue drain test
The path to the queue drain file must use the virtual node path.
QA: Disable copyfile test for virtual clusters
This test will need some more work for virtual clusters. Disable it inthe meantime.
QA: Disable OOB tests for virtual clusters
They do not work properly at the moment.
QA: Update virtual node's RAPI users file
The file is located below the virtual node directory.