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.
Reviewed-by: ultrotter
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.
Reviewed-by: imsnah
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
Reviewed-by: amishchenko
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
Reviewed-by: iustinp
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)....
burnin: don't do export/import for file storage
This is currently not supported, so don't try to do export/import inthis case.
KVMHypervisor add two missing 'constants.'
Some calls to the HV parameters were missing them.
KVMHypervisor fix to case misspellings
cluster init: don't discard the hypervisor
On cluster init if the user specifies a default hypervisor (with -t)which is not in the default list of enabled hypervisors (currently justxen-pvm) without explicitely specifying the list we silently overridethe choice....
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...
SetInstanceParams: handle default/none values
If the hv/be parameter lowercase value is set to "default" we'll passconstants.VALUE_DEFAULT, if it's set to "none" we'll passconstants.VALUE_NONE.
Update gnt-backup online help
--src-node and --src-dir are not mandatory anymore
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...
burnin: fix usage of diskless template
This allows burnin to work with diskless instances (since we cannot passright now no disks to it).
Update QA scripts to new cluster parameters
There are still issues, especially with "gnt-instance modify" andresetting values. However, this is a start.
gnt-instance add: Remove "--os-size" and "--swap-size"
They're not used anymore.
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
gnt-job: Print message from CancelJob to standard output
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....
Fix logic bug in rev 2072
In revision 2072 "ConfigWriter: change cluster serial meaning" I misreadthe serial_no update logic: it was about updating the serial number onthe object itself, not on the cluster.
So we don't actually have at all cluster serial number increase when a...
jqueue: fix a bug in an error path
Dictionaries raise KeyError, and not ValueError when invalid keys arepasses to del.
ConfigWriter: change cluster serial meaning
Currently, we increase the cluster serial number for instance additions,removals and renames. This is conforming with the REST paradigm, howeverit means that for each of these operations, we need to push ssconf...
instance import: adapt to multi-disk/nic world
This is mostly a copy from gnt-instance add; import works, but it's notoptimal - device count/parametrs should be able to be reused.
Fix gnt-backup export
This patch fixes a bug in disk calculation for gnt-backup export, whichcompletely broke one-disk instance export.
The patch also corrects some error messages and style issues.
Fix a message in LUExportInstance
We never verified the node name before, so this is most likely not anon-retrieve but a wrong name case.
Allow network-less instances
Currently there's no way to specify no NICs for an instance, even thoughthis is a supported configuration.
The patch adds a --no-nics option to gnt-instance add.
Fix gnt-job submit
The submit function was using a very old API. This patch brings it up todate.
Small change to job failure output
Currently, job failures are done by raising OpExecError(job result). Fora one-opcode job that failed, this is very non-intuitive:Failure: command execution error:[u'Disk size change not possible, use grow-disk']
This patch changes the output in two ways:...
Fix file-based block devices
We changed a while ago the protocol for opening block devices, butFileStorage was not changed. This patch makes it work again.
Fix instance creation
This patch fixes the diskless and drbd/file based instances. Sorry :(
ganeti-masterd: create RUN_GANETI_DIR as well
Since we're not sure ganeti-noded has started yet, we need to createRUN_GANETI_DIR before SOCKET_DIR as well, with the proper permissions.
convert run dir mode to constant
ganeti-noded used to create all directories under /var/run with anhard-coded mode. convert it to a constant.