History | View | Annotate | Download (109.9 kB)
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.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
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.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
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
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Merge branch 'devel-2.5'
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.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
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;...
Make it possible to pass in flags using ENV variables
Revert "Implementation of TLS-protected SPICE connections"
This reverts commit b6267745ede04b3c943bc02e004bdb9347e0f564.This commit will be readded on master.
Tiny optimisation related to filter parsing
Currently, we get a luxi Client, then parse the filter, then executethe query. If parsing the filter fails, we connected to the masterdneedlessly.
Rename filter and filter_ to qfilter
We currently use 'filter' as the OpCode, QueryRequest and RAPI fieldname for representing a query filter. However, since 'filter' is abuilt-in function, we actually have to use filter_ throughout the codein order to not override the built-in function....
Add --ignore-errors parameter to cluster verify
lib/cli.py- add IGNORE_ERROR_OPT;
client/gnt_cluster.py- pass the ignore_errors parameter to the opcodes
lib/opcode.py- update OpClusterVerifyConfig, OpClusterVerify and OpClusterVerifyGroup to accept the ignore_errors parameter...
Add cluster netmask parameter
Add the master_netmask cluster parameter, that represents the netmask ofthe master IP, encoded as a CIDR suffix.
This parameter can be set via the --master-netmask of gnt-cluster initand gnt-cluster modify. The default behaviour is to be consistent with...
Merge branch 'stable-2.5' into devel-2.5
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Optimise cli.JobExecutor with many pending jobs
In the case we submit many pending jobs (> 100) to the masterd, theJobExecutor 'spams' the master daemon with status requests for thestatus of all the jobs, even though in the end it will only choose asingle job for polling....
Implementation of TLS-protected SPICE connections
Added support for TLS-protected SPICE connections:
DeprecationWarning fixes for pylint
In version 0.21, pylint unified all the disable-* (and enable-*)directives to disable (resp. enable). This leads to a lot ofDeprecationWarning being emitted even if one uses the recommendedversion of pylint (0.21.1, as stated in devnotes.rst)....
PEP8 style fixes
Identified using the “pep8” utility.
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.
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
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.
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.
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