Guido Trotter [Tue, 30 Sep 2008 10:21:10 +0000 (10:21 +0000)]
locking design: explain use of async mode
Before we were discussing this possible future feature, and its
drawbacks, but not its usefulness. This patch corrects this.
Reviewed-by: iustinp
Guido Trotter [Tue, 30 Sep 2008 10:20:58 +0000 (10:20 +0000)]
locking design: talk about removing locks
Reviewed-by: iustinp
Guido Trotter [Tue, 30 Sep 2008 10:07:08 +0000 (10:07 +0000)]
Import (and update) granular locking design doc
Reviewed-by: iustinp
Iustin Pop [Tue, 30 Sep 2008 09:36:49 +0000 (09:36 +0000)]
Abstract the timestamp formatting into cli.py
Currently we format the timestamp inside the gnt-job info function. We
will need this more times in the future, so move it to cli.py as a
separate, exported function.
Reviewed-by: imsnah
Michael Hanselmann [Mon, 29 Sep 2008 17:55:49 +0000 (17:55 +0000)]
Add job queue design document
Reviewed-by: iustinp
Iustin Pop [Mon, 29 Sep 2008 16:18:30 +0000 (16:18 +0000)]
Add an 'index' of design documents
This will be an overview document, enumerating the changes without going
into details and pointing to the actual documents.
Reviewed-by: ultrotter
Iustin Pop [Mon, 29 Sep 2008 15:38:40 +0000 (15:38 +0000)]
Add opcode execution log in job info
This patch adds the job execution log in “gnt-job info” and also allows
its selection in “gnt-job list” (however here it's not very useful as
it's not easy to parse). It does this by adding a new field in the query
job call, named ‘oplog’.
With this, one can get a very clear examination of the job. What remains
to be added would be timestamps for start/stop of the processing for the
job itself and its opcodes.
Reviewed-by: imsnah
Iustin Pop [Mon, 29 Sep 2008 13:15:33 +0000 (13:15 +0000)]
Move a hardcoded constant to constants.py
For now we only use the ‘C’ protocol so we can put it in constants.py
instead of hardcoding it.
Reviewed-by: imsnah
Iustin Pop [Mon, 29 Sep 2008 13:15:20 +0000 (13:15 +0000)]
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
selectable.
Reviewed-by: imsnah
Iustin Pop [Mon, 29 Sep 2008 13:15:08 +0000 (13:15 +0000)]
Extend DRBD disks with shared secret attribute
This patch, which is similar to r1679 (Extend DRBD disks with minors
attribute), extends the logical and physical id of the DRBD disks with a
shared secret attribute. This is generated at disk creation time and
saved in the config file.
The generation of the secret is done so that we don't have duplicates in
the configuration (otherwise the goal of preventing cross-connection
will not be reached), so we add to config.py more than just a simple
call to utils.GenerateSecret().
The patch does not yet enable the use of the secrets.
Reviewed-by: imsnah
Iustin Pop [Mon, 29 Sep 2008 13:09:53 +0000 (13:09 +0000)]
Add a info subcommand to gnt-job
Currently, it is hard to examine a job in detail; the output of ‘gnt-job
list’ 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
format the details of a job.
The result formatter is the most complicated part, since the results are
not standardized; the code attempts to format nicely the most common
result types (as taken from a random job list), via a generic algorithm.
Reviewed-by: imsnah
Iustin Pop [Mon, 29 Sep 2008 13:09:34 +0000 (13:09 +0000)]
Implement job summary in gnt-job list
It is not currently possibly to show a summary of the job in the output
of “gnt-job list”. The closes is listing the whole opcode(s), but that
is too verbose. Also, the default output (id, status) is not very
useful, unless one looks for (and knows about) an exact job ID.
The patch adds a “summary” description of a job composed of the list of
OP_ID of the individual opcodes. Moreover, if an opcode has a ‘logical’
target in a certain opcode field (e.g. start instance has the instance
name as the target), then it is included in the formatting also. It's
easier to explain via a sample output:
gnt-job list
ID Status Summary
1 error NODE_QUERY
2 success NODE_ADD(gnta2)
3 success CLUSTER_QUERY
4 success NODE_REMOVE(gnta2.example.com)
5 error NODE_QUERY
6 success NODE_ADD(gnta2)
7 success NODE_QUERY
8 success OS_DIAGNOSE
9 success INSTANCE_CREATE(instance1.example.com)
10 success INSTANCE_REMOVE(instance1.example.com)
11 error INSTANCE_CREATE(instance1.example.com)
12 success INSTANCE_CREATE(instance1.example.com)
13 success INSTANCE_SHUTDOWN(instance1.example.com)
14 success INSTANCE_ACTIVATE_DISKS(instance1.example.com)
15 error INSTANCE_CREATE(instance2.example.com)
16 error INSTANCE_CREATE(instance2.example.com)
17 success INSTANCE_CREATE(instance2.example.com)
18 success INSTANCE_ACTIVATE_DISKS(instance1.example.com)
19 success INSTANCE_ACTIVATE_DISKS(instance2.example.com)
20 success INSTANCE_SHUTDOWN(instance1.example.com)
21 success INSTANCE_SHUTDOWN(instance2.example.com)
This is done by a simple change to the opcode classes, which allows an
opcode to format itself. The additional function is small enough that it
can go in opcodes.py, where it could also be used by a client if needed.
Reviewed-by: imsnah
Iustin Pop [Mon, 29 Sep 2008 13:08:44 +0000 (13:08 +0000)]
Nicely sort the job list
Unless we decide to change the job identifiers to integer, we should at
least sort the list returned by _GetJobIDsUnlocked.
Reviewed-by: imsnah
Iustin Pop [Sun, 28 Sep 2008 14:44:52 +0000 (14:44 +0000)]
Move the pseudo-secret generation to utils.py
The bootstrap code needs a pseudo-secret and this is currently generated
inside the InitGanetiServerSetup function. Since more users will need
this, move it to utils.py
Reviewed-by: ultrotter
Iustin Pop [Sun, 28 Sep 2008 14:43:30 +0000 (14:43 +0000)]
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 two
minors (so the next call will not match this case), but it will be
triggered if we only ask for one minor, and then ask again before adding
the instance to the config file.
Reviewed-by: ultrotter
Iustin Pop [Sat, 27 Sep 2008 20:45:01 +0000 (20:45 +0000)]
Add checks for tcp/udp port collisions
In case the config file is manually modified, or in case of bugs, the
tcp/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
in cluster verify) to check for duplicates between:
- the ports used for DRBD disks
- the ports used for network console
- the ports marked as free in the config file
Also, if the cluster parameter ‘highest_used_port’ is actually lower
than the computed highest used port, this is also flagged as an error.
The output from gnt-cluster verify will show (output manually wrapped):
node1 # gnt-cluster verify
* Verifying global settings
- ERROR: tcp/udp port 11006 has duplicates: instance3.example.com/network port,
instance2.example.com/drbd disk sda
- ERROR: tcp/udp port 11017 has duplicates: instance3.example.com/drbd disk sda,
instance3.example.com/drbd disk sdb, cluster/port marked as free
- ERROR: Highest used port mismatch, saved 11010, computed 11017
* Gathering data (2 nodes)
...
Reviewed-by: ultrotter
Iustin Pop [Sat, 27 Sep 2008 15:58:51 +0000 (15:58 +0000)]
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
The rule for updating this attribute is when cluster-wide properties are
changed, but not individual node/instance ones.
There are other remaining cases to handle, pending on the ssconf
changes.
Reviewed-by: ultrotter
Iustin Pop [Sat, 27 Sep 2008 15:58:41 +0000 (15:58 +0000)]
Allow listing of the serial_no via gnt-* list
This patch adds listing of the serial_no attribute in gnt-instance and
gnt-node list, and updates to the manpages to reflect the change.
Reviewed-by: ultrotter
Iustin Pop [Sat, 27 Sep 2008 15:58:22 +0000 (15:58 +0000)]
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 generic
case, via ConfigWriter.Update(obj) and in the specific case of
instances' state being modified manually.
Reviewed-by: ultrotter
Iustin Pop [Sat, 27 Sep 2008 15:58:13 +0000 (15:58 +0000)]
Switch the global serial_no to the top object
Currently the serial_no that is incremented every time the configuration
file is written is located on the 'cluster' object in the configuration
structure. However, this is wrong as the cluster serial_no should be
incremented only when the cluster state is changed (for whatever
definition of “changed” we will use), not simply because the
configuration file is written.
This patch changes so that the ConfigWriter._BumpSerialNo affects the
top-level ConfigData object.
Reviewed-by: ultrotter
Iustin Pop [Sat, 27 Sep 2008 15:58:03 +0000 (15:58 +0000)]
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).
Reviewed-by: ultrotter
Iustin Pop [Sat, 27 Sep 2008 15:57:52 +0000 (15:57 +0000)]
Replace a cfg.AddInstance with UpdateInstance
This seems to be the last (deprecated) use of AddInstance in order to
update an instance.
The patch also removes a whitespace-at-eol case.
Reviewed-by: ultrotter
Iustin Pop [Sat, 27 Sep 2008 11:32:52 +0000 (11:32 +0000)]
Add design doc for the disk changes
Reviewed-by: imsnah
René Nussbaumer [Thu, 25 Sep 2008 09:40:13 +0000 (09:40 +0000)]
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 instance
name and not the iallocator name. self.op.iallocator is the right field.
Sorry for this inconvenience.
Reviewed-by: imsnah
René Nussbaumer [Thu, 25 Sep 2008 08:42:14 +0000 (08:42 +0000)]
Fix a broken format string
This patch fixes a broken format string. It's expecting 3 parameters, but only
gets 2. This change will add the missing parameter. This is a forward-port
of the fix in Ganeti 1.2
Reviewed-by: imsnah
Iustin Pop [Wed, 24 Sep 2008 17:35:31 +0000 (17:35 +0000)]
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 readable
as-is.
Reviewed-by: imsnah
Iustin Pop [Wed, 24 Sep 2008 13:43:32 +0000 (13:43 +0000)]
Switch config.py to logging
A couple of more modules are using the obsolete logger functions, config
being one of them.
Reviewed-by: imsnah
Iustin Pop [Tue, 23 Sep 2008 12:10:44 +0000 (12:10 +0000)]
Switch to static minors for DRBD
With some todos remaining, this patch switches the DRBD devices to use
the 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
we now know the minor beforehand
- remove the _FindUnusedMinor usage from the few places it's still
used (not for actual disks, but for temporary use in meta devs) and
eventually replace with _CheckMinorUnused or such
Of course, this and/or the previous two patches break existing clusters.
Again.
Reviewed-by: imsnah
Iustin Pop [Tue, 23 Sep 2008 12:10:35 +0000 (12:10 +0000)]
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 allocated
requests, and the users of the new methods must manually clear the
cache. If this doesn't happen, at worst we lose some minors.
Todos remaining:
- implement duplicate check at configuration load, and at instance
add/instance update
- investigate automatically cleaning the cache on instance add/update
if the minors/instance/node pairs match
Reviewed-by: imsnah
Iustin Pop [Tue, 23 Sep 2008 12:10:26 +0000 (12:10 +0000)]
Fix disk replace secondary with static minors
The code in 'updating instance configuration' section of the replace
disks with change secondary node was setting a wrong new logical_id for
the drbd devices (only set the new node, not the new minor). The patch
fixes this by remembering the new logical_id that we use for activating
the drbd and reusing it (instead of recomputing).
Since the minors are not needed to be allocated before the LVs are
created, we also move the minor allocation step (currently as None)
after this step.
Reviewed-by: imsnah
Iustin Pop [Mon, 22 Sep 2008 11:32:16 +0000 (11:32 +0000)]
Extend DRBD disks with minors attribute
This patch converts the DRBD disks to contain also a minor (per each
node) attribute. This minor is not yet used and is always initialized
with None, so the patch does not have any real-world impact - except for
automatically upgrading config files (it adds the minors as None, None).
Reviewed-by: imsnah
Guido Trotter [Thu, 18 Sep 2008 11:13:10 +0000 (11:13 +0000)]
Apply filter properly in LUQuery{Nodes, Instances}
Currently when not locking all nodes/instances are returned, regardless
if the user asked only for some of them. With this patch we return to
the previous behaviour:
- if no names are specified return info on all current ones
- if some names are specified and are not found give an error
- otherwise return only info on the specified names
Reviewed-by: iustinp
Guido Trotter [Thu, 18 Sep 2008 11:12:50 +0000 (11:12 +0000)]
Remove auto_balance from burnin/cmdlib
There is no such feature in trunk yet.
Reviewed-by: iustinp
Michael Hanselmann [Wed, 17 Sep 2008 16:07:40 +0000 (16:07 +0000)]
Add utils.ReadFile function
It abstracts exception handling and is like a complement to
utils.WriteFile.
Reviewed-by: iustinp
Michael Hanselmann [Wed, 17 Sep 2008 14:51:49 +0000 (14:51 +0000)]
doc/locking.txt: Job queue functions can be called from LUs
The previous description was unclear. Reported by Guido Trotter.
Reviewed-by: ultrotter
Alexander Schreiber [Fri, 12 Sep 2008 08:23:09 +0000 (08:23 +0000)]
Make burnin aware of hvm device type flags.
Merged from branches/ganeti/ganeti-1.2 r1648
Use static values for new hvm instance flags
Reviewed-by: iustinp
Guido Trotter [Thu, 11 Sep 2008 17:45:55 +0000 (17:45 +0000)]
GetAllInstancesInfo, change internal iterator name
GetAllInstancesInfo used "node" as an iterator name. Change it to
instance to make it less confusing.
Reviewed-by: iustinp
Guido Trotter [Thu, 11 Sep 2008 17:45:39 +0000 (17:45 +0000)]
gnt-instance: fix tags commands online help
It used to refer to "nodes", which was confusing.
Reviewed-by: iustinp
Guido Trotter [Thu, 11 Sep 2008 17:45:26 +0000 (17:45 +0000)]
Parallelize Tag operations
For now we lock the instance/node for adding/deleting tags from it, but
we could probably in the future do without, with more support from the
config for atomic operations.
Reviewed-by: iustinp
Guido Trotter [Thu, 11 Sep 2008 17:44:52 +0000 (17:44 +0000)]
Parallelize LUSetClusterParams (and add a FIXME)
Reviewed-by: imsnah
Guido Trotter [Thu, 11 Sep 2008 09:46:10 +0000 (09:46 +0000)]
Fix a typo in gnt-instance.sgml
Reviewed-by: imsnah
Guido Trotter [Thu, 11 Sep 2008 09:44:58 +0000 (09:44 +0000)]
Parallelize LURemoveExport
Reviewed-by: imsnah
Guido Trotter [Thu, 11 Sep 2008 09:44:46 +0000 (09:44 +0000)]
Parallelize LURemoveInstance
Using the new add/remove infrastructure this becomes pretty easy! :)
Reviewed-by: imsnah
Guido Trotter [Thu, 11 Sep 2008 09:44:33 +0000 (09:44 +0000)]
Parallelize LUCreateInstance
Finally, instance create on different node, without iallocator, can run
in parallel. Iallocator usage still needs all nodes to be locked,
unfortunately. As a bonus most checks which could have been moved to
ExpandNames, before any locking is done.
Reviewed-by: imsnah
Guido Trotter [Thu, 11 Sep 2008 09:44:21 +0000 (09:44 +0000)]
Implement adding/removal of locks by declaration
With this patch LUs can declare locks to be added when they start and/or
removed after they finish. For now locks can only be added in the
acquired state, and removed if owned, and added locks default to be
removed again, unless some action is taken.
Reviewed-by: imsnah
Guido Trotter [Thu, 11 Sep 2008 09:44:08 +0000 (09:44 +0000)]
LockSet: forbid add() on a partially owned set
This patch bans add() on a half-acquired set. This behavior was
previously possible, but created a deadlock if someone tried to acquire
the set-lock in the meantime, and thus is now forbidden. The
testAddRemove unit test is fixed for this new behavior, and includes a
few more lines of testing and a new testConcurrentSetLockAdd function
tests its behavior in the concurrent case.
Reviewed-by: imsnah
Guido Trotter [Thu, 11 Sep 2008 09:43:54 +0000 (09:43 +0000)]
Fix typo in a locking.py comment
Reviewed-by: imsnah
Guido Trotter [Thu, 11 Sep 2008 09:43:41 +0000 (09:43 +0000)]
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 an
LU. If we're still owning anything we just release it.
Reviewed-by: imsnah
Guido Trotter [Thu, 11 Sep 2008 09:43:25 +0000 (09:43 +0000)]
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 users
in the library itself and in the testing code.
Reviewed-by: imsnah
Guido Trotter [Thu, 11 Sep 2008 09:43:04 +0000 (09:43 +0000)]
Fix LockSet._names() to work with the set-lock
If the set-lock is acquired, currently, the _names function will fail on
a double acquire of a non-recursive lock. This patch fixes the behavior,
and some lines of code added to the testAcquireSetLock test check that
this and other functioins behave properly.
Reviewed-by: imsnah
Iustin Pop [Thu, 11 Sep 2008 08:25:33 +0000 (08:25 +0000)]
Add gnt-instance (start|stop) --submit
Finish the --submit changes with these two, which (because they are
multi-opcode commands) require special handling.
Reviewed-by: ultrotter
Michael Hanselmann [Wed, 10 Sep 2008 17:46:47 +0000 (17:46 +0000)]
jqueue: Add common RPC error handling function
We didn't decide yet what exactly it should do with failed nodes.
Reviewed-by: ultrotter
Iustin Pop [Wed, 10 Sep 2008 17:07:17 +0000 (17:07 +0000)]
Remove locking of instances in certain queries
This patch is similar to the node patch (rev 1650). We disable locking
of instance (and nodes) if we only query static information.
Reviewed-by: ultrotter
Iustin Pop [Wed, 10 Sep 2008 17:07:03 +0000 (17:07 +0000)]
Add an atomic ConfigWrite.GetAllInstanceInfo()
In order to be able to query instance without locking them, we need the
same atomic query of multiple instances as for nodes.
Reviewed-by: ultrotter
Iustin Pop [Wed, 10 Sep 2008 17:06:50 +0000 (17:06 +0000)]
Add ConfigWriter._UnlockedGetInstanceList/Info()
This patch splits the GetInstanceInfo and GetInstanceList methods into
two parts, one locked one _Unlocked similar to the way nodes are
queried.
Reviewed-by: ultrotter
Iustin Pop [Wed, 10 Sep 2008 17:06:39 +0000 (17:06 +0000)]
Do not use jobs in gnt-instance _ExpandNames()
In the gnt-instance script, _ExpandNames() uses jobs to query instance
names. This is not optimal, so we change it to use queries.
Reviewed-by: ultrotter
Iustin Pop [Wed, 10 Sep 2008 17:06:27 +0000 (17:06 +0000)]
Implement "--submit" on gnt-instance
This patch adds support for the “--submit” parameter in the gnt-instance
script, for the commands where it makes sense.
Reviewed-by: ultrotter
Iustin Pop [Wed, 10 Sep 2008 15:43:27 +0000 (15:43 +0000)]
Rewrite the 'only submit job' handling in scripts
The "sys.exit(0)" was not nice as you couldn't differentiate it from
other exit codes. We change this to a specially defined exception for
this, so that multi-opcode commands can handle this nicely.
Reviewed-by: imsnah
Iustin Pop [Wed, 10 Sep 2008 11:03:00 +0000 (11:03 +0000)]
Optimize the OpQueryNodes for names only
Currently, OpQueryNodes is locking all nodes (in shared mode), which
will also block the special case of querying only for the node names
(this is needed for gnt-cluster command, for example). There is no
logical requirement to not give the administrator enough power if she/he
knows what to do, so it would be logical that querying the node names
works without a lock.
The patch changes the LUQuerytNodes.ExpandNodes to only request locking
when the selected fields contain dynamic attributes, and a small change
in the Exec() method to use the new, atomic query method from
ConfigWriter.
Reviewed-by: ultrotter
Iustin Pop [Wed, 10 Sep 2008 11:02:45 +0000 (11:02 +0000)]
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).
Reviewed-by: ultrotter
Michael Hanselmann [Tue, 9 Sep 2008 12:57:15 +0000 (12:57 +0000)]
ganeti-noded: Add constant for queue lock timeout
Reviewed-by: iustinp
Michael Hanselmann [Tue, 9 Sep 2008 12:47:16 +0000 (12:47 +0000)]
Never remove job queue lock in node daemon
Otherwise, corruption could occur in some corner cases. E.g. when
LeaveNode is running in a child and is in the process of removing
queue files, the main process gets killed, started again and gets
a request to update the queue. This is rather extreme corner case,
but we should opt for safety.
Reviewed-by: iustinp
Iustin Pop [Tue, 9 Sep 2008 12:25:01 +0000 (12:25 +0000)]
Implement master startup safety check
This is an initial version of the master startup checks. It's a very
rudimentary change, however in normal usage (an old master was started,
the rest of the cluster is functioning normally) it will succeed in
preventing wrong startups.
Reviewed-by: imsnah
Iustin Pop [Tue, 9 Sep 2008 12:24:50 +0000 (12:24 +0000)]
Export backend.GetMasterInfo over the rpc layer
We create a multi-node call so that querying all nodes for agreement
will be fast.
Reviewed-by: imsnah
Iustin Pop [Tue, 9 Sep 2008 12:24:12 +0000 (12:24 +0000)]
Change backend._GetMasterInfo to return more data
The _GetMasterInfo() function needs to export the master name too to be
useful in master safety checks. This patch makes it a public (no _)
function and adds a third element in the return tuple. Its callers are
modified too.
Reviewed-by: imsnah
Guido Trotter [Tue, 9 Sep 2008 10:42:16 +0000 (10:42 +0000)]
Parallelize LUQueryInstanceData
Reviewed-by: iustinp
Guido Trotter [Tue, 9 Sep 2008 10:42:03 +0000 (10:42 +0000)]
Parallelize LUVerify{Cluster,Disks}
These are two easy querying LUs which require shared access to all
nodes/instances.
Reviewed-by: iustinp
Guido Trotter [Tue, 9 Sep 2008 10:41:50 +0000 (10:41 +0000)]
Parallelize LUReplaceDisks
This is the most complex parallelization so far. We have to lock one
instance (and its nodes) plus one more node if doing a remote replace,
or all nodes if doing a remote replace with iallocator.
Reviewed-by: iustinp
Guido Trotter [Tue, 9 Sep 2008 10:41:38 +0000 (10:41 +0000)]
_LockInstancesNodes: support append mode
This will be used to lock the instance's nodes in addition to some more.
Reviewed-by: iustinp
Guido Trotter [Tue, 9 Sep 2008 10:41:25 +0000 (10:41 +0000)]
Processor: remove ChainOpCode
This function was incompatible with the new locking system, and its
usage has been removed from the code. For now LUs share code by calling
common module-private functions in cmdlib.py, in the future they will
use tasklets (when those will be implemented).
Reviewed-by: iustinp
Guido Trotter [Tue, 9 Sep 2008 10:41:10 +0000 (10:41 +0000)]
Parallelize LU{A,Dea}ctivateInstanceDisks
Now that they are not used in other opcodes by chaining,
this can easily be done.
Reviewed-by: iustinp
Guido Trotter [Tue, 9 Sep 2008 10:40:58 +0000 (10:40 +0000)]
LUReplaceDisks: remove use of ChainOpCode
The calls to OpActivateInstanceDisks and OpDeactivateInstanceDisks has
been replaced by _StartInstanceDisks and _SafeShutdownInstanceDisks
respectively. This is the last usage of ChainOpCode.
Reviewed-by: iustinp
Guido Trotter [Tue, 9 Sep 2008 10:40:39 +0000 (10:40 +0000)]
Create new _SafeShutdownInstanceDisks function
This new function checks whether an instance is running, before shutting
down its disks. This is what the Exec() of LUDeactivateInstanceDisks
did, so that is replaced by a call to this function.
Reviewed-by: iustinp
Guido Trotter [Tue, 9 Sep 2008 10:40:27 +0000 (10:40 +0000)]
Fix a typo in LogicalUnit.ExpandNames docstring
s/locking.LEVEL_INSTANCES/locking.LEVEL_INSTANCE/
Reviewed-by: iustinp
Guido Trotter [Tue, 9 Sep 2008 10:40:09 +0000 (10:40 +0000)]
Use constants.LOCKS_REPLACE instead of hardcoding
This constant replaces what we used to write in recalculate_locks, and
represents the lock recalculation mode. It lives in constants.py because
it's used only in cmdlib, and thus doesn't deal with the locking library
by itself.
Reviewed-by: iustinp
Guido Trotter [Tue, 9 Sep 2008 09:39:25 +0000 (09:39 +0000)]
Fix LUReplaceDisks with iallocator
self._RunAllocator() sets self.op.remote_node, but doesn't return the
new remote node. If we set it to the return value of the function we
basically reset it to None, and iallocator is never run.
Reviewed-by: imsnah
Michael Hanselmann [Tue, 9 Sep 2008 09:01:53 +0000 (09:01 +0000)]
Use lock timeout for queue updates in ganeti-noded
This helps to prevent complete deadlocks.
Reviewed-by: iustinp
Guido Trotter [Mon, 8 Sep 2008 15:54:03 +0000 (15:54 +0000)]
Fix LUGrowDisk
The rpc library returns a list, not a tuple, so we'll accept both.
Reviewed-by: iustinp
Guido Trotter [Mon, 8 Sep 2008 15:53:16 +0000 (15:53 +0000)]
Fix iallocator run
The rpc library returns a list, not a tuple, so we'll accept both.
Reviewed-by: iustinp
Guido Trotter [Mon, 8 Sep 2008 15:53:01 +0000 (15:53 +0000)]
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.
Reviewed-by: iustinp
Guido Trotter [Mon, 8 Sep 2008 13:44:24 +0000 (13:44 +0000)]
Parallelize LUExportInstance
Unfortunately for the first version we need to lock all nodes. The patch
discusses why this is and discuss ways to improve this in the future.
Reviewed-by: iustinp
Guido Trotter [Mon, 8 Sep 2008 13:44:10 +0000 (13:44 +0000)]
Parallelize LUGrowDisk
Reviewed-by: iustinp
Guido Trotter [Mon, 8 Sep 2008 13:43:56 +0000 (13:43 +0000)]
LURebootInstance: lock only primary when possible
When rebooting an instance and we're not changing it's disks status (all
the cases except in a "full" reboot) we can lock just its primary node.
Reviewed-by: iustinp
Guido Trotter [Mon, 8 Sep 2008 13:43:43 +0000 (13:43 +0000)]
Add primary_only flag to _LockInstancesNodes
As the name says when the flag is on (the default is off) only the
primary nodes are locked, as opposed to all of them.
Reviewed-by: iustinp
Michael Hanselmann [Fri, 5 Sep 2008 15:38:54 +0000 (15:38 +0000)]
utils.FileLock: Implement timeout
The timeout can be used in ganeti-noded to be more robust against
deadlocks.
Reviewed-by: iustinp
Michael Hanselmann [Fri, 5 Sep 2008 13:49:50 +0000 (13:49 +0000)]
Add lock documentation for job queue and ganeti-noded
Also change title formatting to match client-api.txt.
Reviewed-by: iustinp
Michael Hanselmann [Fri, 5 Sep 2008 12:29:58 +0000 (12:29 +0000)]
noded: Get job queue lock while purging queue content
Only one process should modify the queue at the same time.
Reviewed-by: iustinp
Michael Hanselmann [Fri, 5 Sep 2008 12:19:17 +0000 (12:19 +0000)]
QA: Remove dry run mode
It didn't work as planned because some commands depend on the return
value or output of some operations.
Reviewed-by: iustinp
Guido Trotter [Fri, 5 Sep 2008 11:00:36 +0000 (11:00 +0000)]
Add locking.ALL_SET constant and use it
Rather than specifying None in needed_locks every time, with a nice
comment saying to read what we mean rather than what we write, and that
None actually means All, in our magic world, we'll hide this secret
under the ALL_SET constant in the locking module, which has value, you
guessed it, None. After that we'll substitute all usage in cmdlib.
Some comments and examples have been fixed as well.
Reviewed-by: iustinp
Michael Hanselmann [Fri, 5 Sep 2008 10:57:25 +0000 (10:57 +0000)]
utils.SplitTime: More rounding fixes
SplitTime didn't round the same on different platforms. This patch changes
it to use microseconds and not care about rounding.
Reviewed-by: iustinp
Iustin Pop [Fri, 5 Sep 2008 10:40:15 +0000 (10:40 +0000)]
Remove bom-byte
This is not nice, removing it :)
Please use 'set nobomb' in your vi init file.
Reviewed-by: ultrotter
Guido Trotter [Thu, 4 Sep 2008 15:12:51 +0000 (15:12 +0000)]
Prevent mistakes using _GetWantedNodes
All the users of _GetWantedNodes have been converted to be concurrent
LUs, and thus cannot call this function with an empty list of nodes
anymore. This patch makes this restriction a part of the function
itself. This prevents mistakes in new concurrent LUs, and creates more
work for new non-concurrent LUs, which we shouldn't add anyway.
Reviewed-by: iustinp
Guido Trotter [Thu, 4 Sep 2008 15:12:38 +0000 (15:12 +0000)]
Paralleliza LUQueryNodeVolumes and LUQueryExports
Reviewed-by: iustinp
Guido Trotter [Thu, 4 Sep 2008 15:12:25 +0000 (15:12 +0000)]
Parallelize LUDiagnoseOS
Reviewed-by: iustinp
Guido Trotter [Thu, 4 Sep 2008 15:12:10 +0000 (15:12 +0000)]
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 which
would have thrown an exception.
Reviewed-by: iustinp
Guido Trotter [Thu, 4 Sep 2008 15:11:58 +0000 (15:11 +0000)]
s/Chain(OpQueryExports)/rpc.call_export_list(...)/
Parallel opcodes are not (yet?) supported for chaining. Turns out
though that chaining is used only four times in the code, and twice it's
for querying exports. But what's the need to chain the full opcode, when
the simple call_export_list rpc is going to provide the same result?
Reviewed-by: iustinp
Guido Trotter [Thu, 4 Sep 2008 15:11:43 +0000 (15:11 +0000)]
Fix wrong indentation in LUQueryNodes
Reviewed-by: iustinp
Alexander Schreiber [Thu, 4 Sep 2008 14:53:34 +0000 (14:53 +0000)]
Merge r1607 from branches/ganeti/ganeti-1.2
Use a default vnc_bind_address if None is specified
Reviewed-by: iustinp
Alexander Schreiber [Tue, 2 Sep 2008 16:23:18 +0000 (16:23 +0000)]
merge r1569 from branches/ganeti/ganeti-1.2
Implement more options for gnt-backup import
Reviewed-by: ultrotter
Alexander Schreiber [Tue, 2 Sep 2008 12:57:32 +0000 (12:57 +0000)]
merge r1568 from branches/ganeti/ganeti-1.2
Add more fields to gnt-instance list
Reviewed-by: imsnah