History | View | Annotate | Download (102.7 kB)
PEP8 style fixes
Identified using the “pep8” utility.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Detect globbing patterns as query arguments
Short: this patch enables the use of “gnt-instance list '*.site'”.
Detailed description: This patch changes the command line interface codeto try to deduce the kind of filter from the arguments to a “list”command. If it's a list of plain names an old-style name filter is used....
ganeti-watcher: Split for node groups
This patch brings a huge change to ganeti-watcher to make it aware ofnode groups. Each node group is processed in its own subprocess,reducing the impact of long-running operations.
The global watcher state file, $datadir/ganeti/watcher.data, is replaced...
cli: Add constant for node group option
ganeti-watcher will use this constant to pass the option to itself forprocessing all node groups.
Revert "cli.JobExecutor: Feedback function for info output"
This reverts commit 7421df8e5f2cf31022085b332d1300640ba5854b.
The feedback_fn argument to JobExecutor is used for PollJob, and thushas a fixed signature: a single arg, tuple of (timestamp, log type,...
cli.JobExecutor: Feedback function for info output
This will be used in the watcher where we don't want topollute stdout unless in debug mode.
Add another name for the --yes-do-it option
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Most boring patch ever
s/'/"/ in (hopefully) the right places.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Rename *_STATUS_WAITLOCK to …_WAITING
This patch renames the {JOB,OP}_STATUS_WAITLOCK constants to {JOB,OP}_STATUS_WAITING, as per design document for chained jobs.
gnt-group: Add command to evacuate whole group
cli.GetOnlineNodes: Support node group filter, use query2
This patc changes cli.GetOnlineNodes to use query2, which does thefiltering in the master daemon, and adds a new parameter to filter bynode group.
Unittests were added for the old implementation and then adopted to...
Add gnt-instance start --pause
Creates the instance, but pauses execution before booting. This combinedwith 'gnt-instance console' unpausing instances means that the entireboot process can be viewed and monitored.
Signed-off-by: Stephen Shirley <diamond@google.com>...
Change “gnt-node evacuate” to use new opcode
By default it'll now evacuate all instances from the node, notjust secondaries.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Fix issue with tags on instance creation
Commit 720f56c85a added the ability to specify tags when creating aninstance. The “tags” attribute of an instance object needs to be a set,but the patch's code saved it as a list, causing breakage in other parts...
Add tagging option to gnt-instance create
Add TAG_ADD_OPT option to cli.py and use it in gnt-instance. Modifycli.GenericInstanceCreate() accordingly.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>Signed-off-by: Iustin Pop <iustin@google.com>...
cli.JobExecutor: Handle empty name, allow adding job IDs
With LU-generated jobs only the ID is known.
cli.JobExecutor: Use counter for indexing jobs
If “SubmitPending” were mixed with calls to “QueueJob”, jobs in theinternal structures will get duplicate indices. With this change eachqueued job is assigned a unique index, which will be used for sorting...
Merge remote branch 'origin/devel-2.4'
cli: Replace hardcoded disk templates with constants
Implement no_remember at CLI level
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Merge branch 'devel-2.4'
Handle EPIPE errors while writing to the terminal
This handles EPIPE errors in two places: ToStream (to catch loggingdone in GenericMain itself) and in GenericMain (to cover also plainprint statements).
gnt-group: Add commands for tagging groups
cli: Fix wrong argument kind for groups
cli: Add option to force names to be treated as filter
cli: Add support for parsing query filters
cli: Error reporting for query filter parsing
cli: Replace hardcoded strings with constants
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
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``.
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
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.
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...