Add the auto_promote option to cli and gnt-node
This allows one to cleanly set a node offline and promote as neededother nodes.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add “gnt-os modify” for per-os-hypervisor parameters
Introduce “gnt-os modify” command to make it possible to set theper-os-hypervisor parameters.
Signed-off-by: René Nussbaumer <rn@google.com>Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Show per-os-hypervisor parameters in “gnt-cluster info”
Let gnt-cluster info show us the per-os-hypervisor parameters.
Add support for per-os-hypervisor parameters
This patch implements all modifications to support per-os-hypervisorparameters in the framework.
Validate the hostnames at creation time
This patch adds validation of new names used, i.e. at cluster init time,node add time, and instance creation.
For instances, especially when using «--no-name-check» (which skips DNSchecks), we should validate the give name, and also normalize it...
Merge branch 'stable-2.1' into devel-2.1
Signed-off-by: Guido Trotter <ultrotter@google.com>...
Fix bug in LUQueryConfigValues
LUQueryConfigValues supports multiple output fields. If the client askedfor the watcher pause status, it would not get a list, but simply thevalue.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Switch gnt-node evacuate to the new opcode
This switches gnt-node to the new opcode, and in the process alsoenables multi-node arguments for it.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Implement support for mevac in OpTestAllocator
Merge remote branch 'origin/stable-2.1' into devel-2.1
Convert scripts to pass options to the JobExecutor
Update scripts to pass 'opts' to SubmitOpCode
Add an early release lock/storage for disk replace
This patch adds an early_release parameter in the OpReplaceDisks andOpEvacuateNode opcodes, allowing earlier release of storage and moreimportantly of internal Ganeti locks.
The behaviour of the early release is that any locks and storage on all...
Fix "gnt-instance rename" functionality
Commit 91e0748c (Unify the “--no-ip-check” option) broke the optionsvariable name for ‘--no-ip-check’ but since we don't have a QA test forinstance rename (only burnin test), this was not caught until Issue 86was opened....
Merge branch 'devel-2.0' into devel-2.1
Conflicts: lib/backend.py - trivial merge...
Ensure all int/float conversions are handled right
int()/float() can raise either ValueError (in case of int("a")), orTypeError (in case of int(None)). We had many bugs over time due tothis, and a recent one was just diagnosed, so we go over the codebase...
Allow filtering for (node-)tags
This change introduces startup, shutdown, reboot, reinstall by usinginstance respectively node tags as a selection criteria.
Signed-off-by: René Nussbaumer <rn@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fix unused imports or add silences where needed
In some cases pylint doesn't parse the import correctly, so we addsilences; but there are also many cases of unused imports, which wesimply remove.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
Further pylint disables, mostly for Unused args
Many of our functions have to follow a given API, and thus we have tokeep a given signature, but pylint doesn't understand this. Therefore,we silence this warning.
The patch does a few other cleanups.
Signed-off-by: Iustin Pop <iustin@google.com>...
Remove more unused variables
This removes unused variables in the rest of the code (outside lib/).
Add targeted pylint disables
This patch should have only:
- pylint disables- docstring changes- whitespace changes
Command line/RAPI support for --no-name-check
This patch adds --no-name-check to gnt-instance add and gnt-backupimport. This is opposite to the opcode parameter (name_check) as it issimilar to ip_check and start.
It also adds it to RAPI and gnt-instance batch-create as a parameter in...
Remove quotes from CommaJoin and convert to it
This patch removes the quotes from CommaJoin and converts most of thecallers (that I could find) to it. Since CommaJoin does str(i) for i inparam, we can remove these, thus simplifying slightly a few calls....
Revert "Get rid of utils.CommaJoin"
This reverts commit 6915bc28fe053e92aa16cf2d974d205f1140219c based on thread onganeti-devel.
Conflicts:
lib/cmdlib.py (due to the error code classification, trivial)
A couple of doc updates
Clarify the fact that temporary HV/BE params in instance start overrideand do not extend the configured parameters; and change the instancelist headers from HVM_* to * since many of the parameters apply to KVMtoo. Also fix a typo in the rapi documention for '/2/nodes'....
Fix gnt-instance list documentation
(1) Both the man page and the online help report the link and modefields, which are in the code called nic_link and nic_mode.(2) Add missing fields to the online help.
Introduce a wrapper for hostname resolving
Currently a few of the LU's CheckPrereq use utils.HostInfo which raisesa resolver error in case of failure. This is an exception from thestandard that CheckPrereq should raise an OpPrereqError if the error isin the 'pre' phase (so that it can be retried)....
Some improvements to gnt-node repair-storage
Currently the repair storage has two issues:
- down instances are aborting the operation, even though they should be ignored (it's not technically possible to know their disk status unless we would activate their disks)...
Convert the rest of the OpPrereqError users
This finishes the conversion of OpPrereqError creation to two-argumentstyle. Any leftovers as one-argument are not breaking anything, justlosing information about the errors.
Unify the query fields for the storage framework
This patch unifies the query fields in the storage framework for alltypes. Note that the information is still computed on-demand, so if e.g.the used disk space is not requested for the ‘file’ type, it won't be...
Make gnt-node list-storage more standard
This patch adds support for the -o+field,… format that the other listcommands accept and changes the format of the allocatable field fromsimply str(bool) to Y/N.
Rename the node storage commands
To reduce confusion, the following gnt-node commands are renamed:
- physical-volumes → list-storage- modify-volume → modify-storage- repair-volume → repair-storage
The NEWS file is update accordingly and it also gets emacs local...
Fix gnt-debug breakage due to options move
Commits d3ed23f and 4eb6265 broke gnt-debug due to renamed optiontargets. Sorry again!
Fix gnt-node modify-volume
This was broken by me in 064c21f, sorry!
gnt-node: add short option -t for --storage-type
Adding '--no-ssh-init' option to 'gnt-cluster init'.
Allows the initialization of a cluster without the creation or distributionof SSH key pairs. Includes changes for LeaveCluster and RPC.
Signed-off-by: Ken Wehr <ksw@google.com>Signed-off-by: Guido Trotter <ultrotter@google.com>...
gnt-* use the correct opcode slot to build opcodes
gnt-* scripts were building wrong opcodes for commands which had theshutdown_timeout slot (due to missing testing after renaming). Fixing.
Also change SHUTDOWN_TIMEOUT_OPT dest field name to "shutdown_timeout":...
Add timeout options to other LUs
All the LUs that shut down the instance need to be able too pass thetimeout parameter as well.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Accept shutdown timeout from the user
Using the new --timeout option:
- gnt-instance shutdown is changed to accept a timeout- the opcode is changed to hold one- the LU is changed to optionally get one- the rpc is changed to carry one- the backend is changed to take it as a parameter rather than...
Get rid of utils.CommaJoin
- We never remember to use it (5 uses vs 21 " ,".join())- It's longer to write than " ,".join()- The added value of the apostrophe in the string is not very much
Allow --force-variant for instance add/reinstall
Passing this option makes an undeclared variant be passed to the os "asis", hoping it'll be able to figure it out (as per the design doc).
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
Update client os lists to name+variant format
List of OSes are displayed by gnt-os list, rapi, and gnt-instancereinstall --select-os, and checked by burnin. In all of these show thelist with name+variant, if the os has variants.
Add per-node variants list to OS diagnose output
gnt-os diagnose: show os variants
We already show the per-node os variants, also show the global ones.
Export and show the cluster uuid in cluster info
Implement uuid in gnt-node/instance list and info
The patch modifies LUQueryInstanceData to return the uuid too and alsoadds support for it in the gnt-* scripts.
gnt-instance info: fix nic display
In branch-2.1 the conversion of NICs to Tuples has been unified to the_NICListToTuple function, which is used by both hook generation andinstance info generation. Unfortunately the ip and mac fields gotswapped from what instance info expected, so the mac is shown as ip, and...
Unify the instance creation code
Currently the AddInstance in gnt-instance and ImportInstance ingnt-backup duplicate all of their code except the actual opcode creation(the parameters to it). By moving this to cli.py (not optimal location,but we don't have another one), we can use a single copy of the code,...
Unify multi-instance handling in gnt-instance
Start, stop and reboot have the same code for dealing withmulti-instance handling. This patch moves all that into a single genericfunction, and leaves only the building of the specific opcode for theoperation in the individual functions....
Fix gnt-instance start/stop/… args
The gnt-instance commands that have the multi-filter can take also zeroarguments, if the --all flag is passed. But they currently are declaredwith min=1, and this is a regression due to the recent bash completionchanges....
Move more cluster init opts to cli.py
Some of these should be added to cluster modify too.
Move cluster verify options to cli.py
Move the “--reboot-type” option to cli.py
Move the “--ignore-secondaries” option to cli.py
Move the “--no-shutdown” option to cli.py
Change indentation style in commands definitions
Currently, the indentation level for a command's definition depends onthe command name length, and this makes the commands dict unpleasant tothe eye. This patch changes it so that a new line begins right after the...
Remove explicit DEBUG_OPT and add it by default
Since >90% of the commands take the “--debug” option, and all shouldactually take it (the gnt-job command is currently missing it), it makessense to simply remove this and add it by default in cli.py.
Move the “--on-primary” option to cli.py
Move the “--on-secondary” option to cli.py
Move the “--auto” option to cli.py
Move the “--ignore-size” option to cli.py
Move the “--src-…” options to cli.py
Unify the “--secondary-ip” option
Move the “--readd” option to cli.py
Move the “--no-ssh-key-check” option to cli.py
Move the node flags options to cli.py
This also unifies a little the parameters to the respective options.
Move the “--allocatable” option to cli.py
Unify the “--no-lvm-storage” option
Unify the “--enabled-hypervisors” option
This also required a change, as one of the cases used a differentdefault.
Unify the “--nic-parameters” option
Unify the “--candidate-pool-size” option
This required a slight tweak since in init we want a different default.
Unify the “--vg-name” option
Move the “--yes-do-it” option to cli.py
Move the “--no-voting” option to cli.py
Move the “--mac-prefix” option to cli.py
The default has also been changed to None as this will be useful oncecluster modify will be able to change this setting too.
Unify the last “--hypervisor” (as list) option
This third form takes a list of name+options, and is used only ingnt-cluster. Who knew that we have three forms of ‘-H’?
Unify the “--no-ip-check” option
Unify the “--net” option
Unify the “--disk” (identkeyval) option
Unify the “--disks” (disk indices) option
Unify the “--os-size” option
Unify the “--ignore-consistency” option
Unify the “--non-live” option
Unify the “--node” (as instance placement) option
Unify the “--node” (as list of nodes) option
Unify the last “--node” (single node) option
Move the “--no-start” option to cli.py
Move the “--show-cmd” option to cli.py
Move the “--cleanup” option to cli.py
Move the “--static” option to cli.py
Move the “--all” option to cli.py
Move the “--select-os” option to cli.py
Move the “--ignore-failures” option to cli.py
Unify the “--new-secondary” option
Unify the “--file-driver” option
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Unify the “--iallocator” option
This patch also changes the gnt-debug's “--algorithm” intoIALLOCATOR_OPT, since it was the only non-standard use of this (due tohistorical reasons). Since it's just a debug option,backwards-compatibility is not critical here....
Unify the “--os-type” option
This was already unified inside gnt-instance, I just moved thatdefinition (and upper-cased it) into cli.py.
Unify the “--backend-parameters” option
This is not straight-forward. First, gnt-cluster had“--backend-parameters” wheres the rest of the script had just“--backend”. I settled on the full form, since one can always abbreviateoptions, but not vice-versa....
Unify the “--hypervisor” (params only) option
This unifies the two uses of --hypervisor-parameters with only options(a=b,…) form. The patch changes a little SetInstanceParms since thatexpected opts.hypervisor instead of opts.hvparams.
Note that there is another form of --hypervisor-parameters which also...
Unify the “--hypervisor” (with name) option