Use lock timeout for queue updates in ganeti-noded
This helps to prevent complete deadlocks.
Reviewed-by: iustinp
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.
Reviewed-by: ultrotter
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
Reviewed-by: imsnah
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
merge r1540 from branches/ganeti/ganeti-1.2
Allow access to HVM serial console
merge r1539 from branches/ganeti/ganeti-1.2
Display VNC console port in gnt-instance info.
merge r1538 from branches/ganeti/ganeti-1.2
Check HVM device type on instance modify as well.
Check memory size before setting it
With this change when a user asks for a new memory size for an instance,the number is checked instead of just applied. The operation fails onlyif the instance would not be able to restart on its primary node, butgenerates warnings should it be impossible to failover the instance or...
Pass the force param to SetInstanceParms
It was already allowed in gnt-instance modify, but ignored.It will be used to force skipping parameter checks.
This is a forward-port from branches/ganeti-1.2
Original-Reviewed-by: imsnahReviewed-by: iustinp
Merge r1534 from branches/ganeti/ganeti-1.2
Add HVM device type flag 4/4
Merge r1537 from branches/ganeti/ganeti-1.2
Add HVM device type flags 3/4
Merge r1536 from branches/ganeti/ganeti-1.2
Add HVM device type flags 2/3
utils.SplitTime: Fix rounding of milliseconds
Reported by Iustin.
It used to return this:
utils.SplitTime(1234.999999999999)
(1234, 1000)
while it should've returned this:
(1235, 0)
merge r1535 from branches/ganeti/ganeti-1.2
Add HVM device type flags 1/4
Merge r1296 from branches/ganeti/ganeti-1.2
doc fix: Describe default values for HVM instance options & cleanup.
Merge r1295 from branches/ganeti/ganeti-1.2
Clarify cluster IP requirement.
Make WaitForJobChanges deal with long jobs
This patch alters the WaitForJobChanges luxi-RPC call to have aconfigurable timeout, so that the call behaves nicely with long jobsthat have no update.
We do this by adding a timeout parameter in the RPC call, and returning...
merge r997 from branches/ganeti/ganeti-1.2
Fix gnt-instance modify for HVM parameters
This patch makes gnt-instance modify work again for the advancedHVM parameters after it was broken by other changes.
Add doc/locking.txt, documenting locking order
Fix error message when masterd is not listening
Fix issue when acquiring empty lock sets
By design if an empty list of locks is acquired from a set, no locks areacquired, and thus release() cannot be called on the set. On the otherhand if None is passed instead of the list, the whole set is acquired,...
jqueue: Replace normal cache dict with weakref dict
A job should only exist once in memory. After the cache is cleaned,there can still be references to a job somewhere else. If thereare multiple instances, one can get updated while a function iswaiting for changes on another instance. By using...
jqueue: Keep timestamp of opcode start and end
jqueue: Reset run_op_idx after job is done
It can be confusing otherwise.
Another burnin fix
This is a result of the log timestamp changes.
Fix a small typo in a constant
Seems noone ran a burnin lately :)
Reviwed-by: amischenko,ultrotter
Make sure that client programs get all messages
This is a large patch, but I can't figure out how to split it withoutbreaking stuff. The old way of getting messages by always getting thelast one didn't bring all messages to the client if they were added...
QA: Use pseudo-tty via SSH
This gives continous output instead it being buffered.
Add simple lock debug output
Currently it can only be enabled by modifying utils.py, but we canadd a command line parameter later if needed.
Reviewed-by: schreiberal
Use python2.4 when developing
Remove references to YAML
I forgot to remove these when converting the QA configuration from YAMLto JSON.
Add vim modeline to qa-sample.json
Vim doesn't recognize the format automatically.
Parallelize LUQueryNodes
As for LUQueryInstances the first version just acquires a shared lock on allnodes. In the future further optimizations are possible, as outlined bycomments in the code.
Parallelize LUQueryInstances
This first version acquires a shared lock on all requested instances andtheir nodes. In the future it can be improved by acquiring less locks ifno dynamic fields have been asked, and/or by locking just primary nodes.
A few more locking unit tests
A few more tests written while bug-hunting. One of them shows a realissue, at last. :)
Add lock-all-through-GLM unit test
I was hunting for a bug in my code and thought the culprit was in thelocking library, so I added a test to check. Unfortunately turns out itwasn't. :( Committing the test anyway, while still trying to figure outwhat's wrong......
LockSet: allow lists with duplicate values
If a list with a duplicate value is passed to a lockset what the codenow does is to try to acquire the lock twice, generating adouble-acquire exception in the SharedLock code. This is definitely anissue. In order to solve it we can either forbit double values in a list...
Processor: lock all levels even if one is missing
If a locking level wasn't specified locking used to stop. This meansthat if one, for example, didn't specify anything at the LEVEL_INSTANCElevel, no locks at the LEVEL_NODE level were acquired either. With this...
LURebootInstance: move arg check in ExpandNames
The check for the reboot type can be done without any locks held, sowe'll move it to ExpandNames. Plus, we note in a FIXME that if thereboot type is not full, we can probably just lock the primary node, and...
QA: Convert configuration from YAML to JSON
We no longer use YAML in Ganeti at all. This patch converts the QAconfiguration from YAML to JSON. JSON doesn't support comments andI had to use a hack with fields starting with '#'.
LUVerifyCluster: Return boolean indication success
Use Linux-specific way to name master socket
By using this Linux-specific way we don't have to care about removing thesocket file when quitting or starting (after an unclean shutdown). For amore detailed description, see the comment in the patch.
QA: Try to run more scripts with --version
This patch also sorts the list.
QA: Always accept added node's SSH key
QA: Do not upload known_hosts file anymore
The cluster no longer keeps individual host's SSH key, but ratheraliases all of them to the cluster name.
Copy qa_utils.AssertIn from 1.2 branch
Apparently it was forgotten when import the remote API QA tests.
gnt-node: Add option to always accept peer's SSH key
This option will be used to add nodes to the cluster withoutasking the user to confirm the key. Together with key basedauthentication this can be used in the QA tests.
SshRunner: Add parameter to always accept peer's SSH key
This will be used to add nodes without user interaction, specificallyin QA tests.
Move SSH option building into a function
I'm going to add another option and it would make maintainingthem in constants even more complicated.
SshRunner.Run: Pass all arguments to BuildCmd
This patch changes SshRunner.Run to pass all arguments toSshRunner.BuildCmd. They had the same arguments beforeand should stay that way. This change makes it easierto add new or change existing arguments....
Whitespace fixes for remote API QA checks
Remove QA hook functionality
To my knowledge they're used nowhere and it's at least slightlyconfusing to people adding new QA checks.
Pass hypervisor type to the OS scripts
It's handy to make the os scripts know which hypervisor the instance isgoing to run under. In order not to change the os API we pass thisinformation in the environment, where the os scripts can access it ifthey're hypervisor-aware....
RunCmd: add optional environment overriding
If the user passes an env dict to RunCmd we'll override the environmentpassed to the to-be-executed command with the values in the dict. Thisallows us to pass arbitrary environment values to commands we run....
KVM Hypervisor Cleanup
- Remove a few experiemental code lines left as comments- Rework first disks' boot=on addition, which was calculated twice- Remove an empty line- Remove reference to hvm_pae which doesn't apply to kvm
Allow kvm hypervisor in gnt-cluster init
Add KVM hypervisor code
ht_kvm.py contains the code for ganeti to work under kvm.This patch also modifies Makefile.am to ship that file, andlib/hypervisor/__init__.py to import it, and add kvm to thehypervisors map.
constants: add HT_KVM
Add a new hypervisor type, HT_KVM, to constants, and register it in theHYPER_TYPES set.
Add --with-kvm-path configure option
This allows to configure a different path to the kvm binary. By default/usr/bin/kvm is used, which is the one found in debian and ubuntu.
FakeHypervisor: fix a function signature
StartInstance takes 'block_devices', not 'force' as its third argument.Even if this is not used in the fake hypervisor it's better to have thecorrect argument name to avoid confusion.
Convert RunCmd to an epydoc docstring
Fix adding pristine nodes
If a node hasn't been part of the cluster before being added it'll nothave the cluster's SSH key. This patch makes sure to accept those bynot aliasing the machine name to the cluster name.
Fix race locking issue in noded
Noded didn't release the job queue lock after initialising it. Thispatch makes sure to unlock once the work is done.
cli: Use new RPC call instead of polling
This means commands will not take at least one second anymore.
Add RPC call to wait for job changes
This way clients can react faster to status or message changes anddon't have to poll anymore.
jqueue: Change log message time format
See the comment in the patch.
Add functions to split time into tuple and merge it back
These will be used for job logs.
Use new query function for exports in gnt-backup
Add query function for exports
Don't always remove queue lock when queue is purged
The lock should only be removed if ganeti-noded is going to quit.Otherwise it needs to be kept to prevent another process from creatingit again while we're still holding the (removed) lock. This is due to...
backend: Add optional exclusion list to _CleanDirectory
The code cleaning the queue will make use of it.
jqueue: Move archived jobs on all nodes
Otherwise one might have archived jobs back in the list after a masterfailover.
noded: Add RPC function to rename job queue files
This will be used to archive jobs.
backend: Add function to check whether file is in queue dir
Another function will need to check whether its parametersare job queue files.
noded: Add decorator for job queue lock
The lock will also be needed by another function.
Two small style fixes