gnt-job cancel: Confirmation and selection of jobs
New parameters, “--pending”, “--queued” and “--waiting”, are added toselect all jobs in the respective state. If one of those options is usedand “--force” is not given, the user is asked to confirm the operation....
Enable query socket usage in gnt-node/gnt-group
This switches gnt-node/gnt-group (and their equivalent RAPI resources)to go over the query socket.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Merge branch 'devel-2.6'
gnt-job list: Add option to include archived jobs
This provides a convenience option to include archived jobs in theoutput list. It's equivalent to using “-o +archived”, but tab completionis nicer.
Signed-off-by: Michael Hanselmann <hansmi@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.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add basic unit tests for "gnt-cluster epo"
This patch adds some unit tests for “gnt-cluster epo”. Not everything iscovered, but at least the bug fixed in the previous patch is.
Fix pylint breakage due to unused var in gnt_cluster
The usage of that variable was removed in 45a36f36, but accidentallythe enumerate() was left in.
cluster epo: Fix bug where IndexError is raised
Updating the “node_query_list” variable would fail if no arguments werepassed and the “--all” option wasn't specified. A follow-up patch willadd unit tests.
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>
gnt-instance reinstall: Don't always exit with success
If one or more jobs failed the exit status should be set accordingly.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Remove option to select the Python version of confd
This will need some more configure.ac checks for required libraries,which will come later with the Haskell dependencies reorganisation.
Pylint cleanup
The previous commits introduced some pylint errors.
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Modify batch-create to use MultiAlloc
This is the CLI part of the OpInstanceMultiAlloc change. There is someroom for improvement especially with user handling, but it works for nowand the code got simplified significantly.
QA tests still needs to be written....
Stop hardcoding root user
Some parts of the code still use a hardcoded user name: root. This patchreplaces all with a constant specified at build time. The end goal is tomake it possible to run a Ganeti cluster without any special privileges(of course this will prevent some functionality from working)....
Migrate lib/client/*.py from constants to pathutils
File system paths moved from constants to pathutils.
Adapt gnt-debug iallocator
Add the new multi-alloc request to the test allocation framework. Fornow we just create --count identical instances. This might need furtherimprovements later.
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Merge branch 'devel-2.6' into submit
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Agata Murawska <agatamurawska@google.com>
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>...
Complete and enable the haskell QueryClusterInfo call
Since we have now access to all cluster parameters, we can "fill" theparameters, and can finally enable it in CLI/RAPI.
Add configure-time switch for split queries
And expand cli.GetClient() to allow opening the query socket, insteadof the main master socket.
Finally, enable the query socket use in gnt-cluster version, sincethat is already implemented fully in Queryd.hs/hconfd....
Bump pep8 version to 1.2
Debian Wheezy will ship with this version, and it has many improved checks compared to 0.6, so let's:
- bump version in the docs- silence some new checks that are wrong due to our indent=2 instead of 4- fix lots of errors in the code where the indentation was wrong by 1...
Fix double use of PRIORITY_OPT in gnt-node migrate
This breaks the command, as optparse considers that an error.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Switch job IDs to numeric
This has been a long-standing cleanup item, which we've alwaysrefrained from doing due to the high estimated effort needed.
In reality, it turned out that after some infrastructure improvements(the previous patches), the actual job queue-related changes are quite...
Expand debug messages in gnt-debug test-jobqueue
It wasn't clear for which tests we were ignoring the errors.
Fix uses of OpPrereqError without code info
A while back, we did cleanup the code and ensured (manually) that useof OpPrereqError includes an errors.ECODE_* field as secondargument. Since we cannot automate the check for this, it turns outthat more and more such usage has crept over the years, including in...
Front-end and doc to use allocator in recreate-disks
The recreate-disks command no longer requires an explicit list of nodes.
Signed-off-by: Adam Ingrassia <api@google.com>Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Merge branch 'stable-2.6'
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 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...
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).
Allow param `modify' during gnt-instance modify
With the new gnt-instance modify syntax for addition and removal ofdisks/NICs on arbitrary indexes, we hit an assertion if the userpasses `modify' as one of the disk's parameters. E.g::
gnt-instance modify --disk 2:modify,size=3G instance1...
gnt-group: Adding vcpu/spindle ratio to ipolicy flags
gnt-cluster modify: Add ipolicy for spindle ratio opt
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....
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).
Signed-off-by: Iustin Pop <iustin@google.com>...
gnt-group: Add info command
gnt-cluster info: Print and format disk parameters
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.
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 absolute grow-disk mode at CLI level
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...
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
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>
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.
Merge branch 'devel-2.5'
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...
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?).
gnt-instance info: Show node group information
This requires acquiring the node group locks in shared mode.
EPO: Pass the no_remember parameter to preserve state
Update gnt-node evacuate man page/help text
Fix gnt-group --help display
Copy-paste mismatch :)
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Merge remote-tracking branch 'origin/devel-2.5'
Conflicts: Makefile.am (trivial, test data files added on both branches) lib/opcodes.py (trivial, master renamed filter→qfilter, 2.5 fixed the type of the parameter)...
Replace single- with double-quotes
In at least two cases "%s" is replaced with str(), too.
gnt-instance modify: Support new-style NIC/disk modifications
This patch adds support for adding/removing NICs/disks at arbitraryindices on the command line. To add a disk at a specified index, use“--disk 3:size=16G”. To remove the second disk, use “--disk 2:remove”....
Merge branch 'stable-2.5' into devel-2.5
OpInstanceSetParams: Merge {off,on}line_inst parameters
Instead of having two separate parameters, a single boolean parameter isused. Unfortunately we need a third state to say “no change”, so thevalue can be None, True or False (similar to other parameters). There...
Fix explanation of gnt-node evacuate --primaries-only
Furthermore, correct the --help display on evacuate.
cli/opcodes: add a --no-runtime-changes migrate opt
This will be used for now to avoid ballooning memory at live migration time.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Fix gnt-cluster modify check of passed options
… and add the disk_templates/vcpu_ratio new entries. Since the defaultispecs_* are dicts, we can't compare them to none.
Additionally, add a QA test for this case (empty cluster modify).
Add ipolicy_vcpu_ratio to command line
This allows changing this value from the command line.
Add new ipolicy parameter vcpu_ratio
This adds the new parameter and changes the validation routines tohandle IPOLICY_PARAMETER value as floats. Very very ugly code :(,should be redone much cleaner.
Rename IPOLICY_PARAMETERS to IPOLICY_ISPECS
As opposed to the initial situation, the PARAMETERS will be more thanjust the min/std/max ispecs. Let's rename it, before re-adding thePARAMETERS constant with a different meaning.
gnt-instance recreate-disks: Allow specifying new size
With this change a new disk size can be specified when recreating disks.
Rename ispecs-disk-templates to ipolicy-disk-templates
The ispecs (min/std/max) are different from the other ipolicyvariables (disk templates for now, more in the future). As such, let'srename the ispecs-disk-templates to ipolicy-disk-templates forconsistency with this logical difference....
gnt-cluster command: Add option to prepend node name to output
With this patch a new option (“-M”, like dsh) is added to “gnt-clustercommand” to prepend the node name to all output lines.
$ gnt-cluster command -M uname -a | grep Linuxnode18.example.com: Linux node18.example.com [...]...
gnt-instance modify -m|--runtime-memory
gnt-instance: Adapt replace-disks to the new opcode
Further fixes to instance policy validation
As a followup from "Remove extraneous check in policy creation", thereare more places where we build an ipolicy, and then manually check forits validity. This is very bad style, as it duplicates theverification code across many places....
Add new disk_templates parameter to instance policy
This is a bit more complex patch, as it requires changing theassumption that all keys in the policy dict points to values that arethemselves dicts. Right now we introduce an assumption that anynon-dicts are lists, we'll see in the future if this holds or whether...
Remove extraneous check in policy creation
The values are already checked in CreateIPolicy, no need to manuallycheck them again.
Move the instance specs options to cli.py
Currently these are defined twice, instead of a single time incli.py. Also adds the new disk_templates option to the common block,even though it's not yet used.
Fix wrong variable name
Commit bc5d0215 added support for disk params, but due to copy-pasteit tries to enforce the hvparams into disk params values, leading to:
$ gnt-cluster modify -H kvm:initrd_path=/boot/initrd-2.6-kvmUParameter Error: Unknown parameter 'initrd_path'...
gnt-node: Add instance policy to migrate
gnt-backup: Adding force option to import
This makes it possible to bypass the instance policy
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
gnt-instance: Adding instance policy to add
gnt-instance: Adding verification of instance policy to modify
gnt-instance: Adding instance policy to move
gnt-instance: Adding instance policy to migrate
gnt-instance: Adding instance policy to failover
Update GrowDisk docstring
It forgot about one argument.
gnt-node: Add hv/disk state to add
gnt-group: Add hv/disk state to add
gnt-cluster: Add hv/disk state to init
mem_count is now mem_size everywhere
Signed-off-by: Agata Murawska <agatamurawska@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
GroupSetParam supports instance policy changes
Signed-off-by: Agata Murawska <agatamurawska@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
AddGroup supports instance policy
Cluster-level instance policy - other
SetClusterParams supports instance policy changes
InitCluster supports instance policy
Instance policy command line support
Restore diskparams in the gnt-group options check
Commit a82823 accidentally removed opts.diskparameters from the list ofparameters that are checked for presence in gnt-group, thus causinginvocations of gnt-group modify with only disk paramaters to fail....
Add new back-end parameter "always_failover"
Instances that have this parameter is set to True are never migrated, butinstead they can only fail over. There are some cases where freezing thekernel may cause problems, and hence this behavior is preferable....