History | View | Annotate | Download (29.4 kB)
Convert rpc module to RpcRunner
This big patch changes the call model used in internode-rpc fromstandalong function calls in the rpc module to via a RpcRunner class,that holds all the methods. This can be used in the future to enablesmarter processing in the RPC layer itself (some quick examples are not...
Disable re-reading of config file
Since the objects read from the config file are passed to the variousthreads, it's unsafe to re-read the config file (and throw awayConfigWriter._config_data). As such, we disable the re-reading of thefile (since now the master is the owner the file, it makes not sense to...
Convert config.py
The configuration version is now again in the configuration file.
Reviewed-by: iustinp
Add new query to get cluster config values
This can be used to retrieve certain cluster config values fromwithin clients.
OpDumpClusterConfig was not used anywhere, hence I'm just reusingit. The way ConfigWriter.DumpConfig returned the configurationwas not thread-safe, anyway (no deepcopy)....
Move functions from ssconf.py elsewhere
These functions will be used to access config values instead of usingssconf.
Add cluster options from ssconf to configuration
ssconf will become write-only from ganeti-masterd's point of view,therefore all settings in there need to go into the main configurationfile.
Move instantiation of config into bootstrap.py
Future patches will add even more variables to the cluster config.Adding more parameters wouldn't make the function easier to use andit doesn't make sense to pass them to another function, as it'sonly done once in bootstrap.py on cluster initialization....
Extend DRBD disks with shared secret attribute
This patch, which is similar to r1679 (Extend DRBD disks with minorsattribute), extends the logical and physical id of the DRBD disks with ashared secret attribute. This is generated at disk creation time and...
Fix a bug related to static minors
When the node does not yet have any minors allocated, the first minor(0) will not be entered in the ConfigWriter._temporary_drbds structure.This does not happen for our current usage, since we always ask for twominors (so the next call will not match this case), but it will be...
Add checks for tcp/udp port collisions
In case the config file is manually modified, or in case of bugs, thetcp/udp ports could be reused, which will create various problems(instances not able to start, or drbd disks not able to communicate).
This patch extends the ConfigWriter.VerifyConfig() method (which is used...
Update the cluster serial_no on certain operations
This patch adds update of the cluster serial number for: - add/remove node (as the cluster's node list is changed) - add/remove/rename instance (as the cluster's instance list is changed) - change the volume group name...
Initialize and update the serial_no on objects
This patch add initialization of the serial_no on instance and nodes,and update of the field whenever an object is updated in the genericcase, via ConfigWriter.Update(obj) and in the specific case ofinstances' state being modified manually....
Switch the global serial_no to the top object
Currently the serial_no that is incremented every time the configurationfile is written is located on the 'cluster' object in the configurationstructure. However, this is wrong as the cluster serial_no should be...
Switch config.py to logging
A couple of more modules are using the obsolete logger functions, configbeing one of them.
Reviewed-by: imsnah
Implement config support for drbd static minors
This patch adds support for allocating static minors.
Like for the LVM uuids, we add a new cache for the temporarily allocatedrequests, and the users of the new methods must manually clear thecache. If this doesn't happen, at worst we lose some minors....
Extend DRBD disks with minors attribute
This patch converts the DRBD disks to contain also a minor (per eachnode) attribute. This minor is not yet used and is always initializedwith None, so the patch does not have any real-world impact - except forautomatically upgrading config files (it adds the minors as None, None)....
GetAllInstancesInfo, change internal iterator name
GetAllInstancesInfo used "node" as an iterator name. Change it toinstance to make it less confusing.
Add an atomic ConfigWrite.GetAllInstanceInfo()
In order to be able to query instance without locking them, we need thesame atomic query of multiple instances as for nodes.
Reviewed-by: ultrotter
Add ConfigWriter._UnlockedGetInstanceList/Info()
This patch splits the GetInstanceInfo and GetInstanceList methods intotwo parts, one locked one _Unlocked similar to the way nodes arequeried.
Add a way to export all node information at once
The patch adds a new function to export all node information at once(i.e. atomically with respect to the configuration lock).
Implement {Add,Readd,Remove}Node in GanetiContext
By doing this we've a central place which coordinates what needs to bedone when adding or removing nodes. Another patch will add calls intothe job queue.
Two log messages move to config.py.
When removing a node, node_leave_cluster is now called after it has...
Fix pylint-detected issues
This is mostly: - whitespace fix (space at EOL in some files, not all, broken indentation, etc) - variable names overriding others (one is a real bug in there) - too-long-lines - cleanup of most unused imports (not all)...
ConfigWriter: synchronize access
Since we share the ConfigWriter we need somehow to make sure thataccessing it is properly synchronized. We'll do it using thelocking.ssynchronized decorator and a module-private shared lock.
This patch also renames a few functions, which were called inside the...
ConfigWriter: remove _ReleaseLock
Remove empty function _ReleaseLock and all its calls. Since we onlyhave one configwriter per cluster the locking needs to cover all thedata in the object, and not just the file contents. Locking inConfigWriter will be handled using the ganeti locking library....
Use new ssconf function to check configuration version
Upgrades will be handled in future patches.
Wrap exception in _DistributeConfig code
nodelist.remove(X) could potentially raise a ValueError (even if the chancethat the current node is not in the list are pretty scarce, and its absenceshould raise a red flag anyway). If this happens let things go on, as that's...
Simplify target generation in DistributeConfig
Currently we get the list of nodes, and for each one extract all its info, andjust to exclude it if the name matches ours. Since the list of nodes is a listof names just use .remove() to exclude ourself from it, and use that list...
Only change instance status if not already so
This patch makes the _SetInstanceStatus only change the status of theinstance (in the config file) if it's not already in the desired state.This skips the increase of the config serial no without actual data...
Reuse common code between MarkInstance{Up,Down}
This patch creates a new method ConfigWriter._SetInstanceStatus thatconsists of the common code between MarkInstanceUp and MarkInstanceDown.These two methods become wrappers over the _SetInstanceStatus.
Abstract the json functions into a separate module
This simple patch adds a new module that holds the simplejson functionsfor serialization/deserialization. This reduces the amount of redundantcode.
The patch also adds some normalizations to the json output:...
Modify LURenameInstance to support file backend
This patch does two things:- Modify LURenameInstance.Exec to rename directory when a file-based instance is renamed- Modify config.RenameInstance() to replace the directory name in config.data for file devices...
Fix SetVGName() to access object not dict
Add method SetVGName() to config.py
Allow instance MAC address to be set.
Allow the MAC address of an instance to be specified optionally duringinstance creation and later to be changed via instance modify.
Fix logging of some checks in LUClusterVerify
Currently, the results of ConfigWriter.VerifyConfig() are lost. Makesure we log them too in cluster verify.
Rename utils.GetUUID to utils.NewUUID.
Reviewed-by: schreiberal
Initial implementation of drbd8 template type
This is a partially working drbd8 template type. It does: - add/remove - startup/failover/shutdown
Not working is replace disks, which needs custom code for this template.
Abstract more strings values into constants
Currently, the disk types are defined using constants in the code.Convert those into constants so that we can easily find them and checktheir usage.
Note that we don't rename the values of the constants as they are used...
Enable the ConfigWriter to keep track of updates
This allows external callers to determine if the configuration has beenchanged.
Use the kernel's ability to generate UUIDs.
This removes the dependency on either the uuid module or e2fsprogs' uuidgen.
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.
Revert a debugging 'raise' from rev 195
As far as I understand, this was just a debugging aid. Remove it so thatconfiguration errors are nicely handled.
Change configuration storage format from Pickle to JSON.
- Add NEWS file with major changes between versions.- Bump RPC version number- No longer serialize in RPC, but just convert to dict
Old Pickle based configuration files can be converted using the cfgupgrade...
Remove requirement that host names are FQDN
We currently require that hostnames are FQDN not short names(node1.example.com instead of node1). We can allow short names as longas: - we always resolve the names as returned by socket.gethostname() - we rely on having a working resolver...
Add rename instance support to ConfigWriter
This patch adds support for renaming instances to the ConfigWriterclass. It's needed in here in order to guarantee that we don't lose theinstance during the rename (the instance will be there, either with the...
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...
Prepare for the tags implementation: - add an Update method on the ConfigWriter class; - make the AddInstance method not log disks for diskless types (helps with testing) - implement limited testing for the ConfigWriter with focus on the new Update method
Re-stat the config file when we write it so that the next _OpenConfig()won't reread it if not modified by someone else.
Implement a standard way of getting the cluster object from theconfiguration.
Change logival volume names to not be based on the instance's name, butinstead use an UUID prefix and a suffix denoting the disk iv_name(sda/sdb) and possibly it's type (data/meta).
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...
Don't pass master_node
Comment formatting updates.
The master_node is no longer stored in the config file (but in sstore)and all users have been converted, let's remove it from the slots of thecluster object.
Also let's move the tcpudp_port_pool to the cluster object.
Get ports from configuration if there are some.
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.