http: Add wrapper for mimetools.Message
A newly added piece of code will also have to parse headers, so havingthis wrapper saves us from copying this part of code.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add missing tests for commit f0d2286
Commit f0d2286 changed the logic ofgnt_instance._ConvertNicDiskModifications to also allow a parameternamed “modify”. Unfortunately the corresponding unittest was notupdated. An “if”/“else” condition is also merged....
Fix compatibility with newer Haskell libraries
This small patch fixes compatibility with a few newer Haskell libraries:
- base 4.6, included with ghc 7.6, removed the deprecated 'catch' function from Prelude, so our "import Prelude hiding (catch)" is now...
Fix gnt-instance console with xl
- Rename xm-console-wrapper to xen-console-wrapper- Pass the xen command to use as a parameter
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Disable E1101 on ganeti/http/server.py:424
Fix live migration under xl
Until now the only way to make live migration work in conjunction with"xl" was to add ssh known_hosts keys for every node's secondary ip onevery other node.
With this command we remove the target key verification: this is not...
Don't check for xend port when using xl
If the toolstack is set to "xl" we shouldn't ping xend for livenessbefore attempting a live migration.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fix typo in gnt-instance man page
jqueue: Return jobs to queue when shutting down
When a job is still waiting for locks and the queue is shutting down,they should be returned and not actually start processing. Until nowjobs which transitioned from “queued” to “waiting” were alreadyconsidered to be running as far as the shutdown code was concerned....
gnt-debug delay: Add "--submit" option
Make hostname checks uniform between instance rename and add
Currently, we have instance rename doing extra checks on the hostname, to prevent accidental wrong renames; however, instance createdoesn't do these checks (issue 291), which (if DNS is misconfigured)...
Improve logging of new job submissions
This addresses issue 290: when receiving new jobs, logging isincomplete, and we don't have the job ID and/or summarieslogged. Only later, when the job is queried for or being processed, weknow more.
This is not good when troubleshooting, so let's improve the initial...
Improve handling of lock exceptions
There are two issues with lock exceptions right now:
- first, we don't log the original error; this is fine for now (locking.py always returns the same error here), but in general is brittle: if locking.py would start returning more information, we'd...
Add note about developing on a production machine
This is the bit of documentation missing for issue 170. Doingdevelopment on a machine which already has Ganeti installed kind ofworks, but only when the installed and the developed version are verysimilar, and even then it can be problematic....
Fix runtime memory increases
Commit 2c0af7da which added the runtime memory changes functionalityhad a small typo (wrong name); I've rewritten this to only compute thedelta once, for simplicity.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Fix validation of vgname in OpClusterSetParams
This variable can be empty, when we want to disable LVM, so we can'tuse TMaybeString.
Fixes issue 285.
Fix removal of storage directory on shared file storage
This patch makes _RemoveDisks symmetric to _CreateDisks with respectto file-based storage: _CreateDisks uses "in constants.DTS_FILEBASED",whereas _RemoveDisks was not update and only uses "==constants.DT_FILE". This results in stale directories left on the...
Switch non-redundant check to disk template-based
Currently, the warning/notice about non-redundant instances in clusterverify is based non empty secondaries list (how old is this?); theproper way to check this nowadays is via DTS_MIRRORED.
Signed-off-by: Iustin Pop <iustin@google.com>...
Document the new --yes-do-it option for master-failover
Sorry, this should have gone in the previous commit, I forgot aboutit.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Add option to force master-failover without voting
This fixes issue 282.
Update instance modify message
Currently the message does not say explicitly that instance-initiatedreboots are useless to trigger the use of new parameters, per thethread on the user mailing list. Let's improve it a bit.
Force tap's MAC prefix to "fe"
Setting a high prefix discourages the bridge from adopting the tap'sMAC. Xen is not affected by this since the MAC is forced to"fe:ff:ff:ff:ff:ff".
This addresses issue #217.
Fix disk adoption interaction with ipolicy checks
In Ganeti 2.6, disk adoption is broken due to the ipolicy checks beingdone before we read volume size from remote nodes. We fix this bysimply moving these checks to after the disk adoption code whichupdates the disk size; it's not that nice that we fail a (almost)...
Better NEWS file for 2.6.1
Better formatting of text, past tense used when appropriate.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Update NEWS and bump version to 2.6.1
This is a small bug-fix only release.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
verify-disks: Explicitely state nothing has to be done
Example output:$ gnt-cluster verify-disksSubmitted jobs 4327Waiting for job 4327 ...No disks need to be activated.
Add list of design documents implemented in version 2.6
Each version should have its dedicated list.
Better list of replace-disks arguments + typos fixed
The man page and the bultin-in help for gnt-instance replace-disks wereinconsistent. Also fixed some typos in man pages.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
jqueue: Look at archived jobs when watching
First: This enables the use of “gnt-job watch $id” for archived jobs.
Now, the reason for actually making this work is that duringsufficiently large group or node evacuations jobs are archived beforethe client gets to poll for their output. This led to situations where...
Show old primary/secondary node on disk replacement
People unfamiliar with Ganeti's internals might be confused with thedifferent hostnames showing up later in the process.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
gnt-instance reinstall: Don't always exit with success
If one or more jobs failed the exit status should be set accordingly.
LUClusterVerify: Ignore /proc/drbd if DRBD is disabled
This fixes issue 190. The problem was that the check for DRBD wasenabled if LVM storage is used and didn't depend at all on whether DRBDis enabled.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
Fixed typos in devnotes.rst
Signed-off-by: Gintautas Miliauskas <gintas@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Always_failover doesn't require --allow-failover anymore
If an administrator sets always_failover, it means that there is no needfor another explicit approval to failover instead of migrating.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>...
bash_completion: Enable extglob while parsing file
In older versions of GNU Bash extended patterns, such as “@(…)”, are onlyavailable with the “extglob” shell option. As pointed out in [1] and [2],“extglob” must be enabled while parsing the code. Therefore the flag must be...
rpc: Remove duplicated logic, fix unittests
Commit 5fce6a89 changed RpcRunner._InstDict to add the disk parameterson all encoded instances. It didn't remove a special case in“_InstDictOspDp”. Update and fix unittests as well.
Annotate disk params on instance_start
We call _GatherAndLinkBlockDevs during the process, which in turncalls _RecursiveFindBD. This needs disk parameters to work.
See also commit b8291e0.
This was reported by Ansgar and Damien.
Signed-off-by: Constantinos Venetsanopoulos <cven@grnet.gr>...
cmdlib: Handle locking.ALL_SET correctly when copying locks
When locks are copied “locking.ALL_SET” must be handled separately(ALL_SET has the value None). Reported by Constantinos Venetsanopouloswho saw failover for RDB-based instances not working.
Fix bug in non-mirrored instance allocation
The function `allocateOnSingle' has a bug in the calculation of thecluster score used for deciding which of the many target nodes to usein placing the instance: it uses the original node list for the scorecalculation....
Fix gnt-debug iallocator
There was an issue with the recent ipolicy introduction which lead to abug in gnt-debug iallocator. It was not providing the spindle_use fieldand therefore it wont let you create a valid iallocator request.
Signed-off-by: René Nussbaumer <rn@google.com>...
Fix warnings/errors with newer pylint
To help developing Ganeti on newer distributions, let's try to fixpylint warnings/errors. I'm using pylint from current Debian wheezy:pylint 0.25.1, astng 0.23.1, common 0.58.0, and we have 3 things thatneeds fixing....
Fix decorator uses which crash newer pylint
Pylint version:
pylint 0.25.1, astng 0.23.1, common 0.58.0
crashes when passing the fully-qualified decorator name with:
File "/usr/lib/pymodules/python2.7/pylint/checkers/base.py", line 161, in visit_function...
Make stable-2.6 compatible with newer pep8
This is done so that all current branches can run with newer pep8;note that instead of fixing the problems (like I did on master), I'vejust silenced more. These should not be merged onto master!
Fix computation of disk sizes in _ComputeDiskSize
Currently, hail fails with FailDisk when trying to add an instanceof type: 'file', 'sharedfile' and 'rbd'.
This is due to a "0" or None value in the corresponding dict inside_ComputeDiskSize, which results in a "O" or non Int value of the...
Add verification of RPC results in _WipeDisks
Due to an oversight, the pause/resume sync RPC calls in _WipeDiskslack the verification of the overall RPC status, and directly iterateover the payload. The code actually doing the wipe does verifycorrectly the results. This can result in jobs failing with a hard to...
Add test for checking that all gnt-* subcommands run OK
This is a bit of a shell munging trickery, but works for now. Makingit more generic can be done later.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Fix double use of PRIORITY_OPT in gnt-node migrate
This breaks the command, as optparse considers that an error.
Add new Makefile target to rebuild the whole dist
Due to the fact how the automake system works it doesn't rebuild alreadyprebuild files in distcheck. This lead to a bug, where a rebuild of thedocumentation was failing because we missed the fact that the files were...
Add missing rst files to Makefile.am
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Release version 2.6.0 (final)
Phew, it wasn't easy, but…
Fix 'explicitely' common typo
It seems that 'explicitely' is wrong, and that the right form is'explicitly'. This is just fixing the typo plus adjusting affectedparagraphs.
Fix issue in LUClusterVerifyGroup with multi-group clusters
In case LUClusterVerifyGroup is run on a group which doesn't containthe master node, the following could happen:
- master node is selected due to the explicit check- if the order of nodes in the 'absent_nodes' list is such that the...
Add QA test for node group modification of ndparams
Additionally, we run hbal if the htools tests are enabled (newkey). Note that hbal will directly exit, since there are no instances,but at least it will load and parse the group details.
Fix node group modification of node parameters
Commit 904b3bfe tried to fix the deletion of custom ndparams fromgroup, but instead broke both modification and deletion: because werun ForceDictType on self.op.ndparams instead of the updatednew_ndparams, we can neither delete nor set properly spindle_count...
Merge commit 'v2.5.2' into stable-2.6
Conflicts: NEWS (trivial, merged the entries)...
Fix RST formatting in NEWS file
*FileID is interpreted as a start-of-bold, without corresponding endmarker. Sorry for not catching it in the first place.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Balazs Lecz <leczb@google.com>
Update NEWS and bump version for release 2.5.2
This is a trivial release, with just bug fixes, so a small change log.
Fix boot=on flag for CDROMs
This generalises commit 4304964a to cdroms too, since they havesomewhat the same logic. We just abstract the needs_boot_flag into aseparate variable, and then reuse it in the cdrom section.
Note that the logic of what 'if=' type to pass to KVM was very...
KVM: only pass boot flag once
This addresses issue 230: passing two methods of booting to KVM can,depending on the KVM version, confuse it.
Note that commit 4304964a introduced a partial fix for this (but onlyfor disks, and keyed on KVM versions). However, it didn't fix cdrom...
Ensure a stable content of the bash completion file
Currently, the order of commands in the bash completion file israndom, because the sub-commands are not sorted. This makes it harderto investigate the differences in packaged Ganeti or in installedGaneti, since chunks in this file will have a random order....
Release Ganeti 2.6.0 rc4
Prepare NEWS for Ganeti 2.6.0rc4
Another release candidate is coming.
Add some rudimentary node group ipolicy checks
Fix setting ipolicy on node groups
On node groups we don't have the std field. However, the InstancePolicyobject always verifies that the std value is within a given range. As wefill it up with defaults if not set (as it happens to be on node groups)and the min value is higher than the default std value (taken from...
Fix --no-headers for the new list-drbd command
Sorry, I forgot that with GenerateTable this needs to be handledmanually. Fixed now and tested in both ways.
(But to be honest, this should be abstracted in GenerateTable, insteadof the 'if' test in all its callers.)...
Add a simple QA test for gnt-node list-drbd
This will be run only if 'haskell-confd' QA configuration has beenenabled.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Agata Murawska <agatamurawska@google.com>
Add a new gnt-node command list-drbd
This uses confd to query the DRBD minors, which is very special; noother command currently does so.
Since the backend is only implemented in the Haskell version of confd,we have checks that 1) confd is enable, and 2) hs confd is also...
Implement a node to drbd minors query function
This can be queried remotely since it's a pure configuration query.
Add a new unused confd query
This is not implemented currently.
Add support for computing instance all/secondary nodes
This fixes an old FIXME. Since we now how actual DRBD configurationdata, we can finally compute the instance's secondary nodes.
Add disk logical ID support in Objects.hs
This is a complex field, so we have to do a lot of manual work for now.
The complexity arises from the fact that the contents of the field,and the way to parse it, depends on the disk type field, so we don'thave a single, static way of parsing it. Hence we needed the...
Fix a docstring in bdev's DRBD8 class
It seems this was not updated since the move to static minors…
Extend the Template Haskell loadFn model
Currently, we only allow field-by-field de-serialisation. Since wehave cases where information about how to un-serialise a field issplit across two JSON fields (e.g. disk type and disk logical_id,hypervisor and hvparams, etc.), we need to pass the entire object to...
Change how customFields are built
Instead of passing an expression (which cannot come from the currentmodule), we pass a name, which is allowed to reference functions fromthe module we're in. Since we currently don't have custom fields, wedon't need to modify any callers....
Implement lookup of partial names in Config.hs
This uses the recently-moved functions to implement partial lookup ofnames on getNode and getInstance, similar to the Python codebase.
Reorganise the lookup functions
Currently, the LookupResult, MatchPriority and related functions arelocate in Loader.hs, since (so far) only hbal needs them in theselection of instances. However, with the new functionality on confdside, we need these functions there too, but we don't want to import...
Remove an unused function
This is not used, as we need a more complex serialisation, which isdone in the saveObjectField function.
Ensure that disk.params is always defined (and a dict)
Commit cce46164 fixed upgrading from other 2.6 versions, butaccidentally broke upgrading from 2.5 (disk.params was left as None,which breaks FillDict). The simplest way to handle params is to always...
Another small consistency fix with if branches
While looking at the testability of this piece of code, I found anotherconsistency problem. We have two if branches instead of one, withelif's.
Fix inconsistency in the LUXI protocol w.r.t. args
This inconsistency was found during rebalancing. Hbal failed because,Ganeti couldn't load the opcode. After digging through the cause, aninconsistency with the "args" field in the LUXI protocol was triggered...
Fix UpgradeConfig of Disk object regards disk params
This bug was found during disk parameter debugging. While looking at theconfig some values seem present on the disk parameters, but that's notexpected behaviour. This patch fixes this, and also fixes the "broken"...
Make Ganeti 2.6.0 rc3 release
Allow reinstall even when secondaries are offline
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Agata Murawska <agatamurawska@google.com>
Prepare NEWS file for Ganeti 2.6.0 rc3
Update NEWS regarding rc3 fixes and document changes in behaviour.
QA updated to test instance removing when sec. is offline
Added test checking that it is possible to remove an instance with drbddisk when non-primary node is offline.
Signed-off-by: Agata Murawska <agatamurawska@google.com>Reviewed-by: Iustin Pop <iustin@google.com>...
Ignore offline node errors when removing disks
When we delete DRBD disks from some instance, we do not want to geterrors due to nodes other than that instance's primary being offline.
Allow instance disc activation with offline secondaries
Currently, this is not allowed, so one can't run a replace-disks; thisbreaks any non-invasive method of recovering the redundancy of theinstance if its disks are already stopped (but it still works if the...
RAPI regression beparams/memory fix
For compatibility with the old Ganeti version, we want to keep thebeparams/memory field around for another release. This patch fixes thisregression.
Fix redistribution of files w.r.t. offline nodes
Currently, _RedistributeAncillaryFiles computes two lists: the list ofonline nodes (for all files redistribution), and the list ofvm_capable nodes, for hypervisor-specific files. However, thevm_capable list includes offline nodes too, leading to warning...
Fix cluster verify error on master-ip-setup script
This error does not show up until we exceed the pool of mastercandidates and have nodes which are not master candidates.
The background is that we check for master-ip-setup script on mastercandidates and expect them not to be on the other nodes. However, we...
Add test helpers to .gitignore
Commit 3096524e enabled building of test helpers, but forgot to addthem to .gitignore, resulting in "unclean" git status output.
Add a Makefile rule to test unclean git status
This is trivial, but can be used easily from automated builds to checkthat the git tree is clean: files are not modified and untracked filesare not present.
Fix a typo in NEWS
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Release Ganeti 2.6.0rc2
Prepare NEWS file for 2.6.0 rc2
We are about to release another version of Ganeti 2.6, so we prepare theNEWS file with the changes from rc1 to rc2.
Add hlint warning for wrong use of 'length'
While removing split instances check from hcheck, I saw a wrong use of'length': this should only be used when one needs the actual length ofthe list, and not when one wants to check whether the list is empty or...
hcheck: reword and fix typo in instance/offline msg
hcheck: rework output mode
Looking at the output of hcheck, in human readable mode, it looks likeit always starts with a blank line. This is not nice, so I wanted toredo this to start cleanly.
However, looking at the code, I realised that we need some internal...
hcheck: add two simple type aliases for readability
The same types are reused a couple of times, so let's add a couple oftype aliases for easier change later and readability.
Update time on Haskell binaries after build
This patch works around an issue in our build system. Since we don'tuse cabal or 'ghc -M', we don't track actual dependencies in ourMakefile; this in turn means that editing a file that only is used inthe main 'htools' binary will keep triggering 'ghc --make' for the...