Fix Query2.hs to compile without warnings
Since this is not yet used by any targets, we didn't detect yet thecompilation warnings. Just trivial exports/imports cleanup.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Ensure that --wait-for-sync is used in QA
We don't have a specific test for activate disks, so let's add it inthe cases where we run (incidentally) activate-disks.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Add --wait-for-sync in gnt-instance
Note that this needs (like for the opcode) a new option, with thedefault reverted (False instead of True).
9Add wait_for_sync flag to OpInstanceActivateDisks
This can be used to ensure that after activate-disks has returned, theinstance's storage is consistent; currently there's no programmaticway to do this.
hbal: return exit status 0 in case of early exit
This derives from an internal bug, but the story is consistent acrossboth internal and external usage of hbal.
Basically right now, hbal returns exit code 1 if requested to exitearly, even if all jobs are successful. This is counter-intuitive due...
Fix DRBD resize code
There are two bugs in the current resize code, affecting mostly DRBD.
First, due to bugs in old DRBD versions (pre 8.0.14), the code currentlycalls `drbdsetup resize' on both the primary or secondary. However,this is actually wrong per current DRBD (from drbdsetup(8)):...
Fixed spaces/indentation according to guide lines
Problem introduced by commit 87f0aa4896ac4dfacc9d20bc55b0855282b4d1d4.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Fix small bug with a space in the hv_xen module's line
Remove a useless space at the end of the line in a config file.
Signed-off-by: Jack Sitnikov <sitnikove@gmail.com>Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Add PCI passthrough for hvm xen
This hv parameter allows passing PCI devices to virtual machines.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Fixed doclint warning
Two blank lines are needed between functions.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
QA: Added test for gnt-instance recreate-disks
The test is disabled by default, as it takes a long time.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
QA function do destroy disks
This is useful to simulate HW problems during QA.
Add summary field to OpNodeModifyStorage
Allow single-homed <-> multi-homed transitions
To change the cluster from single homed to multi homed or vice versa onemust target the master node first, and pass the --force option. Allother nodes then will work as long as they are reachable by the master....
jstore: Add unittests
Add unittests for FormatJobID, GetArchiveDirectory, ParseJobId.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
query: Comparison of timestamps, job IDs
This patch adds the necessary conversions for comparing split timestamps(such as used by jobs) and job IDs (by defining custom converters).Unittests are included.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
jqueue: Move functions related to job ID to jstore
These don't really need to be in jqueue, and a new function willbe added to convert job IDs to an integer for queries.
Merge branch 'stable-2.6'
Fix cfgupgrade unittests
Sorry, I broke the cfgupgrade unittests via 904910c4, since thatcommit added the requirement for the "instances" dict in theconfiguration.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Upgrade wrong iv_names at cfgupgrade time
Since Ganeti 2.6 does warn about disks with wrong iv_names, it wouldbe better to fix them when upgrading to 2.6.
Not sure if this is too brittle and whether we want to add moresafeguards on the contents of the config/instance/disks before...
Add query2 numeric comparison operators
These were recently added to the python version.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
query2: Add <, >, <=, >= comparison operators
These can be used, for example, to get jobs submitted after a certaintimestamp.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fix creation of plain instances with --no-wait-for-sync
As reported on the devel mailing list by Christos Stavrakakis,creation of plain instances is broken when the --no-wait-for-sync flagis passed, because in that case WaitForSync is not called, hence...
Haskell data types for query2
This contains the types to express query2 queries, filters and results.
Fixed typos, formatting, etc and added a comment
This patch only touches comments and man pages.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fix daemon-util with non-root user models
Commit 4b42c3d6 broke non-root user mode since, while trying to do acleanup a move all local variable definitions to the start of thefunction; however, the plain_name var is only defined later, so thisactually doesn't work....
Bump version for beta 2 release
I've added the changes under beta1, not beta2, since it's easier tokeep it separate.
Fix epydoc raises L{...} usage
For epydoc raise statement, it already expects an exception which willbe hyperlinked; if passing an L{…} construct, it will instead breakthe formatting (the @raise will not be recognised, but merged into theprevious paragraph)....
Merge branch 'stable-2.5' into stable-2.6
Signed-off-by: Iustin Pop <iustin@google.com>...
Fix race condition in test for *FileID functions
In this test the “file ID” of a temporary file is compared against thefile ID gathered via an open file descriptor to the same file. Forreasons unknown to me utime(2) is called in-between to update theinode's a- and mtime. Depending on the file system's timestamp...
Move KVM keymap from GenerateRuntime to ExecuteRuntime
Per issue 243, "side-effects" are GenerateRuntime are bad as theyexecute only on the initial node of the instance. By moving thewrite-out of the keymap file to ExecuteRuntime, it will be done bothat start and at migrate time....
Add the keymap directory to the list of runtime KVM dirs
Commit 4f580fef added the keymap support, but missed that thisdirectory needs to be ensured/created at hypervisor init time.
Fix make -n use
Due to the way $(MAKE) behaves (it forces execution of the commandsthat contain it), use of $(MAKE) in a command line together withside-effects commands will break stuff. It's better to keep it eitheron a separate line, or if not possible, move said commands to a...
Enable hlint in lint and reorganise this target
Currently, the lint target does a sequential: pep8, pylint, pylint onthe QA sources. hlint is run only when explicitly requested.
This patch reorganises the lint target by:
- splitting the current lint target into separate pylint (slow),...
Improve error message for auto-promote/node modify
This has been reported internally 3-4 times already, and the currentversion (from 8b437a6e) is still not good enough, it seems.
Fix QA import of existing instances
Commit f346a7d9 broke the TestInstanceImport test in QA, since itdropped the "always generate" parameter for backup import. We add anoverride mac parameter so that, no matter what is defined in theconfig file, imported instances (can) have a different MAC....
Remove one obsolete hlint override
During the preparations for 2.6, we cleaned up the codebase to usenewer exceptions (e.g. commits 30d25dd8, 79ac58fa), so we can now dropthis override.
Fix prefix bug in Haskell ssconf implementation
This patch fixes a (brown-bag) bug in the ssconf implementation wherethe looked-for filenames were not prefixed with the ssconf fileprefix.
Additionally, a test for this is added (which fails without the fix)....
Move the ssconf file prefix constant to constants.py
This way, it can be reused in the Haskell code too.
QA: Add configuration options for static MAC address
In some QA environments static MAC addresses must be used.
QA: Ignore tags using regular expression
In some QA environments external scripts may add tags. With this patch aregular expression can be used to ignore them during QA runs.
Conflicts: Makefile.am (expected, from the parallel build fixes) qa/qa_config.py (due to cherry-pick, ignored, simply checkout out with --ours)...
Fix parallel build failures
This is the 2.5 version of the "fix build failures":
- man/%.gen could be left over even in case of failure, due to automake bug- make man/%.gen runs RUN_IN_TEMPDIR, so let's depend on it, since that target has the proper dependencies (create needed dirs)...
QA: Add default setting for tests
Commit 1010ec70b1 enabled all tests by default. In some scenarios wherethe configuration is static one may not want newly added tests to berun.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>...
QA: add toggle for fewer common instance tests
Currently, the "common" instance tests (shutdown, rapi stoppedconsole, stopped modify, startup, rapi shutdown, rapi startup, list,info, modify, rapi modify , console, rapi console, reinstall, rename,rapi rename, rename and back, rapi rename and back, grow disk, reboot,...
QA: stop logging SSH arguments for each invocation
Currently, this is how the QA log looks like:
Command: ssh -oEscapeChar=none -oBatchMode=yes -l root -t -oStrictHostKeyChecking=yes -oClearAllForwardings=yes -oForwardAgent=yes -oControlPath=/tmp/ganeti-qa-multiplexer.DMzkuH -oControlMaster=no node14 exit...
Switch QA to tty-less mode
This makes ssh generate much less noise when QA is run itself withouta tty, as otherwise we get thousands of lines of:
Pseudo-terminal will not be allocated because stdin is not a terminal.
in the QA logs (which are already big enough)....
Fix a type issue and bad logic in cluster verification
Commit 2e04d454 introduced the new offline state for the instancestate, but being a big monolithic patch it sneaked in something thatdoesn't make sense.
The checks for extra instances (either wrongly up or just unknown) are...
Make the xen-cmd test more readable and portable
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
doc/hooks: Clarify hook directory structure
I was not able to find where the “.d” suffix is documented, so thisclarification should make it more obvious.
Support xl as a xen interface command
xm and xl are mostly compatible, there is just a change in migrate,which for now we simple bridge by comparing the command string.
Also XEN_CMD is now set during configure time. This will then be fixedin Ganeti 2.7 when we make it an hvparams....
Add XEN_CMD to _autoconf.py
This is needed so we can specify the xen command upon configure time
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fix GenericCurlConfig when pycurl is linked against nss
Redhat links its pycurl against NSS/ so this check fails and thereforemakes ganeti-watcher unusable.
Even though this seems to fix the problem and works, further testing onthis might be needed.
Signed-off-by: René Nussbaumer <rn@google.com>...
Fix a tiny typo in a design doc
Reported by user ewoud, thanks!
Document that the disk/hypervisor state is not used
This didn't get completed in time for 2.6, so we document that it'snot working as is. Well, it's not broken, just not used by anything.
Correct the watcher state files in the man page
The move to per-group state files forgot to update the man page ofganeti-watcher; let's fix this and add some more details on whatremoval means and when it's needed.
Re-wrap some lines in watcher code
These were using exactly 80 chars, and I like them smaller.
Add support for SIGHUP handling in Haskell daemons
This patch adds support for handling SIGHUP and reopening thestdout/stderr logfile in daemon mode (but not in foreground mode).
Rework logging setup for Haskell daemons
This fixes a missing functionality: closing of stdout/stderr whenforking daemons. Without this, starting the daemons from the commandline seems to work, but doing it from utils.RunCmd breaks, sincewithout closing the standard descriptors, RunCmd never finishes....
Adapt example init.d script to work on Fedora
Update the INSTALL doc for Fedora users
kvm-ifup: Use /bin/bash
As reported by Ben Beuchler, kvm-ifup uses bash-specific constructs anddoesn't work with Ubuntu's default shell. We use bash all over the placeanyway, so changing the shebang line is the easiest solution.
Merge branch 'devel-2.6' into stable-2.6
It seems Michael submitted the daemon-util patch on devel-2.6, and Ididn't realise it. It's way too early in the release cycle of 2.6 tohave diverging branches, so I'm merging devel-2.6 into stable-2.6 andthen will ff the devel branch to the merge point....
Version bump for 2.6.0~beta1
Finally!
Adjust cfgupgrade for new minor version
Also does some abstracting of the versions.
Add support to daemon-util for distributions without start-stop-daemon
This adds support to daemon-util for Red Hat based distributions thatdo not have a start-stop-daemon. If /sbin/start-stop-daemon is notavailable, daemon-util will source /etc/rc.d/init.d/functions....
Improve the check-news script
Allow all errors to be displayed, instead of aborting at the firstone, and don't show stacktraces anymore.
Fix NEWS file
Too many empty lines…
_MaybeParseUnit: The elements are dicts not arrays
Make it possible to reset vcpu/spindle ratio to default
Add man page documentation for cpu_mask hv parameter
This is adapted from the design doc.
Also fixes a typo in cmdlib.py.
Add checks from wrong hard-coded paths in manpages
This is trivial, but should prevent such things in the future.
Fix hardcoded paths in gnt-cluster.rst man page
Also reworks a bit the sentence and fixes a typo.
First round of NEWS file updates for 2.6
More will come, this is just what I took from the existing NEWSentries.
gnt-group: Adding vcpu/spindle ratio to ipolicy flags
gnt-cluster modify: Add ipolicy for spindle ratio opt
cli: Add ipolicy_spindle_ratio to CreateIPolicyFromOpts
gnt-instance info: Rework beparams listings
This patch reworks the beparams listing to the new style. However, dueto this process the naming of the fields with mixed casing changed tolowercase and is therefore not 100% compatible with the previous versions....
Fix a tiny typo
Was showing in the man page as --diskN, without a space.
constants: Add FIXME regarding CPU pinning bitfield
Allow units in ipolicy disk/mem CLI changes
This makes "gnt-cluster modify --specs-mem-size max=16g" work. Thedownside (due to how we iterate) is that error messages are not veryclear:
$ gnt-cluster modify --specs-mem-size max=16a Failure: prerequisites not met for this operation:...
Move some ipolicy functions from objects to cli
These are only used in CLI programs to parse command line options andsuch they do not belong in object.py (I will change them more and Idon't want to add more code in objects.py).
Beautify a couple of error messages
Fix _ComputeNewInstanceViolations logic
This function did the opposite: was computing which old instanceviolated the specs but no longer do it now. new - old is the expectedbehaviour.
Beautify disk ipolicy violations in cluster-verify
Currently, we only get:
instance3: ['disk-size value 512 is not in range [1024, 1048576]'
which doesn't explain which disk we are talking about. This patchextends the verification functions to take an additional parameter...
qa_utils: Factorize code for getting entity name
This reduces code duplication and provides better error messages ifsomething is incorrect while getting a node or instance name.
NEWS: Style fixes
- Quote where appropriate- Small wording changes
qa_utils: Accept string as instance for check
Some tests don't have access to an instance dictionary.
QA: Cleanup after commit 5fa0375e4a
Some tests had wrong assumptions on the instance status and someneeded explicit start or stop commands.
LUInstanceCreate: Run rename script on instance import
If an instance is imported with a different name, network settings may have tobe changed. Since import scripts may not already to the right thing, we decidedto run the rename script. The same technique is already used for inter-cluster...
ganeti.query_unittest: Adding testcase for diskparams
gnt-group add: Fix diskparam fill
This was a pretty non-obvious bug. A cluster looks sane aftergnt-cluster init, however on a daemon restart the diskparameters had thedefault filled in. The same applies to gnt-group add. This is due to thenature that UpgradeConfig() from NodeGroups did just populate them with...
gnt-group modify: Fix an update issue with diskparams
Make x509 unittest testClockSkew a bit less flaky
Since the tested function actually uses time.time(), it cannot be makefully stable, but 1 second is very dangerous; let's just test SKEW * 2and higher since that should be good (if the delta between _GenCert...
gnt-group: Add info command