ganeti.http: Don't pass poller object around
They're cheap to instantiate and doing this changes makes the codea bit simpler.
Reviewed-by: ultrotter
Rename http.HttpInternalError to HttpInternalServerError
All other exceptions are named after the error name in RFC2616 (HTTP/1.1).
Reviewed-by: amishchenko
ganeti.http: Add more constants and errors
ganeti.http: Ignore ENOTCONN when shutting down the connection
Implement support for additional headers with HTTP errors
Add simple unittests for ganeti.http
More complex unittests will need some refactoring in the HTTP code.
ganeti.bootstrap: Whitespace fix
Reviewed-by: iustinp
Add job queue size limit
A job queue with too many jobs can increase memory usage and/or makethe master daemon slow. The current limit is just an arbitrary number.A "soft" limit for automatic job archival is prepared.
utils.KillProcess: Use waitpid() to wait for child processes
Sometimes the proc filesystem doesn't reflect the current status ofa process. By calling waitpid(), we make sure to get the currentinformation, at least for child processes. The timeout is still...
Release ganeti 2.0~alpha1
LUConnectConsole: fix primary_node online check
The primary node is part of the instance, not of the opcode.
_RunCmdPipe: handle EINTR in poller.poll()
poll() can be interrupted. rather than failing we retry until itreturns.
KVM: improve socat interface
Call socat with a full path specified at configure time, rather thanjust by its name, and check for the binary to exist at hypervisorverify.
KVM: use a different default kernel path
It makes sense for the default kvm kernel not to be called "xenU".
ganeti.http: Add three TODOs for improvements
ganeti.http: Explicitly initiate handshake
Otherwise it would be done on the first read/write operation, makingerror handling more difficult (such as EOF during handshake).
ganeti.http: Implement handshake socket operation
ganeti.http: Handle SSL_ERROR_ZERO_RETURN
Also add a comment next to the place where the SSL connection is shutdown.
cleanup: ConfigWriter, initialize all attributes
We should initialized the _last_cluster_serial in the constructor too (just tobe consistent).
cleanup: rapi v2 instance tags wrong attribute
This was changed in the past, but it seems this class was forgotten.
cleanup: http server, line too long
cleanup: http client, line too long
cleanup: xen hypervisor
Wrong indentation and uniformize one method signature.
cleanup: kvm code likes to redefine names
lib/ssh.py: import the logging module
This only means most of our error paths in this module were not working(and generating exceptions).
SshRunner: add docstring for _BuildSshOptions
Improve _autoconf.py comments
This adds a docstring to the _autoconf.py file detailing how it'sgenerated (the other comment it's not visible in pydoc/epydoc).
cleanup: use _ for unused loop counter
cleanup: WorkerPool, wrong variable name
Quoting Michael: "why is this even working?"
Reviewed-by: imsnah,amishchenko
cleanup: TcpPing, wrong variable name
The default value of 'False' wasn't initialized properly. It doesn'trequire initialization, but it's cleaner this way.
cleanup: SetEtcHostsEntry unused var
cleanup: fix IAllocator hypervisor usage
Two problems: the iallocator.hypervisor wasn't initialized to None inthe constructor, so pylint doesn't realize it's initialized later withsetattr.
Second, 'hypervisor' is a module, so we shouldn't use it as a variable....
cleanup: LUReplaceDisks unused vars
And a small whitespace fix.
cleanup: do not hide upper-scope name
hypervisor is a module, so we shouldn't use it as an argument.
cleanup: fix use of _CheckNodeOnline
A few cases of wrong variable name.
cleanup: LUAddNode, LUSetNodeParams unused variable
This is a leftover from the abstraction of AdjustCandidatePool, and italso requires the config lock, so it's better to remove it.
cleanup: LURenameCluster wrong variable name
cleanup: fix export NIC count the same way as disk
For safety, we use the same algorithm as in disk count.
cleanup: fix backend._RecursiveFindBD
_RecursiveFindBD takes a parameter that isn't used; moreover, nowhere inthe SVN history can I find a case that it has been used.
As such, remove this parameter and fix its callers.
cleanup: more unused vars
cleanup: sanitize a default parameter
Instead of relying that the usage of the parameter is ok with mutabledefault parameters, let's just make it safer..
cleanup: exceptions should derive from Exception
cleanup: fix GatherMasterVotes
Remove unused vars
cleanup: _InitSSHSetup doesn't need its argument
Reviewed-by: imsnah
cleanup: fix 'variable unused' warning
In the iteration we don't care about the node names, so we change thefor loop to be over the values (and not itervalues).
ganeti.http: Rename HttpBase._using_ssl to HttpBase.using_ssl
It'll be queried from other classes.
ganeti.http: Rename HttpSocketBase to HttpBase
It's more appropriate.
Fix epydoc format warnings
This patch should fix all outstanding epydoc parsing errors; as such, weswitch epydoc into verbose mode so that any new errors will be visible.
Switch epydoc to parse only
epydoc seems to be mightily confused by decorators and how they changefunctions (it starts mixing the parameters of the decorated functioninto the decorator itself); so we want it to parse only and not look atthe objects themselves....
ganeti.backend: Improve compression check
ganeti.http: Docstring updates
ganeti.http: Remove _HttpClientError
This is a leftover from old code.
ganeti.http.server: Increase connection backlog to 1024
This solves a problem with many concurrent requests. By default, 1024is the maximum backlog on Linux kernels. We limit the number of clientsthrough MAX_CHILDREN, too. The idea of just increasing the backlog is...
RPC: Compress file upload data
Adding compression to larger amounts of data is more efficient thantransferring it (len(nodes) - 1) times over the network withoutcompression. We were able to compress a 800KB config file to about30 KB, which is about 40 KB with Base64 encoding (required due to...
Warn for instances living on offline nodes
The patch also changes the result to error for non-reachable secondary nodes(as for primary nodes).
Fix _AdjustCandidatePool
Currently the ConfigWriter.MaintainCandidatePool returns node names, and_AdjustCandidatePool uses them as such, but then it passes these tocontext.ReaddNode which in turn passes them to jqueue.JobQueue.AddNode whichuses them as objects.Node instances....
gnt-node modify: add the offline attribute
This patch changes gnt-node modify and the associated opcode/lu to allowmodification of the node offline attribute.
Setting a node into offline mode automatically demotes it from themaster role.
RPC: do not make calls to offline nodes
This patch changes the _MultNodeCall and _SingleNodeCall helpers to notactually make calls to offline nodes, but instead generate fakeresponses which have a parameter caller 'offline' set so that callerscan check for this value if they want (otherwise, it's just a failed RPC...
chmod ganeti.initd before uploading it
When an upload is done to a node which doesn't have any version ofganeti installed, this prevents a non-executable-initd error later inthe upload.
Make cluster verify understand offline nodes
This patch changes cluster verify to not alert on offline nodes, butinstead just show a note at the end with the number of such nodes.
It also removes warnings in verify-disks and hooks about failures tomake rpc calls to such nodes....
cmdlib: check node stats in prereqs
This patch adds checks for offline nodes in most instance LUs so that wecan work with offline secondaries, but not with offline primaries. Somecases (like grow disk, which needs both sides up) are not allowingoffline nodes at all....
Add two utility functions to cmdlib
These will be used for parameter checking and node status checking.
Add function to compute the master candidates
Since some nodes can be offline, we can't just take the length of thenode list as the maximum possible number of master candidates.
The patch adds an utility function to correctly compute this value andreplaces hardcoded computations with the use of this function. It then...
http: use slicing instead of string modification
The combination of the current buffer splitting method and (4KB) buffersize is very inefficient when writing big amounts of data. Just walkingover a 16 megabyte string using a 4K buffer takes (on a random computer)...
Add the offline node list to ssconf
The patch also changes the various node list generation to be moreconsistent.
Cleanup the config file on demotion from candidate
This patch adds a simple rpc which makes a backup of the config file andthen removes it. This is done so that cluster verify doesn't complainimmediately after demoting a node.
watcher: handle offline nodes better
This patch changes the LUQueryInstances to show a different state foroffline nodes and also modifies the watcher to understand the offlinestate in its checks.
node list: add the offline field
Add a new node parameter 'offline'
This patch adds a new node parameter called offline that will be used tomark nodes which should be touched by commands.
We also add this flag at cluster init, node add, and export it toiallocator scripts.
ssconf: empty files should not add a newline
Currently we add a newline in the ssconf writeout process, even if thefile is empty. We chage this case so that lists of values (e.g. offlinenodes) are correct (not a list of one empty element).
ganeti.http: Add constant for DELETE
Remove old HTTP code
ganeti.rpc: Convert to new HTTP server
ganeti-rapi: Convert to new HTTP server
ganeti-noded: Migrate to new HTTP server
ganeti.http: Split HTTP server and client into separate files
This includes a large rewrite of the HTTP server code. The handling ofOpenSSL errors had some problems that were hard to fix with itsstructure. When preparing all of this, I realized that actually HTTP...
Rename all HTTP classes to camel case
It should be consistent.
ganeti.http: Remove underline from two classes
This is a preparation step for splitting the HTTP client and server codeinto two separate modules.
Move HTTP code to subpackage
LURemoveNode, promote nodes to master candidates
If after the remove node there are not enough master candidates, we'lltry to promote them.
LUQueryExports: fix rpcresult handling
call_export_list is a multi node call, so we need to go through theresults, extrapolate the good ones, and return a failure value for thebad ones.
LUAddNode: Auto-make master candidates
When a node is added, if there are not enough master candidates, we'llautomatically promote it.
LUAddNode: Check the correct result
This is a typo in the conversion to RpcResult
ganeti.http: Fix copyright header
ganeti.http: Remove unused attribute "should_fork"
This is a leftover from removed code.
ganeti.http: Move request handling logic from server to handler class
ganeti.http: Move _SocketOperation to module-level function
This is a preparation step to move the HTTP server class to thesame model as the HTTP client (polling, non-blocking I/O, betterOpenSSL error handling).
ganeti.http: Move _WaitForCondition into module-level function
ganeti.http: Remove ApacheLogfile class
We don't need it anymore and it wouldn't work as it is, anyway.
InitCluster force a config file update
After the cluster is ready we'll load the ConfigWriter and force awriteout of all config files.
Make sure the initial node is a master candidate
gnt-cluster init, handle candidate_pool_size
- Add a new command line option, defaulting to the constant value- Pass the value to bootstrap.InitCluster- Use it to init the new Cluster object
Add the MASTER_POOL_SIZE_DEFAULT constant
This constant will be used at cluster init time.
CheckBEParams handle a bool BE_AUTO_BALANCE
This only happens at cluster init, if the value is not user-specified.
Extract the ListNodes headers and use them in help
Currently we have to update both the ListNodes headers and the onlinehelp for the full field list. This patch uses the headers keys for thehelp, thus removing duplicating places to update, and adding hope that...
A few fixes related to master candidates
This patch: - fixes cluster verify when all nodes are master candidates, but the candidate_pool_size is higher - warn when the master node is not marked as candidate - disable setting master node to regular node...
Fix cluster rename and known_hosts
This patch rewrites and distributes ganeti's known_hosts file in case ofa cluster rename.
We also fix a problem in the node add (from where I copied theknown_hosts file distribution).
Fix hooks_unittest with new rpc call structure
Fix gnt-cluster verify w.r.t. rpc changes
This partially reorganizes the cluster verify LU: - introduce constants for the node verify rpc call - move from additional rpc calls to a single rpc call, the call_node_info, which gaters all data needed...
Fix cluster rename
With the recent configwriter/ssconf changes, cluster rename becomestrivial. This patch gets rids of the code and just updates the clusterobject.