History | View | Annotate | Download (12.3 kB)
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>
Wrap lines over 80 characters
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Luca Bigliardi <shammash@google.com>
Remove SimpleConfigReader.GetHypervisorType
We haven't had that config file entry for a while.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
SimpleConfigReader: handle stat() errors
Also, catch EnvironmentError, rather than IOError, when trying to readthe file.
SimpleConfigReader: add IP address lookup helpers
Add the following functions to SimpleConfigReader:GetInstanceByIp, nic ip -> instance nameGetNodePrimaryIp, node name -> node primary ipGetInstancePrimaryNode, instance name -> primary node
For the first one we precalculate the _ip_to_instance, so we don't have...
SimpleConfigReader.GetNodeStatusFlags
Adding a way to retrieve the three node status flags, all in one go,from SimpleConfigReader. Non-existing nodes are handled by returning"None".
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
SimpleConfigReader: s/Reload/_Load/
Since we use it also to load the config file initially we rename theReload function to _Load. Then we re-export it as Reload to clients(since for them it's a reload).
Signed-off-by: Guido Trotter <ultrotter@google.com>...
SimpleConfigReader.Reload, avoid double reloads
If for some reason we try to call Reload twice but the config filehasn't changed, we don't want to load it again. Use stat() on the fileto cheaply avoid that situation.
We also return a boolean value, according to whether we have reloaded...
SimpleConfigReader: add serial numbers reading
GetConfigSerialNo and GetClusterSerialNo return respectively the serialnumber for the config and for the cluster object.
SimpleConfigReader.Reload()
Rather than initializing the config statically at class creation time,we load it every time Reload() is called.
SimpleConfigReader: Handle errors when loading
Handling both IOErrors and ValueErrors (thrown by the simplejson loader)
ssconf.CheckMasterCandidate
This function checks that the current node is a master candidate, andterminates otherwise. It will be used upon ganeti-confd startup.
Add master candidates IPs informations to ssconf
This will be used when querying confd, in order not to rely on DNS beingavailable.
Signed-off-by: Luca Bigliardi <shammash@google.com>Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Add nodes IPs informations to ssconf
Having a list of primary/secondary IPs of all the nodes in ssconf can be usefulfor scripts/hooks which need to automatically configure network properties forthe whole cluster (e.g.: ipsec/netfilter rules) without relying on a...
Simplify InitConfig and remove SimpleConfigWriter
InitConfig currently creates the cluster config_data, then puts it intoa dict, passes it to SimpleConfigWriter to load it from a dict (whichjust reuses the dict value) and then saves it. The SimpleConfigWriter is...
Merge branch 'next' into branch-2.1
Conflicts:
daemons/ganeti-masterd...
Remove SimpleConfigWriter.SetMasterNode
This function is not used.
Convert ssconf._ReadFile to utils.ReadFile
Making ssconf._ReadFile a wrapper over utils.ReadFile
Signed-off-by: Guido Trotter <ultrotter@google.com>
rapi: make tags query not use jobs
Currently the rapi tags query implementation is similar to the commandline one: it submits OpGetTags jobs. This not good, since this being anAPI it can be used a lot and can pollute the job queue with many suchtrivial jobs....
Add a new ssconf file with the cluster tags
Since the cluster tags are/should be more-or-less static, add them as anssconf key, so that querying them is possible without creating ajob/requiring the masterd to be running.
Reviewed-by: imsnah
ssconf: add some more keys and some fixes
This patch adds the online node list and instance list to the ssconfkeys. In order to do distribute correctly the instance list, we need toupdate the cluster serial number on instance additions and removals.
The patch also changes the permissions on the ssconf files to be 0444:...
Add a new ssconf file with the ganeti version
The patch adds a new ssconf file containing the ganeti version.
Add the offline node list to ssconf
The patch also changes the various node list generation to be moreconsistent.
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).
Prevent master failover to a non candidate node
Add the list of master candidates to ssconf
Simplify a little the ssconf update
We have (again) the KeyToFilename function, so we move the writing ofthe files to a method under SimpleStore.
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...
Pass ssconf values from master to node
Instead of parsing the configuration on the node, we pass the ssconfvalues from the master.
Reviewed-by: iustinp
ganeti.ssconf: Add function to write ssconf files
This function will be used to write ssconf files from the node daemon.By creating a lock file, we synchronize different child processes ofganeti-noded to not overwrite each other's changes. Also, external...
Fix for gnt-cluster init.
Fix ssconf.GetMasterAndMyself
The ssconf migration left this out.
Reviwed-by: imsnah,ultrotter
Get rid of ssconf
Remove leftovers from ssconf.
Add simple configuration reader/writer classes
This will be used to read the configuration file in the node daemon.The write functionality is needed for master failover.
Make gnt-* commands fail nicely on non-masters
This patch adds a check that we are on the master after failing toconnect to the socket, and log nicely the master name.
Reviewed-by: ultrotter
Implement checking for the master role in rapi
This patch moves the CheckMaster function from ganeti-masterd to ssconf(most logical place, it cannot go in utils since we would have recursiveimports between ssconf and utils) and changes ganeti-rapi to also call...
Move SetKey to WritableSimpleStore and use it
Before we used to be able to update SimpleStore by just calling SetKey, thisfeature is now moved to an external class, which inherits from it. In thispatch the new WritableSimpleStore class is also put to use, in the LUs that...
Remove SimpleStore cache
SimpleStore is instantiated anew most of the times it's used, so havinga cache inside it serves no purpose. Removing it.
ssconf: update the SetKey docstring
SetKey is used, other than for adding new nodes, in another few cases. Updatethe docstring to reflect this, so we don't mislead people reading it.
Support config version in ssconf
Add SS_FILE_STORAGE_DIR to ssconf
Author: manuel.franceschiniReviewed-by: iustinp
Replace custom file writing code with utils.WriteFile
Remove the shebang from modules
Since modules are not directly executables, remove the shebang fromthem. This helps with lintian warnings.
Also make the autogenerated _autoconf.py contain two comment lines atthe beginning, like the other modules.
Style changes for pep-8 and python-3000 compliance.
This changes the raising of exceptions from: raise Exception, valueto raise Exception(value)
as the first form will be removed in python-3000 and the second form ispreferred now.
The changes also involve a few cases of changing from raising standard...
Move the cluster name from ConfigWriter to SimpleStore.
Reason: if left ConfigWriter, nodes don't know to which cluster they belong.This will bite us later when we'll revisit node join operation.
Cons: we lose the cluster name from the config file, which means a...
Big change/cleanup in relation to the master startup: - move the master node name from the ConfigWriter to SimpleStore (all nodes need this, and it was the only thing pulled in from the ConfigWriter on nodes) - fix mcpu.py and the testing w.r.t. this change; for testing, rename...
Initial commit.