Fix wrong indentation in LUQueryNodes
Reviewed-by: iustinp
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
Reviewed-by: ultrotter
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
Implement queue locking in node daemon
jstore: Change to not always require a lock
This way we can do locking when both noded and masterd are runningon the same machine, the latter holding an exclusive lock on thequeue.
More logging for errors during noded RPC calls
Log only unexpected errors in utils.FileLock
Otherwise users might be confused by errors in log files.
Disallow uploading job queue files through upload_file
The job queue is now updated through its own RPC functions.
jqueue: Use new job queue RPC functions
Add job queue RPC functions
jobqueue_update: Uploads a job queue file's content to a node. Themost common operation is to upload something that we already havein a string. Unlike in the upload_file function, the file is notread again when distributing changes, but content has to be passed...
Move function cleaning directory to module level
JobQueuePurge() will be used by an RPC function.
Use API instead of command line utilities in watcher
Fix cli.PollJob
feedback_fn wasn't passed to it.
Notify job queue about added/removed nodes
The job queue maintains its own node list and must be notifiedwhen nodes are added/removed.
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...
jqueue: Implement {Add,Remove}Node
These functions will be used to notify the queue about newly addedor removed nodes.
jqueue: Don't pass the list of nodes to SubmitJob anymore
The job queue now maintains its own list and is updated whennodes are added or removed from the cluster.
Maintain node list in job queue
The code makes sure not to include the master in the list.
masterd: Move job queue into context object
The job queue must be called from cmdlib when adding or removingnodes to the cluster. Moving it to the context objects makesthis possible.
Clean job queue directories when leaving cluster
Old job files shouldn't be left on nodes removed from a cluster.
Use new RPC call in “gnt-node list”
Implement query for nodes
Use new query RPC call in “gnt-instance list”