Confd client: make SendRequest args optional
By default "None" will be used as an args value
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Confd client: Change callback model
We move to one callback in total, rather than one per call, and call itboth for server replies and request expiring.
Confd client: make confd port configurable
The port can be now chosen at library init time, with a default ofcalling GetDaemonPort.
Change config upgrade to be explicit
Currently the config upgrade is done at each object instantiation, thatmeans that ganeti-noded will run UpgradeConfig on all objects receivedremotely (instances, disks, nics). This is not so good, so this patchchanges it so that only the ConfigWriter runs this method at...
Confd: add instances IPs query
Extend confd to answer queries about instances IPs.
Signed-off-by: Luca Bigliardi <shammash@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fix utils.MatchNameComponent for full matches
While ‘test1’ matches both ‘test1’ and ‘test1.example’, it has a full,exact match and we should return it if that is the case.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Design doc changes for UUID tracking of objects
Fix _RemoveDisk for file based instances
During 621b7678 two typos were introduced which prevent file basedinstances removal to work correctly. Fixing both of them to what theywere meant to be.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Re-wrap locking changes design to 76 chars per line
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Revert "Include NEWS file in documentation"
This reverts commit 350ecfecca136f50877898774c6b40014b5c2b1c. It brokedistcheck.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
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...
cmdlib._CreateDisks fix a broken result.Raise
The format string has the ": %s" at the end, but no argument is passed,which of course raises a TypeError. Removing ": %s" as it's added bythe RpcResult Raise() method anyway.
Signed-off-by: Guido Trotter <ultrotter@google.com>...
Include NEWS file in documentation
Convert NEWS file to RST
- Add markup for titles- Convert quotes- Reindent and rewrap to 72 chars per line
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
Make ganeti-watcher use the standard debug option
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.
Signed-off-by: Iustin Pop <iustin@google.com>...
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
Explain the reason for fqdn hostnames
The install guide asks the user to use the fqdn in the hostname, butdoesn't explain why. This has been asked multiple times, so adding anexplanation there.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>...
Remove RpcResult.RemoteFailMsg completely
Add locking improvements to Ganeti 2.1 design document
Also increase the table of contents' depth to 4.
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.
Show "--help" in bash completion
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.
ganeti-confd: remove partial imports
ConfdAsyncUDPServer: handle signals at read time
Currently if a signal is delivered during an attempted read, anexception is logged in the logfile. There is no need for this, so wehandle this case explicitely.
ConfdAsyncUDPServer: defer handling writes
Currently if we fail writing to the socket (perhaps because a signal wasdelivered) we lose the data we were sending. Although this is not toobad (it's udp, and data may get lost anyway) we try to avoid this by...
Abstract AsyncUDPSocket to daemon
This allows this extended asyncore+udp module to be used also in otherdaemons, and in the confd client library
ConfdAsyncUDPServer: fix a docstring
It refers to an older input variable
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
ganeti-confd: explicitely log failed big sends
Make sure that if we try to send packages which are too big (whichshouldn't happen) this gets properly logged in the config file.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Luca Bigliardi <shammash@google.com>
Add unittests for confd constants
Checking that the fourcc code is indeed a fourcc code, and that requestcodes and reply statuses are distinct.
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.
Move developer notes into normal documentation
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).