gnt-group: Add info command
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
cli: Make FormatParameterDict recursive
This is useful if you have nested parameter dicts like in diskparams.
query: Expose diskparamters through query
gnt-cluster info: Print and format disk parameters
Merge branch 'devel-2.5'
Merge commit 'v2.5.1' into devel-2.5
Remove some duplicate code in the Xen config writing
Should be straightforward; the only difference from before is that wewill remove the 'auto' file even during migration finalise.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Fix gnt-group --help display
Copy-paste mismatch :)
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>(cherry picked from commit 36c70d4ddc508dd1ffdcc806d617d5100f4cb265)
Signed-off-by: Iustin Pop <iustin@google.com>...
Fix hardcoded Xen kernel path
We already have a ./configure-time variable for this, but it seems tobe actually unused.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>(cherry picked from commit 3c4afa2e93d9499ce39c1aed575dacb549d35083)...
Fix grow-disk handling of invalid units
The reason why grow-disk was doing:
$ gnt-instance grow-disk instance3 0 -64Unhandled Ganeti error: Invalid format
Is because it does it's own ParseUnit call, and doesn't transform thatinto a nicer message.
Accept both PUT and POST in noded
This is a partial cherry-pick from7530364ddbe949bc34fc26f25ba3f5d921beb021 on master:
Currently, noded requires PUT, even though the semantics of the RPCcalls do not match a PUT. We change the code accept both PUT and POST,...
Update synopsis for “gnt-cluster repair-disk-sizes”
Mention that instances can be passed on the CLI when “--help” is used.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Andrea Spadaccini <spadaccio@google.com>(cherry picked from commit eb5ac108d146644200df98b9f90dae003dcea426)...
Workaround changed LVM behaviour
The vgreduce command has changed behaviour from when we initiallywrote the code (2.02.02 versus 2.02.66, 4 years delta):
- if there are LVs which will be impacted, it requires --force- otherwise refuses to proceed, but it still returns exit code 0...
apidoc: Fix some typos and errors introduced by my previous patches
bdev: Add a guard to verify disk parameters are set
LUGroup*: Fix inheritance of disk parameters
bdev: Take the params directly from disk without refill
Special case blockdev_find
Similiar to blockdev_create we sometimes do find on children. This fixesthose cases. However, this is not very nice.
Special case blockdev_create
This is due to the nature of bdev. We spread some logic into cmdlib anddeal for example with it's children recursively. This makes it hard toannotate the disk parameters in a generic way as we don't always dealwith the top most disk. But the disk parameters are depending on the top...
cmdlib: Adding annotation helper for special cases
cmdlib: Remove all diskparams calculations not required anymore
cmdlib: Adapt the rpc calls
The following (blockdev) RPC calls are not converted yet (as they arenot straight forward or need more research):
rpc: Adapt the callbacks to the new encoder type
We change the cmdlib side on the next patch.
rpc: Adding new encoders for annotating disk parameters
rpc: Adding helper to annotate disk params
config: Adding convenience method for disk parameters
objects: Add helper function to fill disk parameters
Add a default PATH variable to OS scripts env
In commit 896a03f6 I cleaned up the environment for OS scripts,however I think that was a bit too extreme - it breaks our owninstance-debootstrap hooks, because for example dpkg (called from thegrub script) requires PATH to be set....
Move hooks PATH environment variable to constants
Move the contents of the PATH environment variable for hooks toconstants, and use its value in the code and in the hooks documentation.
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>...
Fix exception re-raising in Python Luxi clients
Commit e687ec01 (present in 2.5 since the 2.5 beta 3) did consistencyfixes across the code-base. Unfortunately this was done without enoughchecks on the actual meaning of one of the fixes, which means error...
Allow clock skews in certificate verification
Currently we allow for up to NODE_MAX_CLOCK_SKEW time differencebetween nodes in some operations, but not everywhere: SSL certificateverification (import/export, both intra and inter-cluster) has a zerolimit (downwards), and a week upwards. This can cause even...
Correct capitalisation of two Luxi calls
Two Luxi calls have inconsistent an name/value mapping (in the Pythoncode):
- REQ_AUTOARCHIVE_JOBS versus AutoArchiveJobs (versus AutoarchiveJobs)- REQ_QUEUE_SET_DRAIN_FLAG versus SetDrainFlag (no Queue)
While these are only a consistency issue, let's fix them so that the...
Fix LVM volume listing with newer LVM
Per commit 0304f0e, newer LVM has extended the lv_attr field. However,that commit was incomplete as we examine this attribute in anotherplace in the code.
Thanks to user alperhome, the _LVSLINE_REGEX in lib/backend.py also...
Make setup-ssh behave more friendly
So while testing my previous patch I run setup-ssh manually withoutany arguments, and it did nothing (no complains, no messages,anything). That was very surprising, so let's make it behave better ifno nodes are passed....
Add more RAPI test utilities
This patch adds a mock RAPI client to test input values to methods. Allmethods either raise an exception if there was a problem or return None.Third-party code can use this to test their input values to the RAPIclient.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
rapi.testutils.FakeCurl: Add header support
With this patch headers are constructed from the PycURL optionsand passed to the mock implementation.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Move _FakeCurl from tests/ganeti.rapi.client to ganeti.rapi.testutils
This is preparation for the mock system, where we need the same cURLmock.
Signed-off-by: René Nussbaumer <rn@google.com>Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
errors: Add exception for RAPI testing utilities
This exception is raised to abort before actually sending a LUXI call(there is no LUXI server involved in the test). The testing utilitiescatch the exception to report a success (i.e. the code didn't throw...
luxi: Add list of all requests
This will be used in a unittest for RAPI testing utilities.
server.rapi: Factorize RAPI user loading
By moving the code loading RAPI users from a file into a standalonefunction it becomes easier to use the RAPI request handler intests.
RemoteApiHandler: Add support for mocked LUXI client
This will be used for providing a type-checking RAPI client for tests.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add absolute grow-disk mode at CLI level
Add 'absolute' grow-disk mode at OpCode/LU level
This also improves the log messages for the (default) relative mode("by %s to %s").
Ensure that the grow disk amount is positive
The CLI currently doesn't permit this, but a direct job submissionwould allow it.
Log all external commands execution
This logs all external commands in normal (non-debug) mode. This willleak the DRBD secrets, but in any case we do log failed commands, soit's not a significant change.
Change CertificateError to subclass GanetiApiError
Signed-off-by: Chris Schrier <schrierc@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add opcode parameter descriptions
Fixes QA after commit cfdf561dade7.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Chris Schrier <schrierc@google.com>
Stop acquiring BGL for LUXI queries
Short description: This fixes an issue whereby masterd would becomeunresponsive on the LUXI socket, leading to client timeouts. While madeworse in 2.5, the underlying issue was already present in 2.4.
Longer description: Until now all LUXI queries would acquire the BGL...
Convert LUClusterConfigQuery to query2
The main intention of this patch is to make it possible to retrievecluster tags via query2. While at it I decided to convertLUClusterConfigQuery right away. Some of the values returned byLUClusterQuery are also included, but the conversion of LUClusterQuery...
Stop using locks in LUXI "QueryTags"
Also mark it as deprecated in NEWS as normal queries can be usedinstead.
Remove unused constants
These are not used anywhere in Python or Haskell.
Convert listing exports to query2
This solves one case where locks are acquired during LUXI queries.Pretty late into the transition I noticed that OpBackupQuery had a“use_locking” parameter for a long time, but didn't use it. Sincemost of the other changes were already and this allows exports to...
utils.algo: Use str.isdigit instead of regular expression
str.isdigit is about 4x faster than using a regular expression ("\d+").This is in the inner sorting code so speed matters.
$ python -m timeit -s 'import re; s = re.compile("^\d+$")' \'s.match(""); s.match("Hello World"); s.match("1234")'...
Include PycURL error code in GanetiApiError.
Signed-off-by: Chris Schrier <schrierc@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Drop objects.QueryRequest
It was only used in one place and wasn't really necessary.
gnt-os modify: Add "--submit" option
gnt-node: Add "--submit" and "--priority" to commands
gnt-instance: Add "--submit" and "--priority" to commands
gnt-group: Add "--submit" and "--priority" to commands
gnt-cluster modify: Add "--submit" option
gnt-backup: Add "--submit" to two commands
Fix error in opcode result processing
LUXI queries are processed without callbacks (seeserver.masterd.ClientOps._Query). With commit 07923a3c the logic forchecking an opcode's result for jobs to submit was changed andsubsequently raised an exception (“'NoneType' object has no attribute...
Add "show" as alias for "info" to gnt commands
This patch adds support for "show" as an alias for "info" tognt-(cluster|instance|node|os). It already exists in gnt-job.
Signed-off-by: Alexander Schreiber <als@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Copy debug level, priority and set comment for LU-generated opcodes
Before this patch, a node evacuation submitted with high priority wouldonly compute the solution at that priority, but the actual evacuationran at normal priority.
gnt-job list: Add options for commonly used filters
While “gnt-job list” would also accept filters on the command line (e.g.“'status == "error"'”, having shortcuts in the form of options comes inhandy.
gnt-* {add,list,remove}-tags: Unify options
- Listing tags is a query, so neither “--priority” nor “--submit” make sense- Support both options for adding/removing tags- Also remove “--submit” from “gnt-node health”; it doesn't work and doesn't make sense for listing node health...
Merge branch 'stable-2.5' into devel-2.5
Merge branch 'devel-2.4' into stable-2.5
Fix extra whitespace
Sorry, didn't catch this before…
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>(cherry picked from commit 54b010cad1ea0a536ed037bf315a04dd1c079964)...
Further fixes concerning drbd port release
Commit 3b3b1bc does not entirely fix the bug introduced in commitf396ad8. It fixes consistency of config data in permanent storage, butdoes not ensure consistency in data held in runtime memory of masterd.
The bug of duplicate ports is still triggered when LUInstanceRemove()...
Fix a bug concerning TCP port release
Commit f396ad8 returns the TCP port used by DRBD disk back to theTCP/UDP port pool using AddTcpUdpPort().
However, AddTcpUdpPort() writes the config on every invocation,using _WriteConfig(). This causes two problems:...
gnt-job list: Switch to query2
This brings “gnt-job list” up to the same level as “gnt-instance list”with filters. Further updates will add more parameters for the mostcommon filters (e.g. only running jobs).
Also update the man page.
gnt-job info: Convert to query2
Otherwise detecting unavailable jobs is hard (“status” is None, is thisan error or just an unavailable job?).
Add job support to query2 via LUXI
This enables the use of filters through query2 when listing jobs.
jqueue: Cache prepared field list in _JobChangesChecker
… instead of re-calculating it on every file change.
NEWS: Deprecate LUXI calls replaced with query2
Adding the “luxi” namespace is necessary in “sphinx_ext”.
jqueue: Convert GetInfo to query2
This rather inefficient implementation (fields are evaluated on everycall to GetInfo) is not good for WaitForJobChanges and doesn't supportfilters, but that will be rectified in later patches.
query: Add definitions for job fields
qlang.MakeFilter: Enable use of different name field
Jobs don't have a “name” field, so we must be able to controlthe field used for simple filters.
Merge cli.FormatTimestamp and utils.FormatTime
… to some degree at least. Unittests are included.
constants: Don't hardcode priorities for LOCK_ATTEMPTS_TIMEOUT
Also include unittest for LOCK_ATTEMPTS_TIMEOUT.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
jqueue._QueuedOpCode: Change a docstring
There was a typo and it's not necessary to repeat the class name.
locking: Remove unused OldStyleQueryLocks
No longer used after commit 090377807.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
LUOobCommand: acquire BGL in shared mode
Fixed a typo so that now LUOobCommand acquires the BLG in shared mode, asintended.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
LUNodeAdd: Make the version call only dependend on DNS
Also move the version check into prereq to abort before alter clusterstate if the version mismatch.
RPC: Add a new client type for DNS only
This patch moves the “call_version” to a new RPC client definition andthen adds a new runner using the DNS resolver for getting the hostaddress.
The standard “BootstrapRunner”, where the call was before, tries to...
Update default instance kernel version
We switch from vmlinuz-2.6-… to vmlinuz-3-…. To do this nicely, wealso add a ./configure-time setting for the KVM instance kernel.
Fix escaping of percent signs in the shell lexer
Of course, we do have cases where we want to escape the percent signs,and our regexes were not fully correct for this case.
Add a special lexer for sphinx/pygments
This will be used throughout our docs for better formatting exampleshell sessions, with custom markup for comments, user fixed input anduser variable input.
Fix docstring bug
Fix a typo introduced in commit c85b15c1, which breaks epydoc.
LUNodeAdd: Verify version in Prereq
There are other ways to leave the cluster in a broken state than justthe version check. However they are not very trivial to fix in 2.5. Soleave it up to 2.6 for a nicer fix.
Signed-off-by: René Nussbaumer <rn@google.com>...
Fix LV status parsing to accept newer LVM
LVM version 2.02.93 (or at least, sometimes after .88) has extend thelv_attr field with two more flag; we only care about the first digit,so let's change the "!= 6" check to "< 6".
Thanks to Robin H Johnson <robbat2@gentoo.org> for finding this issue....