Add job queue design document
Reviewed-by: iustinp
Add an 'index' of design documents
This will be an overview document, enumerating the changes without goinginto details and pointing to the actual documents.
Reviewed-by: ultrotter
Add opcode execution log in job info
This patch adds the job execution log in “gnt-job info” and also allowsits selection in “gnt-job list” (however here it's not very useful asit's not easy to parse). It does this by adding a new field in the queryjob call, named ‘oplog’....
Move a hardcoded constant to constants.py
For now we only use the ‘C’ protocol so we can put it in constants.pyinstead of hardcoding it.
Reviewed-by: imsnah
Enable the use of shared secrets
This patch enables the use of the shared secrets for DRBD8 disks, using(hardcoded in constants.py) the md5 digest algorithm.
For making this more flexible, either we implement a cluster parameter(once the new model is in place), or we can make it ./configure-time...
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...
Add a info subcommand to gnt-job
Currently, it is hard to examine a job in detail; the output of ‘gnt-joblist’ is not easy to parse.
The patch adds a ‘gnt-job info’ command that is (vaguely) similar to‘gnt-instance info’ in that it shows in a somewhat easy to understand...
Implement job summary in gnt-job list
It is not currently possibly to show a summary of the job in the outputof “gnt-job list”. The closes is listing the whole opcode(s), but thatis too verbose. Also, the default output (id, status) is not veryuseful, unless one looks for (and knows about) an exact job ID....
Nicely sort the job list
Unless we decide to change the job identifiers to integer, we should atleast sort the list returned by _GetJobIDsUnlocked.
Move the pseudo-secret generation to utils.py
The bootstrap code needs a pseudo-secret and this is currently generatedinside the InitGanetiServerSetup function. Since more users will needthis, move it to utils.py
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...
Allow listing of the serial_no via gnt-* list
This patch adds listing of the serial_no attribute in gnt-instance andgnt-node list, and updates to the manpages to reflect the change.
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...
Add serial_no attributes to objects
This patch adds the ‘serial_no’ attribute to the other top-level objects(the configuration object itself, the nodes and the instances).
Replace a cfg.AddInstance with UpdateInstance
This seems to be the last (deprecated) use of AddInstance in order toupdate an instance.
The patch also removes a whitespace-at-eol case.
Add design doc for the disk changes
Fix iallocator name
port forward of patch from revision 1690 with following message:
Patch on revision 1686 used the wrong field: ial.name, which is the instancename and not the iallocator name. self.op.iallocator is the right field.
Sorry for this inconvenience....
Fix a broken format string
This patch fixes a broken format string. It's expecting 3 parameters, but onlygets 2. This change will add the missing parameter. This is a forward-portof the fix in Ganeti 1.2
Design doc for the master daemon
It's not complete, but I hope it's up to date. It's restructured text,but no make rules or such for html output are needed, it's readableas-is.
Switch config.py to logging
A couple of more modules are using the obsolete logger functions, configbeing one of them.
Switch to static minors for DRBD
With some todos remaining, this patch switches the DRBD devices to usethe passed minors, and the cmdlib code (add instance and replace disks)to request and assign minors to the DRBD disks.
Todos: - look at the disk RPC calls to see which can be optimized away, since...
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....
Fix disk replace secondary with static minors
The code in 'updating instance configuration' section of the replacedisks with change secondary node was setting a wrong new logical_id forthe drbd devices (only set the new node, not the new minor). The patch...
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)....
Apply filter properly in LUQuery{Nodes, Instances}
Currently when not locking all nodes/instances are returned, regardlessif the user asked only for some of them. With this patch we return tothe previous behaviour: - if no names are specified return info on all current ones...
Remove auto_balance from burnin/cmdlib
There is no such feature in trunk yet.
Add utils.ReadFile function
It abstracts exception handling and is like a complement toutils.WriteFile.
doc/locking.txt: Job queue functions can be called from LUs
The previous description was unclear. Reported by Guido Trotter.
Make burnin aware of hvm device type flags.
Merged from branches/ganeti/ganeti-1.2 r1648Use static values for new hvm instance flags
GetAllInstancesInfo, change internal iterator name
GetAllInstancesInfo used "node" as an iterator name. Change it toinstance to make it less confusing.
gnt-instance: fix tags commands online help
It used to refer to "nodes", which was confusing.
Parallelize Tag operations
For now we lock the instance/node for adding/deleting tags from it, butwe could probably in the future do without, with more support from theconfig for atomic operations.
Parallelize LUSetClusterParams (and add a FIXME)
Fix a typo in gnt-instance.sgml
Parallelize LURemoveExport
Parallelize LURemoveInstance
Using the new add/remove infrastructure this becomes pretty easy! :)
Parallelize LUCreateInstance
Finally, instance create on different node, without iallocator, can runin parallel. Iallocator usage still needs all nodes to be locked,unfortunately. As a bonus most checks which could have been moved toExpandNames, before any locking is done....
Implement adding/removal of locks by declaration
With this patch LUs can declare locks to be added when they start and/orremoved after they finish. For now locks can only be added in theacquired state, and removed if owned, and added locks default to be...
LockSet: forbid add() on a partially owned set
This patch bans add() on a half-acquired set. This behavior waspreviously possible, but created a deadlock if someone tried to acquirethe set-lock in the meantime, and thus is now forbidden. ThetestAddRemove unit test is fixed for this new behavior, and includes a...
Fix typo in a locking.py comment
Use is_owned to determine whether to unlock
Now that is_owned is public we don't need to play games at the end of anLU. If we're still owning anything we just release it.
Add GanetiLockManager.is_owned function
This is a public version of the private function we already had.We don't just change the previous version because it had lots of usersin the library itself and in the testing code.
Fix LockSet._names() to work with the set-lock
If the set-lock is acquired, currently, the _names function will fail ona double acquire of a non-recursive lock. This patch fixes the behavior,and some lines of code added to the testAcquireSetLock test check that...
Add gnt-instance (start|stop) --submit
Finish the --submit changes with these two, which (because they aremulti-opcode commands) require special handling.
jqueue: Add common RPC error handling function
We didn't decide yet what exactly it should do with failed nodes.
Remove locking of instances in certain queries
This patch is similar to the node patch (rev 1650). We disable lockingof instance (and nodes) if we only query static information.
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.
Add ConfigWriter._UnlockedGetInstanceList/Info()
This patch splits the GetInstanceInfo and GetInstanceList methods intotwo parts, one locked one _Unlocked similar to the way nodes arequeried.
Do not use jobs in gnt-instance _ExpandNames()
In the gnt-instance script, _ExpandNames() uses jobs to query instancenames. This is not optimal, so we change it to use queries.
Implement "--submit" on gnt-instance
This patch adds support for the “--submit” parameter in the gnt-instancescript, for the commands where it makes sense.
Rewrite the 'only submit job' handling in scripts
The "sys.exit(0)" was not nice as you couldn't differentiate it fromother exit codes. We change this to a specially defined exception forthis, so that multi-opcode commands can handle this nicely.
Optimize the OpQueryNodes for names only
Currently, OpQueryNodes is locking all nodes (in shared mode), whichwill also block the special case of querying only for the node names(this is needed for gnt-cluster command, for example). There is nological requirement to not give the administrator enough power if she/he...
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).
ganeti-noded: Add constant for queue lock timeout
Never remove job queue lock in node daemon
Otherwise, corruption could occur in some corner cases. E.g. whenLeaveNode is running in a child and is in the process of removingqueue files, the main process gets killed, started again and getsa request to update the queue. This is rather extreme corner case,...
Implement master startup safety check
This is an initial version of the master startup checks. It's a veryrudimentary change, however in normal usage (an old master was started,the rest of the cluster is functioning normally) it will succeed inpreventing wrong startups....
Export backend.GetMasterInfo over the rpc layer
We create a multi-node call so that querying all nodes for agreementwill be fast.
Change backend._GetMasterInfo to return more data
The _GetMasterInfo() function needs to export the master name too to beuseful in master safety checks. This patch makes it a public (no _)function and adds a third element in the return tuple. Its callers are...
Parallelize LUQueryInstanceData
Parallelize LUVerify{Cluster,Disks}
These are two easy querying LUs which require shared access to allnodes/instances.
Parallelize LUReplaceDisks
This is the most complex parallelization so far. We have to lock oneinstance (and its nodes) plus one more node if doing a remote replace,or all nodes if doing a remote replace with iallocator.
_LockInstancesNodes: support append mode
This will be used to lock the instance's nodes in addition to some more.
Processor: remove ChainOpCode
This function was incompatible with the new locking system, and itsusage has been removed from the code. For now LUs share code by callingcommon module-private functions in cmdlib.py, in the future they willuse tasklets (when those will be implemented)....
Parallelize LU{A,Dea}ctivateInstanceDisks
Now that they are not used in other opcodes by chaining,this can easily be done.
LUReplaceDisks: remove use of ChainOpCode
The calls to OpActivateInstanceDisks and OpDeactivateInstanceDisks hasbeen replaced by _StartInstanceDisks and _SafeShutdownInstanceDisksrespectively. This is the last usage of ChainOpCode.
Create new _SafeShutdownInstanceDisks function
This new function checks whether an instance is running, before shuttingdown its disks. This is what the Exec() of LUDeactivateInstanceDisksdid, so that is replaced by a call to this function.
Fix a typo in LogicalUnit.ExpandNames docstring
s/locking.LEVEL_INSTANCES/locking.LEVEL_INSTANCE/
Use constants.LOCKS_REPLACE instead of hardcoding
This constant replaces what we used to write in recalculate_locks, andrepresents the lock recalculation mode. It lives in constants.py becauseit's used only in cmdlib, and thus doesn't deal with the locking library...
Fix LUReplaceDisks with iallocator
self._RunAllocator() sets self.op.remote_node, but doesn't return thenew remote node. If we set it to the return value of the function webasically reset it to None, and iallocator is never run.
Use lock timeout for queue updates in ganeti-noded
This helps to prevent complete deadlocks.
Fix LUGrowDisk
The rpc library returns a list, not a tuple, so we'll accept both.
Fix iallocator run
OpVerifyDisks returns a list, not a tuple
Fixing the check in gnt-cluster, or gnt-cluster verify-disks is broken.Since the version in 1.2 used to return a tuple we'll accept both.
Parallelize LUExportInstance
Unfortunately for the first version we need to lock all nodes. The patchdiscusses why this is and discuss ways to improve this in the future.
Parallelize LUGrowDisk
LURebootInstance: lock only primary when possible
When rebooting an instance and we're not changing it's disks status (allthe cases except in a "full" reboot) we can lock just its primary node.
Add primary_only flag to _LockInstancesNodes
As the name says when the flag is on (the default is off) only theprimary nodes are locked, as opposed to all of them.
utils.FileLock: Implement timeout
The timeout can be used in ganeti-noded to be more robust againstdeadlocks.
Add lock documentation for job queue and ganeti-noded
Also change title formatting to match client-api.txt.
noded: Get job queue lock while purging queue content
Only one process should modify the queue at the same time.
QA: Remove dry run mode
It didn't work as planned because some commands depend on the returnvalue or output of some operations.
Add locking.ALL_SET constant and use it
Rather than specifying None in needed_locks every time, with a nicecomment saying to read what we mean rather than what we write, and thatNone actually means All, in our magic world, we'll hide this secretunder the ALL_SET constant in the locking module, which has value, you...
utils.SplitTime: More rounding fixes
SplitTime didn't round the same on different platforms. This patch changesit to use microseconds and not care about rounding.
Remove bom-byte
This is not nice, removing it :)
Please use 'set nobomb' in your vi init file.
Prevent mistakes using _GetWantedNodes
All the users of _GetWantedNodes have been converted to be concurrentLUs, and thus cannot call this function with an empty list of nodesanymore. This patch makes this restriction a part of the functionitself. This prevents mistakes in new concurrent LUs, and creates more...
Paralleliza LUQueryNodeVolumes and LUQueryExports
Parallelize LUDiagnoseOS
LUQueryExports: make 'node' field mandatory
It turns out this fields was already mandatory. If it hadn't beed valid,in fact, a value of None would have been passed to _GetWantedNodes whichwould have thrown an exception.
s/Chain(OpQueryExports)/rpc.call_export_list(...)/
Parallel opcodes are not (yet?) supported for chaining. Turns outthough that chaining is used only four times in the code, and twice it'sfor querying exports. But what's the need to chain the full opcode, when...
Fix wrong indentation in LUQueryNodes
Merge r1607 from branches/ganeti/ganeti-1.2
Use a default vnc_bind_address if None is specified
merge r1569 from branches/ganeti/ganeti-1.2
Implement more options for gnt-backup import
merge r1568 from branches/ganeti/ganeti-1.2
Add more fields to gnt-instance list
merge r1548 from branches/ganeti/ganeti-1.2
Fix wrong wording of instance rename error message.
merge r1547 from branches/ganeti/ganeti-1.2
Document behaviour of gnt-instance console for HVM
merge r1542, r1543, r1573 from branches/ganeti/ganeti-1.2
Implement interactive instance OS reinstall.
merge r1541 from branches/ganeti/ganeti-1.2
more information for VNC console port