Move getCurrentTime from Confd.Utils to Utils
The getCurrentTime function is of wide interest, so its moved to a moreappropriate position.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
burnin: Add unittest for supported disk templates
When new a new disk template is added, burnin should be updated.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
kvm: make kvm path configurable as an hv parameter
This fixes Issue 225.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
make _{Generate,Execute}KVMRuntime accept kvm help
Currently kvm --help is called twice at instance startup, this makessure it's called only once.
kvm: make auxiliary functions accept a kvm path
This will be used to be able to customize the path in an hv parameter.
Also fix two comments that still mentioned version-based checking.
Add KVM machine version as hv param
This is needed in case an instance must be booted with an exact type ofmachine version (due to e.g. outdated drivers). If this hv paramexplicitly defined (during instance creation/modification) then the kvmprocess will be started having this version for the -M option. Otherwise...
Move burnin to ganeti.tools.burnin
Similar to other scripts, “tools/burnin” just becomes a wrapper script.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Remove special-case of "0" in niceSort
Since now niceSort is more consistently behaved, we don't have thespecial casing. This should have been removed in commit a7f0953a, butI didn't realise it.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
burnin: Enable DT_EXT/DT_RBD for single node clusters
As reported by Constantinos Venetsanopoulos, DT_RBD and DT_EXT work onsingle node clusters.
test/Types.hs: add an HLint ANN for ignoring camelCase
Signed-off-by: Dato Simó <dato@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Link man pages in documentation
This patch depends on “Option to include man pages in documentation”. Inthe documentation build including man pages, all “:manpage:`…`”references are converted to links. For man pages not provided by Ganeti,Sphinx' standard formatting is used....
Make niceSort a wrapper over niceSortKey id
Currently, niceSort behaves differently than niceSortKey in caseswhere the parsed groups are equal but the original not, as it usesboth members of the tuple as opposed to just the first one. BothniceSortKey and the Python code use only the first one, so in corner...
Add version check for Sphinx
Sphinx 1.0 and above can check version by setting “needs_sphinx” in theconfiguration.
Option to include man pages in documentation
Before this patch, HTML versions of man pages (man/*.rst) were alreadybuilt. However, since they are separate from the normal documentation,their content is not indexed for Sphinx' search functionality.Additionally it would simply be nice to have everything in one place....
design-autorepair.rst: separate list of jobs with plus sign
Commas are not valid characters in tags, hence they can't be use toseparate the different job IDs; plus signs (+) are available, and not toobad.
burnin: Disk template option cleanup
Burnin doesn't support all disk templates (specifically it doesn'tsupport “blockdev”). The code, however, used manually composed lists insome places, constants.DISK_TEMPLATES in others, and an internal list ofsupported templates in some....
burnin: Factorize disk template lists
Keep the lists at the top instead of having them embedded in the code.Use frozenset, too.
Replace nodegroups' PartialNic by PartialNicParams
This fixes a bug that corrups the config when one adds anetwork to a node group. I wil soon extend QA by some commandsthat would have detected this.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Loader.hs: ignore expired ArSuspended policies
At the moment, because 'mergeData' is pure, it may set instance auto-repairpolicies that are of the form `ArSuspended $ Until timestamp_in_the_past`.If later on the auto-repair tool notices this, it has lost access to what...
Loader.hs: rewrite extractExTags to use chompPrefix
design-autorepair.rst: clarify tag precedence and conflict
This commit clarifies one particular point of the auto-repair workflow:what to do when multiple, conflicting administrator-set tags exist in anobject; and how tags at different levels (cluster, node group and instance)...
Loader.hs: set instance auto-repair policy in mergeData
'getArPolicy' and 'setArPolicy' follow the precedence rules introduced inb1eb71c: within an object, the most restrictive tag wins; across object,the nearest tag wins.
Signed-off-by: Dato Simó <dato@google.com>...
Instance.hs: add an 'arPolicy' field for auto-repair policy
Utils.hs: add a clockTimeToString function
This function allows to easily convert a ClockTime object to a stringrepresentation of its timestamp (seconds-only).
Utils.hs: function to chomp prefix + separator from a string
Some auto-repair tags are composed of a prefix and then an optionalargument; the new "chompPrefix" function in Utils.hs allows to strip aprefix, allowing the last character (the separator) to be absent if there...
design-autorepair.rst: add a graph with state transitions
The graph added here follows the data types introduced in 7ec2f76, by which"Suspended" is not a state, but a possible value of the auto-repair policy.
Add initial constants and Haskell ADTs for auto repair
In this commit, the AutoRepairType and AutoRepairResult types are defined,with the possible values specified in doc/design-autorepair.rst.
HTools/Types.hs: more auto-repair types
AutoRepairPolicy, AutoRepairStatus, and other auxiliary types are added.These are used only internally by the auto-repair tool, and parsed from thevarious object tags as defined in the design doc.
design-autorepair.rst: use the same prefix everywhere
This commit changes the "ganeti:watcher:repair:pending" and"ganeti:watcher:repair:result" tag prefixes to use"ganeti:watcher:autorepair:{pending,result}", so that the same prefix isused in all cases....
NEWS: Fix referenced man page's section number
kvm: add two help dump files
One is the --help output for kvm 1.1.2 and the second one is the same as0.9.1 but with a fake option added between -drive and its boot=on|offoption: this tests that if boot=on|off appears in another option after-drive it is not accepted by our regexp....
Update copyright in documentation
Use range() instead of building the list manually. Keeps the codeshorter starting next year.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>Reviewed-and-lolled-by: Iustin Pop <iustin@google.com>
kvm: simplify _GetMachineVersion
Use a multiline regexp rather than a single line one, and then splitlines in the code.
Allow -soundhw option to kvm
For all of us that love to listen to music on our kvm virtual machines,the -soundhw option is paramount.
kvm: support usb devices
All in one go, comma separated usb devices of all types.
kvm: Add kvm_extra parameter
As requested in Issue 261 and many other times.
kvm: Add -vga option
As requested in Issue 69.
kvm: use help based feature detection
As discussed on the list some people backport features to different kvmversions, making the version based detection system unreliable. Wechange wherever we can to detection on the help output.
This also fixes Issue 250...
Add a non negative int hypervisor parameter check
...and use it for a few parameters for which it makes sense.
kvm: always pass -usb
This will be the default anyway and it was a mistake to pass it only ifthe mouse was specified.
kvm: abstract getting --help output
This will be used later, for now nothing changes.
kvm: allow setting smp cores, threads, sockets
This was requested in Issue 322.Note that maxcpus is not implemented yet, as it should be considered ina cpu-hotplug global context.
kvm: add serial console speed
The serial port speed changed between versions of qemu (what didn't?), sothe old hardcoded default doesn't do anymore. Upgrade it to a parameter.
Merge branch 'devel-2.6'
Merge branch 'stable-2.6' into devel-2.6
QA: Use instance name for rename test
Reported in issue 341. In some setups the instance live in a differentnetblock from the cluster. Therefore a the configuration-global “rename”name shouldn't be used for them. Instead another instance name is used....
Add locking to _NetworkQuery
Make use of _GetNames() to get the final network UUIDs.Get networks info after having aquired the locks. Refactorthe code to use new local variables:
- "network_uuids" returned from _GetNames() - "all_networks" that are the latest network info...
QA: Factorize retrieving non-existent groups from config
Also add a check to make sure there are enough groups defined.
Generate documentation from build directory
When man pages should be included they need to be copied from man/*.rst.This means documentation can no longer be built from the static reSTfiles alone (which are referenced using “abs_top_srcdir”). Similar to...
Add machine version in kvm runtime file
kvm -M ? returns the supported machines (e.g. pc-1.1).Add _GetDefaultMachineVersion() function to get the default value.
Upon kvm runtime file creation (this is in _GenerateKVMRuntime() invokedonly in StartInstance()) append this info in kvm_cmd. During...
Fix typo in the DRBD parser types file
A missing letter has been added to a docstring.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add script to check man page references
This script checks for some of the most obvious mistakes when formattingman page references (which should have the form “**ganeti**\(7)”). Whilethis works now, it is very hard to avoid ambiguities (e.g. references...
man: Man page reference cleanup
Sphinx is stricter than pandoc when parsing reST and does not allow anopening parenthesis to directly follow inline markup. [1] describes therules. A backslash, as described in [2], can be used to separate thetwo.
Additionally, there were different forms for referring to man pages....
test/Utils.hs: fix capitalization in docstring comment
Signed-off-by: Guido Trotter <ultrotter@google.com>...
Add utility to format dictionary as key=value strings
This will be used in QA to format network interface parameters.
This is a cherry-pick of master commit eac9b7b8
More documentation and man page fixes
- Include numbers in man page references- Use “:manpage:” where appropriate- Don't escape underscore in verbatim text (e.g. “``always_failover``) as it would show up in the generated man page- Quote whole paths, not just build-time part...
Remove fixed FIXME
This was fixed in stable-2.6, commit 053c356
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
QA: Support master-netdev and default NIC parameters
Requested in issue 337.
The parameter “bridge” was not documented and is therefore silentlyreplaced with “master-netdev”. A note is added to “qa-sample.json”describing how comments work.
This is a cherry-pick of master commit...
QA: Do not pass "--bridge" to "gnt-cluster init"
Commit ec0652a (June 2009) removed the option.
This is a cherry-pick of master commit784537390cd5b1c4f5f8fb9401a62eb23acce39b
Makefile: Fix list of directories
Commit dbee5c9 had a wrong path.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Highlight external links in HTML documentation
Based on MediaWiki's monobook skin.
Unit tests for bdev and utils.lvm
Also amended a comment of a tested method.The tests are for methods introduced in commit 63c73073 (LVM disk creationuses dedicated PVs).
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Update the monitoring agent design document
This commit updates the design document of the monitoring agent accordingto what has already been discussed in various meetings and email threads.
Support instance-minor pairing in the DRBD collector
This commits enables the DRBD data collector to use the Confd client togather information about the pairing between DRBD minors and instances.
For testing purposes, the DRBD data collector now requires either zero...
Support integrating instance information in the DRBD parser
This commit modifies the DRBD parser and its data structures to includeinformation about the instance a DRBD minor belongs to.
Test files have been updated as well, to support the new field in the data...
NEWS: Add missing parenthesis
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Michele Tartara <mtartara@google.com>
Add footer.rst as a dependency for all man pages
Commit 6aff051 removed an intermediate step, but forgot to add“footer.rst” as a direct dependency.
Update name of test/htest in doc/devnotes.rst
Update the docs after the rename of 'test/hs/test' to'test/hs/htest'. This must have been forgotten in 3e16567e.
Signed-off-by: Yiannis Tsiouris <gtsiour@softlab.ntua.gr>Signed-off-by: Iustin Pop <iustin@google.com>...
Fix a couple of bugs in the gnt-instance man page
The "list-fields" and "change-group" commands were mistakenly listedas sections; we also rename the "Recovery" section to match better itscontent.
Fix "Tags" section capitalisation in the man pages
"Tags" is a section, not a command, so let's title-case it (as opposedto all upper-case). Furthermore, the RST markup was wrong for thegnt-network man page.
Signed-off-by: Iustin Pop <iustin@google.com>...
Convert gnt-os man page to sections
As Constantinos observed, the gnt-os man page is not consistent with theothers. This patch adds the missing sections.
Improve a bit Haskell library recommended versions
The hinotify library was missing any versions, and finding one thatworks with ghc 6.12 (base 4.2.x) was not obvious. Thetest-framework-quickcheck2 recommended version didn't actually workwith the test-framework version, so fix that as well....
Remove intermediate footer.man/footer.html files
I don't remember why I introduced these when switching to pandoc, butthey are not absolutely needed. Instead of pre-generating them (whichmight save some trivial cpu time), we can simply pass footer.rst as an...
Enable a table of contents for the html version of man pages
This makes the (very dull) html version of the man pages a bit morereadable, until such a time that we can switch over to sphinx fully.
Rearrange tags in gnt-cluster/gnt-node
This patch makes the gnt-cluster and gnt-node man page more consistentwith the other man pages, where the tag commands are listed in aseparate section at the end.
Stop manually building images out of dot files
The first dot files we added way back in the 2.0 release are managedmanually: we build the .pngs ourselves, track them in .gitingore,etc. Since then, we have switched to allow sphinx to build/manage themitself, so it makes sense to cleanup the build system and covert...
Inline the standalone dot files
This removes entirely the standalone dot files by inlining them in theRST documents - as they weren't referenced from more than one documenteither way.
Remove some obsolete entries from .gitignore
Found while doing the previous .dot file changes and wondering what'sthis "doc/*.in" stuff… it looks like these were obsoleted over theyears by not paying attention on cleanup patches:
- doc/build: obsoleted by commit 13de7d59...
Fix a bug in the generation of completion information
Completion information for multi-command binaries were not generated inthe correct way, so the build-bash-complation script failed when such abinary was actually found.
This commit fixes this issue, and a related docstring typo as well....
Add small webserver for development
When working on documentation it can be helpful to use a browser. Insome environments it's not possible to access the files directly from agraphical browser. This trivial webserver exports all files in thecurrent directory and unlike alternatives such as thttpd, doesn't check...
man pages: Lowercase name for syntax highlighting
When the man pages' reST is built using Sphinx, “bash” must be usedinstead of “Bash”. Pandoc works with both.
Add "use_locking" parameter to network query opcode
This was extracted from a patch by Dimitris Aragiorgis with the subject“Add locking to _NetworkQuery”. The rest of the patch did no longerapply and will require more work.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
Makefile.am: Add missing space
Commit acaf3ca missed this space before a backslash.
Fix the installation location of mon-collector
The mon-collector binary was erroneously installed twice: once in/usr/bin/ and once in /usr/lib/ganeti/.With this modification, it is now installed in /usr/lib/ganeti/ only,as intended.
In order to do this in a proper way, some parts of the Makefile.am where...
Improve the reception of replies in the confd client
If a received reply is valid and there is still no valid reply,keep it, no matter how new it is.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Document the ExtStorage `SetInfo' functionality
Small updates to the extstorage design document and interface.
Signed-off-by: Constantinos Venetsanopoulos <cven@grnet.gr>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
gnt-storage man page: make commands sub-sections
This makes the man page more consistent with the others (exceptgnt-os, that is).
Fix a bad data type in Hcheck.hs
While trying to understand why some code was not being tested, Irealised that we have a bad data type in Hcheck.hs.
We have "data Level = GroupLvl | ClusterLvl", but then we need to passthe group name/index as well, so we have functions that look like the...
Move src/Ganeti/HTools/Program.hs to Program/Main.hs
This removes one more tab conflict; this is the last module in ourcode where we have both x.hs and x/.
Furthermore, we collapse all actual code into the new Main.hs module,leaving the htools.hs basically empty (will allow better testing in...
A bit more name cleanup
- gen-coverage → gen-py-coverage- coverage-htools.tix → coverage-hs.tix
Split the hs-check test rule
Currently, both the unit test and the shell tests are run (manually)from this rule. This has two downsides: you can't (compile and) runjust one of them easily, and make can't run them in parallel.
By splitting the rules, we can both of the above easily....
Remove duplicate test file functions
This patch unifies the functions that generated the treereorganisation discussion in the first place :)
Rename test/hs/test to htest
The current base name of 'test' means that this binary will generateprofiling, coverage, etc. files with the name 'test.*', result intab-completion conflicts with the test directory. Let's slightlychange its base name for typing easiness....
Move htest/ files under the test/ tree
htest/data becomes test/data/htools (basically reverting commit8feabc89), and htest/* becomes test/hs/*.
Most changes beside the rename are trivial s/…/…, with the exceptionof autotools/run-in-tempdir, which needed some more changes now that...
Move python test files to test/py
This is the first step of the test files reorganisation: moving test/*(except test/data) to new directory test/py/.
Return master ip script output in case of failure
Currently only the exit code is returned, which is somewhat pointless:for failures, we already know it's ≠ 0, so we don't have enoughinformation (reported on the mailing list). By logging the output aswell (if any), the user will have more information available for...
Replace htools→hs in configure/makefile rules
This continues the cleanup of the 'htools' name, by replacing 'htools'with 'hs' in configure and makefile rules.
There is still 'WANT_HTOOLS' left as it is correct, but some of theconditionals in Makefile.am will need some cleanup (in a different...