History | View | Annotate | Download (99.3 kB)
cli: Add option to force names to be treated as filter
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
cli: Add support for parsing query filters
cli: Error reporting for query filter parsing
cli: Replace hardcoded strings with constants
Merge branch 'devel-2.4'
gnt-instance migrate: Adding --allow-failover option
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Clarify --force-join parameter message
This isn't only used during cluster merge.
Signed-off-by: Stephen Shirley <diamond@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
constants: Rename QR_OP_*, add QR_VIA_RAPI
Commit 28b71a76 added a list of resources which can be queried usingLUXI. Unfortunately the variable was named “QR_OP_LUXI”, which can beconfusing. This patch renames “QR_OP_QUERY” to “QR_VIA_OP”, “QR_OP_LUXI”...
cli.py: Adding POWER_DELAY_OPT
The command line option --power-delay sets the time waited between powerons.
CLI changes to facilitate shared storage migration/failover
Add DST_NODE_OPT to cli.py to use for directly specifying the target nodeduring migration/failover.
gnt-instance failover/migrate also get passed an iallocator option.
gnt-node failover/migrate get only a target_node option....
Core shared file storage support
This patch introduces core file storage support, consisting of the following:
A configure-time switch for enabling/disabling shared file storagesupport and controlling the shared file storage location:--with-shared-file-storage-dir=. Shared file storage configuration is then...
gnt-* list-fields: Show field description
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Move OOB_TIMEOUT_OPT to cli.py
OOB commands where we need to be able to specify the timeout areenhancing over the border of just gnt-node so we move it into cli.pyfor easy reuse in other cli parts.
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add unittest for cli.FormatResultError
Also make the parameter for verbosity mandatory.
Change the list formatting to a 'special' chars
And also enable verbose display via the, well, verbose option. Manpage and tests are updated, and the formatting is moved from 4 ifstatements to a data structure.
Signed-off-by: Iustin Pop <iustin@google.com>...
Add --force-join option to gnt-node add
This is needed so cluster-merge can add nodes from other clusters.
Signed-off-by: Stephen Shirley <diamond@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>...
Fix handling of ^C in the CLI scripts
This adds a message and nice handling of ^C, especially useful for``gnt-job watch``.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
utils.SetupLogging: Make program a mandatory argument
It's passed in by most users (daemons, CLI scripts) and for the others(burnin, watcher) it certainly doesn't hurt, especially when usingsyslog.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
Refactor _ConfirmOperation from gnt_instance.py to cli.py
This will allow us to use this functionality also in other cli-toolslike gnt-node power where we've to operate on multiple nodes.
Refactor formatting of query results so we can reuse it
Merge branch 'devel-2.3' into devel-2.4
Improve option descriptions
Also replace hardcoded “xenvg” with constant.
Rename QRFS_* to RS_*
This patch renames QRFS_* to RS_* fields so they can be used in otherplaces (i.e. LUs) without confusion, as this was initially meant forquery operations.
Rename OpAddTags and LUAddTags
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Rename OpDelTags and LUDelTags
Rename OpCreateInstance and LUCreateInstance
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Move FormatParameterDict from gnt_instance.py to cli.py
This function is useful for other cli-tools who need to displaya dict based parameter field.
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Adeodato Simo <dato@google.com>
Remove --master-netdev default value
Since the --master-netdev option is now used both at cluster init and atcluster modify time, it cannot have a default value of DEFAULT_BRIDGE(xen-br0) anymore. As such at cluster init we make the initializationexplicit if another value hasn't been passed. This fixes gnt-cluster...
Fix some doc issues introduced in recent commits
The hooks is due to me not checking the recent patch from David, andthe cli.py change is due to the utils.py split.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reword "one of hmgt" as "one of h/m/g/t" for clarity
Signed-off-by: Adeodato Simo <dato@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
query2: Add new field status “offline”
This allows “gnt-node list” to show the difference between modes markedoffline and nodes with e.g. RPC errors (“(nodata)”). node1 is themaster, node2's node daemon crashed and node3 is marked offline:
$ gnt-node list -o name,offline,dtotal,dfree...
Merge branch 'devel-2.3'
Conflicts: man/gnt-instance.sgml: Trivial merge in gnt-instance.rst...
cli: Change “<…>” in query output to “(…)”
This should reduce the amount of damage in case of accidential copy &paste.
cli: Extend message for LUXI timeouts
Point out that jobs already submitted continue to run.
gnt-node modify: Adding --node-powered=yes|no
cli: Add infrastructure for query2
A new function for formatting the query results is added,``FormatTable``. This was determined to be easier and safer thanmodifying the existing ``GenerateTable`` function while keepingbackwards compatibility for code not yet converted. The new code makes...
Adding --node-powered command line flag
Add the "alloc_policy" attribute to node groups
This can be set at group creation time and via OpSetGroupParams. The defaultis "preferred", and existing node groups from previous Ganeti version willget the attribute set to this value.
Signed-off-by: Adeodato Simo <dato@google.com>...
Querying node groups: add client/gnt_group.py
This implements `gnt-group list`.
Signed-off-by: Adeodato Simo <dato@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
The default value for ndparams should be None not {}
Adding --node-parameters command line flag
Drop the -g shortcut for --vg-name
Changing the volume group is a lot less frequent than acting on a nodegroup. As such we drop the "-g" shortcut and require the long option tobe passed. In 2.3 the commands which used to accept the volume group as"-g" won't have any node group option, so no confusion will arise. Later...
Merge the common options between import and add
The "I always wanted to do this" commit.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add vm_capable to gnt-node modify
Add master_capab to gnt-node modify
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Support modify of prealloc_wipe_disks config value
Rename --nodegroup to --node-group
For consistency with other CLI options.
Add option to ignore offline node on instance start/stop
In some cases it can be useful to mark as an instance as startedor stopped while its primary node is offline. With this patch,a new option, “--ignore-offline”, is introduced to “gnt-instancestart” and “… stop”....
Merge branch 'devel-2.2'
cli: Move parsing of --net option to separate function
This function will also be used in tools/move-instance.
Allow gnt-os modify to change the new OS params
cli: Expose priority option and pass priority to master daemon
cli: Pass options in {Add,Remove}Tags
They'll be used for job priorities. Also add an empty line tognt-os where it's missing.
Add nodegroup bash autocomplation
We autocomplete both by nodegroup name and uuid.
Add nodegroup option to AddNode
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
cli: Add option definition for priority
cli: Use list of options shared between commands
The completion script for bash has to know about these options. Until nowthe list was in two places--once in cli.py and once inautotools/build-bash-completion. A shared list is used with this patch.
hansmi helped me with merging the conflict. Thanks
Conflicts: lib/workerpool.py
Add simple lock monitor
This patch adds an initial implementation of a lock monitor, accessiblefor the user through “gnt-debug locks”. It currently shows all resourcelocks: BGL, nodes and instances. Config and job queue locks could beshown too, but wouldn't be of much help. The current owner(s) and mode...
Use one function to parse “--fields” option values
Stop adding the dry-run option by default
Currently cli.py unconditionally adds the dry-run option. This patchdisables this, and exports dry-run as a normal option.
The other alternative I tried to implement (adding a new fake option fordisabling the auto-add per individual command) would require changes in...
Support IPv6 cluster init
Signed-off-by: Manuel Franceschini <livewire@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Support for resolving hostnames to IPv6 addresses
This patch enables IPv6 name resolution by using socket.getaddrinfoinstead of socket.gethostbyname_ex.
It renames the HostInfo class to Hostname and unifies its use throughoutthe code. This is achieved by using static calls where no object is...
cli.SubmitOpCode: Pass keyword parameter as keyword
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Manuel Franceschini <livewire@google.com>
Improve handling of lost jobs
Currently, if the cli.JobExecutor class is being used, and one of thejobs is being archived before it can check its result, it will raise astracktrace as _ChooseJob is not prepared to handle this case.
This case makes JobExecutor work better with lost jobs (it still reports...
luxi: convert permission errors into exception
This patch adds handling of permission errors so that we don't showtracebacks when a non-root user runs a gnt-* command. Since in thefuture we'll have different permissions, we need to handle this in RAPItoo....
Add modification of the reserved logical volumes
This doesn't allow addition/removal of individual volumes, onlywholesale replace of the entire list. It can be improved later, if weever get generic container parameters.
The man page changes replaces some tabs with spaces (hence the...
Move the UsesRPC decorator from cli to rpc
This is needed because not just the cli scripts need this decorator, butthe master daemon too (and it already duplicated the code once).
In cli.py we just leave a stub, so that we don't have to modify all thescripts to import rpc.py....
Rename migration type to migration mode
This is in preparation for the rename of the opcode 'live' parameter to'mode'.
Introduce git reference/tag tracking for debugging
This patch adds a new vcs-version file that is generated via git (andcan be adapted if VCS is changed) and then embebbded as VCS_VERSION inthe constants module.
This means two things:- local modifications without committing to git (or when using a tar.gz...
Add a migration type global hypervisor parameter
Since migration live/non-live is more stable (e.g.) for Xen-PVM versusXen-HVM, we introduce a new parameter for what mode we should use bydefault (if not overridden by the user, in the opcode).
The meaning of the opcode 'live' field changes from boolean to either...
cli.SubmitOpCode: Support custom job reporter
This is necessary to reuse SubmitOpCode while adding processing forcustom message types.
Add function to format all job log messages
Just calling utils.SafeEncode on the log message failed when itwasn't of the type ELOG_MESSAGE and not a string. Now non-messagelog entries are formatted using repr().
Introduce lib/netutils.py
This patch moves network utility functions to a dedicated module.
Add default_iallocator cluster parameter
Add a cluster parameter to hold the iallocator that will be used by defaultwhen required and no alternative (manually-specified iallocator ormanually-specified node(s)) is given.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>...
cli.JobExecutor.WaitOrShow: always return status
Currently, for the 'wait' case, we return a list of tuples (status,result), in the order of submitted jobs, but we don't return anythingfor the no-wait case.
This patch changes the no-wait case to return a list of tuples (status,...
Add drbd helper and storage options
Signed-off-by: Luca Bigliardi <shammash@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Merge branch 'stable-2.1'
Pass force variant option at instance creation
This was supposed to be done in"06073e857e3b518c7195d57306ae01793240c0c2" but by mistake the field wasadded to batch create rather than the normal instance create.
Signed-off-by: Guido Trotter <ultrotter@google.com>...
Add support for OS parameters during instance add
This is not yet complete, as it lacks proper support for instanceimport.
Merge branch 'devel-2.1'
Fix warnings with Python 2.6
'format' is a new built-in function, and 'bytes' is a new builtin type.We rename this to make pylint happy (and remove potential bugs).
Submit[*each*]Pending job
This is useful so we can test both SubmitJob and SubmitManyJobs.
Support for latin friendly output in node list
cli: Make PollJob generic to support other protocols
By separating the LUXI-specific code and stdio-related codeinto separate classes, we can make cli.PollJob protocol-agnostic, allowing it to be used with RAPI.
This patch also adds unittests for cli.PollJob....
Add separate module for backported language functionality
utils.py, where they were before, is already huge.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Conflicts: doc/security.rst trivial lib/cli.py trivial
Signed-off-by: Balazs Lecz <leczb@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add --add-uids/--remove-uids to gnt-cluster modify
Signed-off-by: Balazs Lecz <leczb@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Add --uid-pool option to gnt-cluster modify
Merge remote branch 'devel-2.1'
Add a identify-defaults options for import
When importing an instance, all the saved valued will be used asexplicitly specified values, overriding the cluster defaults. This meansexport+import will change the status (from default to explicitlyspecified) of parameters....
Reuse NIC information from export
If the user doesn't pass any nics in import, do not use a defaultone-nic, but instead read the nics from the export file as is.
Fortunately the export and the way nics are read from the command lineare compatible…