History | View | Annotate | Download (136.6 kB)
Provide means of submitting jobs to a drained queue
During an upgrade, the job queue needs to be drained in order to avoidnew jobs coming to the cluster. Nevertheless, the upgrade processneeds to carry out some maintenance, like redistributing the new...
Merge branch 'stable-2.9' into master
Merge branch 'stable-2.8' into stable-2.9
Add a default to file-driver when unspecified over RAPI
The file-driver value, used by file-based instances, had a default value whenan instance was being created over the CLI, but not when the instance wascreated through the RAPI.
This patch introduces a default value for the remote API and, while doing so,...
CLI: actually remove the --no-drbd-storage option
This removes the '--no-drbd-storage' option completelyfrom the command line interface. The hugepages designdoc still had a left-over reference to --no-lvm-storage,which is removed in this patch as well....
Fix opcodes and parameters
Add cleanup parameter to instance failover
Most of the code is shared with instance migrate, so we actually only needto add the parameter and pass its value along the the common code.
Also, tests and harep are updated to support the right set of options to...
gnt-cluster modify --shared-file-storage-dir
This patch introduces to 'gnt-cluster modify' the option'--shared-file-storage-dir' to change the default directoryfor instances using shared file storage at cluster runtime.
Signed-off-by: Helga Velroyen <helgav@google.com>...
gnt-cluster {init, modify} --file-storage-dir
This patch implements consistent usage and behavior ofthe --file-storage-dir option in 'gnt-cluster init'and 'gnt-cluster modify'. It includes a bunch of unittests as well.
Additionally, it enables the previously written unit...
Merge branch 'stable-2.8' into master
Add --modify-etc-hosts option for CLI tools
The option will be used by gnt-cluster modify in the following commit.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Make SubmitOpCode expect options without print_jobid
As opposed to SubmitOrSend, the SubmitOpCode function iscalled also by commands not supporting submit options. Henceonly inspect these options, if they are actually present.
Signed-off-by: Klaus Aehlig <aehlig@google.com>...
Add an option to print job id of submitted jobs on stdout
When submitting a job, the job id, prefixed by 'JobID: ', is output tostderr. While this is easy to understand for humans, for scripting, itis more convenient to have (additionally) the id on stdout (and only...
Add "spindles" option to instance disk creation commands
The option is parsed but ignored, for the moment.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Thomas Thrainer <thomasth@google.com>
Disk templates are "allowed" and not "enabled" in ipolicies
The way disk templates were displayed in instance policies became confusingsince the introduction of the enabled_disk_templates cluster parameter.
Fix issue 440.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>...
Add command-line support for multiple specs in ipolicy
Command line options accept multiple min/max specifications in instancepolicies. The output of show-ispecs-cmd is updated accordingly.
Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
Add multiple min/max specs in instance policy
Now instance policies can contain more than one min/max specs. This is themain element of the "Constrained instance sizes" section in the"Partitioned Ganeti" design doc.
This is a big patch, but changing the type of a configuration item requires...
Limit specs in ipolicy command lines are always complete
Command line options are brought in line with the specs change of previouspatch. Old options are still allowed in gnt-cluster init, where thesemantic will remain non-ambiguous even after introducing multiple specs....
Limit specs in instance policies are always complete
Specs used to specify limits in instance policies are always complete, evenat group level (only the whole limit set can be overridden). This is inpreparation for introducing multiple limits.
Add --ipolicy-xxx-specs options
These options allow to specify whole instance policy specs. This is neededfor the upcoming changes that tend to threat specs as monolithic objects.
Add command to print ipolicy options
The output of this command can be used to create an exact copy of thecurrent instance policy specs. The command could be expanded to print allthe options used to create a group or the cluster.
New CLI input type: list of key/value pairs
This will be used for the new instance specs options.
Allow "default" as a value for ipolicy templates
Previously the string value was being corrupted.
Add the reason trail to the opcodes
The reason trail is available for all the opcodes, and as such it isinitialized as a generic option.
Provide "--reason" as a parameter for all commands
Remove old "reason" implementation
Remove the useless parts of the old, partial, implementation of the support fortracking the reason of instances state change, before implementing the newreason trail support, as per the design document.
Signed-off-by: Michele Tartara <mtartara@google.com>...
Removes obsolete 'enabled storage types'
Since managing of different storage units is now done usingdisk templates and not storage types, we remove the obsoleteenabled storage types.
Signed-off-by: Helga Velroyen <helgav@google.com>Reviewed-by: Michele Tartara <mtarara@google.com>
gnt-cluster modify: modify enabled disk templates
Adds setting of the list of enabled disk templates to 'gnt-cluster modify'.Note that this does not yet include any verification regarding disk templatescurrently used by instances.
Remove unused code
After changing the way gnt-xxx info print their output,cli.FormatParameterDict() is not used anymore.
Refactor out function to format instance policy
The new function can be used for group-level instance policies. Support forroman numeral formatting has been dropped to make the code simpler. Forother info items it's already unsupported, and it's not exactly documented...
Add option --new-primary to gnt-instance modify
Extend gnt-instance modify by a new parameter --new-primarythat sets the pnode paramter of the opcode.
Signed-off-by: Klaus Aehlig <aehlig@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Refactor ispecs in ipolicy structures
Minimum and maximum instance specs are put together into a single elementof the instance policy. This is in preparation for introducing multiplemin/max specs.
Refactor cli.CreateIPolicyFromOpts()
The code relative to instance specs has been moved into a differentfunction. This in preparation for further patches to have a more clear codestructure.
Remove duplicate filling of instance policy
Instance policy fields were manually filled in CreateIPolicyFromOpts() andthen filled again by the caller. Now they are filled once inside thefunction.
Generic function to print data for gnt-xxx info
The function produces a human-readable output, which is also a valid YAMLfile, from an intermediate data structure. This will be used by "gnt-xxxinfo" commands. The output of "gnt-xxx info" was almost YAML-compliant, and...
gnt-cluster modify: dis/enabling storage types
This patch extends the 'gnt-cluster modify' command to manipulate the listof enabled storage types. Note that this currenlty does no validationwith respect to whether or not there are instances currently using a storage...
Add option to redirect luxi socket for debugging
Currently, the choice between masterd and conf/queryd is madestatically, based on whether a query is converted or not and whethersplit queries are enabled. This makes it hard to test and developthese new queries, so this patch adds an override for the socket....
Infrastructure for specifying instance status change reason
This patch introduces some infrastructural modifications that will be used bythe following commits to implement the support for specifying the reason forthe last status change of an instance....
Remove network_type slot (Issue 363)
This slot was not used by Ganeti so the same info can beprovided via tags. In order not to break configuration datawe add a FromDict() method in Network config object thatremoves the deprecated network_type (if found) and then invoke...
Show correct daemon name on Luxi connect errors
Since now confd also serves a Luxi endpoint, the current message incli.FormatError is misleading when actually failing to connect toit. The patch adds a somewhat hackish way to show the right daemonname....
Add the gnt-storage client
Add a new client called 'gnt-storage'.The client interacts with the ExtStorage interface, similarly tothe way gnt-os interacts with the OS interface.
For now, only two commands are supported: 'info' and 'diagnose'.
'diagnose' calculates the node status of each provider on each node,...
gnt-* list-fields: Show friendly field type
For people writing query filters (documented in ganeti(7)) knowing a field'stype can be useful.
$ gnt-instance list-fields name be/memoryName Type Title Descriptionname Text Instance Instance name...
Replace frozenset with compat.UniqueFrozenset
This is not a trivial s/frozenset/compat.UniqueFrozenset/, but ratheronly replaces “frozenset” where appropriate. Most of the places are“static” information that doesn't change after the module has beenloaded....
Allow ignoring successful commands in "gnt-cluster command"
In some cases it is useful to ignore the output of and avoid mentioningsuccessful commands. One would be when looking for a certain string ina file:
$ gnt-cluster command egrep -q '^testing$' /etc/......
Fixes to pass pep8 (make lint)
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Reviewed-by: Iustin Pop <iustin@google.com>
Add tags in network objects
Support: - gnt-network add --tags. - gnt-network list-tags/add-tags/remove-tags/. - gnt-network list -o +tags
Introduce client support for networks
gnt-network is used to manipulate and handle networks that currentlyprovides the following operations:
Modify instance client to support networks
Add --no-conflicts-check option.Modify instance query methods to return nic's network info.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>Reviewed-by: Iustin Pop <iustin@google.com>
Move gnt_cluster.SHOW_MACHINE_OPT to cli
This allows the option to be re-used in other places.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
cli.py: use None as name for tag operations on the cluster
This change is mostly cosmetic. Previously, the literal "cluster" wasused for the 'name' field of tag operations on the cluster (as opposedto a node or an instance). Since this field has a type of TMaybeString...
cli: Use callback for --priority
If the option is used elsewhere, the numeric value is directlyavailable.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
Merge branch 'devel-2.6'
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
cli: Fix small typo
s/it/if/
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Dato Simó <dato@google.com>Reviewed-by: Helga Velroyen <helgav@google.com>
cli: Stop hardcoding /etc/hosts path
There is a constant for this purpose.
cli: Exit with status 0 for --help
This patch is somewhat longer than was anticipated. Before, commands like“gnt-instance --help” would exit with the status code 1 (failure). Withthis patch, those commands exits with 0 (success) while unknown commandsstill print the usage screen and exit with status 1....
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/cli.py from constants to pathutils
File system paths moved from constants to pathutils.
Enable tags query over the query socket
This patch adds the tags field to the objects which were missing it(all except Cluster), implements handling the LuxiCall QueryTags, andthen enables the use of the query socket in cli.ListTags, used by allcommands, and in the RAPI client....
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...
Add infrastructure for building numeric namefield filters
Currently, all the CLI helpers in qlang.py and cli.py assume that allnamefields are string, which leads to various breakage in case the'reactually not.
To improve the flexibility of the helpers, we add a bit of...
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...
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).
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
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.
_MaybeParseUnit: The elements are dicts not arrays
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Make it possible to reset vcpu/spindle ratio to default
cli: Add ipolicy_spindle_ratio to CreateIPolicyFromOpts
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).
Signed-off-by: Iustin Pop <iustin@google.com>...
cli: Make FormatParameterDict recursive
This is useful if you have nested parameter dicts like in diskparams.
Add absolute grow-disk mode at CLI level
Signed-off-by: Iustin Pop <iustin@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.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
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...
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.
cli: Handle negative numbers when parsing key-value assignments
To remove the last disk, or to add a NIC to the end, one can use theindex 1. This wouldn't work as intended as “” is a special prefix.
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>
Add ipolicy_vcpu_ratio to command line
This allows changing this value from the command line.
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....
Unbreak build after merge 2ea64524ce
Conflicts: lib/cli.py - trivial lib/cmdlib.py - merge new condition
Signed-off-by: Guido Trotter <ultrotter@google.com>...
cli: Log fully quoted command line
Instead of logging the concatenated arguments, with this patch everycommand will properly quote its full command line. This makes it easierto just copy-and-paste commands from “commands.log” to re-run them. Alsoremove a case of “x = a or b” for non-boolean values....
Revert "cli: Disable abbreviation matching for options"
This reverts commit 232aab3f4f602a19f1226e85c3a3ecb245d60af4. Weshouldn't change the parsing of command line options in the middle ofthe 2.5.x series.
cli: Disable abbreviation matching for options
Python's “optparse” module does option name prefix matching by default.Since this can lead to confusing behaviour, e.g. by specifying “--force”for a command which only has a “--force-multi” option, this patch...
gnt-instance modify -m|--runtime-memory
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.
Add a new disk-template ipolicy option
Add a new CLI option type 'list'
This simply splits the value in the option parser, instead of needingto do it in the client code.
gnt-instance: Adding instance policy to add
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
gnt-instance: Adding instance policy to failover
Fix parameters for QueryJob in JobExecutor
When gnt-job submit is used with the --each option, it sends asparameters for QueryJobs a list of lists, each containing a job ID.While this works now, it is not the intended format for QueryJobs.
This patch fixes this behavior, by making it send a list of job IDs....
Instance policy command line support
Signed-off-by: Agata Murawska <agatamurawska@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
cli: Add common command flags for hv/disk state
Add basic support for disk parameters
objects.py: * add disk parameters to Disk, Cluster, NodeGroup.
constants.py: * add dictionaries that will hold types and default values for disk parameters (for now, empty).
test/ganeti.constants_unittest.py:...
Remove BE_MEMORY from beparams but keep compatibility
Queries are already compatible (be/memory is an alias for be/maxmem) andimport/exports work. This patch patch fixes it for cluster init, modifyand instance add/start/modify.
Transition into and out of offline instance state
Add --use-external-mip-script flag
- add a command line flag to gnt-cluster init and modify to change the value of the cluster parameter use_external_mip_script;- add two constants representing the paths of the default script and of the external script;...