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.
Reviewed-by: amishchenko
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.
Reviewed-by: iustinp
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.
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).
Reviewed-by: ultrotter
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...
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.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.
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 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.
Convert rpc results to a custom type
For a long time we had the problem that both RPC-layer errors andresults from the remote node share the same "valuespace". This isbecause we shouldn't raise an exception when only one node failed(and lose the results from the other nodes)....
burnin: add instance reinstall and reboot
These two operations were missing from burnin. The reboot is done withall valid modes (a new constant is added), and the reinstall is doneboth with and without specifying the OS (to account for the two codepaths in the LU)....
KVMHypervisor add two missing 'constants.'
Some calls to the HV parameters were missing them.
KVMHypervisor fix to case misspellings
Use the new utils.CheckBEParams function
Where we used/forgot to validate beparams we now use the new common function.
Add utils.CheckBEParams
This function will be used in LUCreateInstance, LUSetInstanceParams,LUSetClusterParams and InitCluster to check the backend parametersvalidity and convert the relevant values to integer, without duplicatingcode. It lives in utils as bootstrap.py is calling it too....
Add constants.VALUE_TRUE and VALUE_FALSE
Handle default/none values in hv/be params
When a value is set to constants.VALUE_DEFAULT we have to remove it fromthe specific instance dict, as this way it will be populated from thecluster before. If instead it's specified as constants.VALUE_NONE we'll...
ImportExport: make src_node and src_path optional
If src_node is not there we'll default to using the currently exportedinstance name as src_path. Also, if src_path is not absolute we'll lookfor it in EXPORT_DIR.
LUCreateInstance: handle import without src_node
If we get called with no source node we'll thread src_path as aninstance name exported in EXPORT_DIR in one of the nodes and look forit with the export_list rpc call.
LUCreateInstance: keep src node lock on import
Currently the node lock also guards against removing the import at thewrong time, so if we're importing an instance image we want to keep thesource node locked. In the future we might want to put export locks at a...
Fix master failover
The ssconf files were not updated by the master failover. We need topush them, and since we already have RPC initialized, we can use thestandard ConfigWriter to do so - this will take care of both the configfile and the ssconf files....
Adjust cluster-verify to check for candidate role
Currently cluster verify checks all nodes for the same set of files,even if the nodes are not master candidates.
This patch adds back checking of ssconf files for consistency and splitsthe checksum check into different error reporting messages based on...
Add candidate pool size checks in verify
Prevent demotion from candidate based on pool size
In gnt-cluster modify we prevent demotion from the candidate role ifthere are not enough master candidates left.
Add cluster candidate pool size parameter
This patch adds a new cluster paramater "candidate_pool_size" whichtracks the desired size of the list of nodes with the master_candidateflag set.
Prevent master failover to a non candidate node
Add the list of master candidates to ssconf
Restrict job propagation to master candidates only
This patch restricts the job propagation to master candidates only, bynot registering non-candidates in the job queue node lists.
Note that we do intentionally purge the job queue if a node is toggledto non-master status....
Restrict config replication to master candidates
This patch restricts the config data replication to master candidatesonly.
Add a gnt-node modify operation
This patch adds the OpCode, LogicalUnit and gnt-node command formodifying node parameters, more specifically the master candidate flagfor a node.
Add master/master_candidate fields to node list
This patch adds listing of the master_candidate field (as Y/N) and ofthe master role (again Y/N) for nodes.
Introduce a new 'master_candidate' node attribute
The field is not yet used.
Simplify a little the ssconf update
We have (again) the KeyToFilename function, so we move the writing ofthe files to a method under SimpleStore.
Replicate the node list in ssconf
This patch adds node_list in the list of replicated values fromConfigWriter.
Revert "Get rid of ssconf"
This partially reverts the "Get rid of ssconf" patch.
It adds back a simpler version of the SimpleStore class, and drops theWritableSimpleStore class. The new version of the class also hasnode_list as a new key, and increases the size of the keys so that big...
Fix RpcRunner._StaticSingleNodeCall
Unfortunately, a rpc.Client object was passed as the first parameter,causing the function to always fail.
Found during QA testing.
InitCluster: initialize master node serial_no
Currently it was left alone, and thus its value was "null".
Fix errors when the node info RPC is incomplete
[Forward-port from the 1.2 branch]
If ganeti starts before xend, the node information will not have all thefields filled in. The patch changes so that missing keys will be treatedas unknown (this applies to other cases as well, not only xend not...
RAPI:Fix root list and unittest for it.
RAPI: Switch from opcodes to no native 2.0 queries.
jqueue: Always print message for 100% when inspecting queue
jqueue: Allow jobs waiting for locks to be canceled
- Add new "canceling" status- Notify clients when job is canceled- Give a return value from CancelJob- Handle it in the client library
Improve the node add operation
Currently, the node add operation uses a job to query the node name andthe bootstrap function directly reads the config file for the clustername.
This patch changes to that both the cluster name and the verification ofthe node is done via queries to the master....