Move more cluster init opts to cli.py
Some of these should be added to cluster modify too.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Move cluster verify options to 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 “--disk-template” option
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
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
Remove RpcResult.RemoteFailMsg completely
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add an error-simulation mode to cluster verify
One of the issues we have in ganeti is that it's very hard to test theerror-handling paths; QA and burnin only test the OK code-path, sinceit's hard to simulate errors.
LUVerifyCluster is special amongst the LUs in the fact that a) it has a...
Introduce parseable error codes in LUVerifyCluster
Currently the output of cluster verify can be parsed for 'ERROR'messages, but that is the only indication we get (error or no error). Inorder to allow monitoring tools to separate different error conditions,...
Unify the multiple 'verbose' options
Currently multiple files define a 'verbose' option. This patch moves allthese definitions to a single VERBOSE_OPT option which is exported fromcli.py.
Rewrite the lib/cli.py export list
Right now, the export list is a mess, it's not sorted, and the exporteditems are in random places. This patches does grow the length of thelist, but at least it's more clear.
Signed-off-by: Iustin Pop <iustin@google.com>...
Remove RpcResult.failed attribute
It's redundant with RpcResult.fail_msg. This change survived QA, burnin andunittests.
Confd: add primary IPs queries
Extend confd to answer queries about nodes primary IPs and master candidatesprimary IPs.
Signed-off-by: Luca Bigliardi <shammash@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Confd client library
Initial confd client library implementation. This initial version usesasyncore, and supports answers via a callback.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Abstract AsyncUDPSocket to daemon
This allows this extended asyncore+udp module to be used also in otherdaemons, and in the confd client library
AsyncUDPSocket: Move to a well defined UDP size
Currently we read maximum 4K packets, and don't check packets whensending them. With this patch we move to a well defined maximum size of60K.
Add a magic fourcc code to confd packets
This will make it easier to change the protocol later on
Move fourcc packing/unpacking to main confd module
This way it can be used by the client as well
Fix authorized_keys generation at cluster init
Copy pub_key in authorized_keys.
jqueue: Remove unused run_op_index attribute
Export new lock_status field to gnt-job
Keep lock status with every job
This can be useful for debugging locking problems.
Move OpCode processor callbacks into separate class
There are two major arguments for this:- There will be more callbacks (e.g. for lock debugging) and extending the parameter list is a lot of work.- In the jqueue module this allows us to keep per-job or per-opcode variables in...
Replace last hardcoded 'nodelist' with NV_NODELIST
LUAddNode has this usage remaining, as it's the only other LU to usecall_node_verify (beside LUVerifyCluster).
Treat virtual LVs as inexistent
Currently, “gnt-cluster verify” and “gnt-cluster verify-disks” use thelist of LVs as returned by backend.GetVolumeList to determine whether anLV exists or not. However, LVs can also be ‘virtual’, which is handledcorrectly (i.e. as missing) by the bdev code, but not by this function....
locking: Acquire SharedLock in shared mode in separate function
This is for some more symetry withSharedLock.__exclusive_acquire.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
RpcResult: Fix cases where “failed” wouldn't be set to True
This broke “gnt-instance replace-disks --auto” when the instanceis down.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
locking: Add level name dict
Merge commit 'origin/next' into branch-2.1
locking: Don't swallow exceptions
This is an indentation bug.
Wrap lines over 80 characters
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Luca Bigliardi <shammash@google.com>
cmdlib: Fix typo in variable name
Move LoadModule function to ganeti.build
It should only be used at build-time.
Add new ganeti.build namespace
This will be used to store build-time Python code.
mcpu: formatting/indenting fix
Small fix for a mistake done by bad editor settings.
Signed-off-by: Luca Bigliardi <shammash@google.com>
Add check for duplicate MACs in instance add
Currently LUAddInstance doesn't check for duplicate MACs, and it failsduring the Exec() phase when trying to add the instance to the config(ConfigWriter checks for this). This patch copies the code fromLUModifyInstance (which already does it)....
Optimise multi-job submit
Currently, on multi-job submits we simply iterate over thesingle-job-submit function. This means we grab a new serial, write andreplicate (and wait for the remote nodes to ack) the serial file, andonly then create the job file; this is repeated N times, once for each...
Add bash completion for --node node1[:node2]
Even more style fixes
KVM hypervisor: Use ReadFile
A few style fixes
Add RAPI resource to redistribute config
Add simple unittest for remote API docs
Move LoadModule function to utils
It can be used by unittests for daemons/* or scripts/*.
utils.CalculateDirectorySize: Don't redefine builtin
Use ReadFile/WriteFile in more places
This survived QA, burnin and unittests.
confd: add cluster master query
confd/querylib: fix docstrings
They were cut&paste from the first example queries, rather thandocumenting the current ones.
Remove SimpleConfigReader.GetHypervisorType
We haven't had that config file entry for a while.
Conflicts: lib/cmdlib.py: Trivial
Return cluster tags from LUQueryClusterInfo
Merge branch 'next' into branch-2.1
Bash completion: Implement dynamic option value completion
Move SimpleConfigReader creation to ConfdProcessor
This will be useful to make ConfdProcessor aware of a config failure,without quitting confd.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
ConfdProcessor: add disabled state
This is a state the processor will get in, if it fails to load theconfig.
constants: add confd reload and rate limit times
Add errors.InotifyError