History | View | Annotate | Download (52.3 kB)
Introduce lib/netutils.py
This patch moves network utility functions to a dedicated module.
Signed-off-by: Manuel Franceschini <livewire@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add oper_vcpus instance status field
This introduces a new instance status field, named "oper_vcpus".It contains the actual number of VCPUs an instance is using asseen by the hypervisor.
Signed-off-by: Balazs Lecz <leczb@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
gnt-instance: fix GenericManyOps
Currently, GenericManyOps ignores the actual success or failure resultsfrom the invididual jobs. We change this to return '0' (i.e. success)only when all jobs failed, as many times we have just one job.
Together with the JobExecutor change, this will report failures...
Fix a broken commandline switch option
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Merge branch 'stable-2.1'
Modify gnt-instance rename to support --no-check-name
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Introduce utils.IsValidIP{4,6}()
This patch introduces functions to check for valid IPv4 and IPv6addresses and converts IsValidIP() to return True if it is either a IPv4or a IPv6 address.
For now we do not change the functional behavior and replace IsValidIP...
Rename some constants to facilitate IPv6 support
Signed-off-by: Manuel Franceschini <livewire@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
BatchCreate: get force_variant from specs not opts
There is no such option on the command line, and for batch creation it'sbetter to get the option from the json file (with a default of false, aswe fixed it in the previous patch).
Signed-off-by: Guido Trotter <ultrotter@google.com>...
BatchCreate: set a default for force_variant
Currently if the json file doesn't contain a "force_variant" parameterBatchCreate stracktraces. We add a default so passing it explicitely isnot needed.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Balazs Lecz <leczb@google.com>
Show OS parameters in cluster/instance info
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-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.
Add support for modifying instance OS parameters
We move the instance OS rename checks earlier, as we need to run thevalidation against the new OS, if it has changed.
Convert gnt-instance list and info to use roman
Finally gnt-instance has roman support as well.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Change the migration message
Let's remove the experimental message (the Ganeti side is stablenowadays) and replace it with a warning about possible hypervisorissues.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
gnt-instance info: sort the hv parameters
Fix new pylint errors
Instance creation: implement --no-install mode
This is a simple patch that adds the no-install mode for instancecreation, allowing import from foreign source of the actual OS (insteadof requiring the preparation of data in a form expected by the import...
Allow OS changes without reinstallation
This patch modifies LUSetInstanceParms to allow OS name changes, withoutreinstallation, in case an OS gets renamed on-disk.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Implement conversion from plain to drbd
This patch adds a new mode to instance modify, the changing of the disktemplate. For now only plain to drbd conversion is supported, and thenew secondary node must be specified manually (no iallocator support).
The procedure for conversion works as follows:...
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>
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....
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.
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.
Signed-off-by: Iustin Pop <iustin@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...
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.
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 the “--reboot-type” option to cli.py
Move the “--ignore-secondaries” 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
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 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 “--disk-template” option
Unify the “--no-nics” option
Unify the “--file-storage-dir” option
Unify the “--file-driver” option
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
Unify the “--no-wait-for-sync” option
Add bash completion for --node node1[:node2]
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Luca Bigliardi <shammash@google.com>
Use ReadFile/WriteFile in more places
This survived QA, burnin and unittests.
Add more bash completion metadata for options
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
Add ArgHost class
It expands to the hostnames known by bash.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Re-introduce constants for most often used arguments
Add more auto-completion metadata
Make all options use cli_option
Change scripts to use new argument definitions
This can be used to generate the bash completion script automatically.In the future it may allow for better command line validation as well.
Add gnt-instance move
This uses the new LUMoveInstance. It supports only single-instance moves.
cli: Merge ikv_option and keyval_option into cli_option
Merging them gets rid of two public functions in cli.py and optparse explicitlysupports more than one option type per class.
Add support for querying the ctime/mtime
This patch adds querying of ctime/mtime for the cluster/nodes/instances.
Implement instance recreate-disks
This can be used for a 'plain' type instance when the underlying storagewent away, to recreate the storage (and reinstall) instead of removingthe instance and readding it.
Merge commit 'origin/next' into branch-2.1
gnt-instance replace-disks: Add new --auto option
Merge branch 'master' into next
Convert ldisk_degraded to tri-state value
This allows us to report “uncertain” states (LDS_UNKNOWN) for caseswhere the code can't easily detect or report what's wrong with ablock device.
objects.BlockDevStatus: Remove ToLegacyStatus
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Implement --ignore-size in activate-disks
This patch modified OpActivateDisks, LUActivateDisks and gnt-instanceactivate-disks to support and pass this option to_AssembleInstanceDisks.
The patch is quite trivial I think; there should be no issues from it...
Fix gnt-instance reinstall
Commit 55efe6dabe48e5c37dc1ff6099e0bb8afde7a468 "Convert instancereinstall to multi instance model" actually broke instance reinstall forsingle-instance cases. This one-liner fixes it.