Enable auto-unit formatting in script output
This patch enables by default the old 'human-readable' option, but in aslightly different model.
The option is now called "units" and takes either: - 'h' for automatic formatting - 'm', 'g' or 't' for mebi/gibi/tebibytes...
Improvements to CLI output
This patch adds nicer formatting for some gnt-instance list operations.
Reviewed-by: ultrotter
RAPI: Cancel a job
Reviewed-by: imsnah
Make cli.py use FieldSet for matching fields
This changes cli.py to FieldSet usage so that gnt-instance list willformat nicely the disk.size/*, and the count of disks/nics.
Move FieldSet class to utils.py
Since we can use the FieldSet class in cli.py to nicely format disksizes and such, we move it to utils.py and also move its associatedunittest. I didn't remove the cmdlib.py unittest file as that's not thegood direction :)...
Small burnin info message change
This looks beter than '0 disk'.
burnin: fix default growth parameter
Change disk index validation to FindDisk
This patch replaces the hand validation of the disk index with theinstance.FindDisk method (actually reverting to previous method, beforethe multi-disk, but now with indexes).
Change GrowDisk to work with multi-disk
This patch changes the instance.FindDisk method to take index arguments(instead of iv_names), and changes GrowDisk and list instancesaccordingly.
Use SSL for master/node RPC
This patch enables SSL between masterd and noded.
Reviewed-by: iustinp
Get rid of node daemon password
With the new SSL client certificate stuff it's no longer needed.
ganeti.http: Add another class to contain SSL key and certificate
Otherwise we would read them for every request the HTTP clientmakes against a server and this is not needed.
ganeti-masterd: Remove PID file at the end
Removing the PID file should be the last thing done. This patch makessure it's also removed when master.server_cleanup() throws an exception.
Also initialize logging only after writing the PID file.
Reuse HTTP client pool for RPC
ganeti-masterd: Add initialization and shutdown of RPC pool. It needsto be shutdown before forking.
ganeti.cli: Add decorator function to initialize and shutdown RPC pool.
ganeti.rpc: Add functions to initialize and shutdown RPC pool. Throw...
Write ssconf files when updating configuration
Add RPC call to update ssconf files
Change replace secondary to work with multi-disk
Also fix an error in the CheckPrereq.
ganeti.ssconf: Add function to write ssconf files
This function will be used to write ssconf files from the node daemon.By creating a lock file, we synchronize different child processes ofganeti-noded to not overwrite each other's changes. Also, external...
Convert replace-disks (same nodes) to multi-disk
This patch changes the drbd8 replace disk only (no secondary change) towork in with multi-disk. This mode of replaces works correctly withreplacing only a subset of disks.
Initial multi-disk/multi-nic support
This patch adds support for mult-disk/multi-nic in: - instance add - burnin
The start/stop/failover/cluster verify work as expected. Replace diskand grow disk are TODO.
There's also a change gnt-job to allow dictionaries to be listed in...
Add more disk/nic listing options in gnt-instance
This adds some more listing cases (useful for scripting/rapi): - disk.sizes for a list of all sizes - nic.(ips|macs|bridges)
Change Xen hypervisor to not use iv_name
Currently the iv_name is very linux-specific, and will break with themulti-disk changes.
The patch changes this to generate sdX names based on the disk index inthe disks structure, instead of relying on the iv_name....
ganeti.rpc: Use central functions for actual RPC calls
Before we had lots, lots and lots of code duplication. This patchchanges the code to use four central functions.
Make HttpClientManager threadsafe
This allows a single HttpClientManager to be used from more than onethread at the same time. We discussed having one HttpClientManagerper job queue thread. Assuming there should be one HTTP thread pernode, this would mean quadratic growth with the number of nodes. By...
HTTP server: Do not decode empty entity body
RAPI: Instance modify.
Split parameters filter to the separate function and reuse it in instance creation.
Skip another testWaitingXblocksY
The waiting sharer blocks exclusive is another not-possible to testright now.
Sorry for missing it the first time; there are no other testWaiting...tests.
Allow querying of variable number of parameters
This patch adds support for querying in gnt-instance list of: - disk.count - nic.count - disk.size/$N - nic.(ip|mac|bridge)/$N
The patch also disables the exception raised when the header description...
Convert cmdlib.py to _FieldSet
This patch converts the current usage of _CheckOutputFields to theFieldSet class, but it doesn't start to use its variable matchingfeatures.
Add a FieldSet class for variable parameter sets
This patch adds a _FieldSet class that can be used for the new variableparameter sets: e.g. the sda_size will change to disk/0.size (orsimilar) and we need to both check validity and extract the index of the...
Skip the waitingExclusiveBlockSharer test
Until we have a way to properly test this, we'll skip the test.
More updates to the documentation
This patch removes the client-api.txt document (since it's obsoleted bythe documentation inside the design-2.0.rst document) and adds manyupdates to the latter.
Fix distcheck with the new dot/png rules
Adding a new filetype/make rule requires more work than the previouspatch. Sorry! Now pases distcheck.
Add a cluster architecture diagram
This adds a simple diagram for the cluster architecture and also adds adependency on graphviz (both doc and in configure).
Combine the 2.0 design documents into one
This patch combines all the design documents for 2.0 except thesecurity one into a single document, in order to ease reading and reduceduplication of information.
Future patches will start removing wrong pointers to old document names...
RAPI: Instance startup/shutdown resources
RAPI: Implement an instance reboot
Use utils.ReadFile to read SSL certificate
ganeti.rpc: Use utils.ReadFile instead of reading file directly
utils.SetupLogging: Remove previously setup handlers
If a logging function is called before the logging module is setupusing utils.SetupLogging, it calls logging.basicConfig, which addsa StreamHandler, on its own. If we leave it in, all log output will...
jqueue: Always use rpc.RpcRunner
"from ganeti.rpc import RpcRunner" does not conform to the style guide.
bootstrap: Always use rpc.RpcRunner
ganeti.rpc: Convert to ganeti.serializer
This is one of the last places where the simplejson module isused directly.
Convert RPC module to new HTTP client
Currently, HttpClientManager is instantiated for every RPC call. Thiswill be changed with another patch, as will the use of SSL. The “Run”method is no longer needed.
Convert the locking unittests to repetition-test
Currently the locking tests are using timeouts to ensure an event will'never happen'. However, this is suboptimal.
The patch converts all of these to instead: not wait, but sequence theoperations logically and expect that they execute as such. In case of...
Fix utils.KillProcess
Rev 1978 introduced a breakage on the SIGKILL finall signal to theprocess, due to mistyped variable.
Reviewed-by: francis.perron
ganeti.http: Implement SSL for HTTP client
Implementing SSL for the HTTP client required more work than I expected.For correct error handling, quite a lot of code is needed. To avoidcode duplication, I moved a lot of the socket handling code into asingle function named _SocketOperation. It takes care of the polling...
ganeti.daemon: Add timers to Mainloop
This is a fallout from my work on the HTTP client class. Repeatingtimers are prepared, but not yet implemented.
Convert trunk to posix-compatibility
We change two functions to use RunCmd without shell, and the other(which needs a ssh command line) is changed to the '>... 2>&1' syntax.
Abstract runtime creation of dirs into a function
Currently the dir creation in ganeti-noded is in the main function. Thisis not nice: we move it into a separate function and also add creationof the OS_LOG_DIR (with different permissions, but in the same way)....
Remove zombie special case from IsProcessAlive
Based on the discussion on the mailing list, we remove the specialcasing of zombie processes.
Note we don't use kill -0 since that has a different meaning than "checkprocess is alive", so this function is still linux-specific....
Add cleanup of processes to utils.KillProcess
In case the process we want to signal is our own process, and the signalwe send is a deadly one, we should also cleanup after the process.
This patch adds a new parameter waitpid to this function that does this,...
Fix instance rename
As can be seen from the patch, we remove from the locking managerinst.name. However, we do this right after cfg.RenameInstance, whichchanges inst.name to the new name. So we need to remove old_name notthe new name.
The real question is why does the glm allow me to remove a not-existing...
Make the makefile not recreate ganeti every time
Currently the makefile always recreates the ganeti symlink. Make it sothat it does only when it doesn't exist or it's not a symlink.
Fix gnt-instance reinstall
Commit 1881 changed a rpc call but didn't fix all its users. This shouldfix it (but I can't test as HTTP is broken).
Implement working directory for utils.RunCmd
In order to replace usage of the shell just for 'cd %s; ...' we need tobe able to specify the working directory for childs.
The patch also changes the default working directory (when notspecified) to "/", as opposed to the current dir; since the daemos run...
ganeti.http: Move SSL socket creation into base class
The same code will be used by the HTTP client.
ganeti.daemon: Make Mainloop more flexible
While working on the HTTP client class, I wanted to use Mainloopbefore deciding to use threads instead.
- Add docstrings- Rename "quit" to "running", move it to a local variable- Support adding and removing I/O listeners while running...
ganeti.http: Add constant for "Unexpected EOF"
This is an expected error message and will be used in two places.
Fix gnt-cluster init without cluster parameters
Add new HTTP client class
It is based on the WorkerPool class which is already used for the jobqueue and master daemon. Each request must be encapsulated in aninstance of HttpClientRequest, which will then be passed toHttpClientManager for processing. Upon completion, the request object...
ganeti.http: Use 411 Length Required in server code
Update LUGrowDisk _WaitForSync call
The _WaitForSync call changed in r1794 but the GrowDisk call wasn't updatedthen. This makes GrowDisk work in trunk.
ganeti.http: Add more constants
As a preparation for the new HTTP client class, add more constantsto ganeti.http.
Small documentation updates for workerpool.py
Documentation updates for jqueue.py
Yet another bug found while reviewing docs
The newer_than variable can be either None or an int, and we normalizeit to an integer previously and save it in the 'serial' variable, whichshould be used instead.
Documentation updates for utils.py
Documentation updates for gnt-debug and gnt-os
Documentation updates for gnt-job
Documentation updates for gnt-backup
Change exit code of gnt-backup list
Currently gnt-backup list exits with the same error code even if can'tcontact som nodes for backup information.
The patch changes it to return 1 instead in this case.
Documentation updates for gnt-node
The patch also adds a 'return 0' to a function that was missing it.
Documentation updates for gnt-cluster
Documentation updates for gnt-instance
Update backend.py docstrings
This patch converts all of backend.py to epydoc formatting.
Fix another error handling case
The return from this error path is a dict, but the actual return value(on the non-error handling) is a list of dicts. Change accordingly.
Fix an error handling case
Found while reviewing documentation.
OSFromDisk remove superfluous empty line
design-2.0-os-interface: update import/export
In the end we ended up taking a slightly different approach forimport/export than the one discussed in the design doc, aftertrying/talking about a few more alternatives. Document this in thedocument.
Some documentation updates
This fixes a few doc issues and converts a few docstrings to epydoc.
Modify utils.RunCmd to write output to file
Currently we launch processes via the shell in a few places only toredirect standard output and error to a log file ("&> $file"). It isbetter to do such redirection from within RunCmd itself.
This patch splits RunCmd in two parts, the setup and the execution part,...
ganeti.http: Implement SSL certificates
Reviewed-by: killerfoxi
Document HttpServer.__init__
At the same time, simplify the interface a bit by not using a tuple.
Reviewed-by: killerfoxi, ultrotter
Update gnt-cluster man page, sections modify and queue.
Document the new options for gnt-cluster modify and the new queuecommand.
Update gnt-cluster man page with current options.
This patch updates the gnt-cluster man page to reflect the currentchanges to gnt-cluster.
Fix use of ToStderr in gnt-cluster
Fix gnt-* command with --submit
Currently we don't catch the JobSubmittedException (although the code toformat it nicely is there). The patch adds the exception name to thecatch list and makes --submit work.
Export the disk index in the import/export scripts
We want to export the disk index as some OSes will only want to exportthe first disk (or the second one, etc.), even if we have multipledisks.
The patch also updates the backend.ExportSnapshot docstring....
Fix leftover of hypervisor attribute rename
convert remaining print statements to ToStderr in gnt-cluster
http library: Always fork before reading request
It turned out that clients not sending a full request will stopus from responding to further requests. This patch leverages thesituation a bit by always forking before handling the request,but we still have DoS situations....
daemon.py: Don't wake up every second
We don't have timers yet, hence waking up is not needed at all.
RAPI: Export beparams as dict. The patch also enables LUQueryInstances to accept beparams as valid field.
RAPI: Forgoten in r1923 instance add change.
LUCreateInstance: import multiple disks
Previously we used to handle only one disk. Now we'll import all theones present in the export, in order, on the instance's disks. Any diskwhich was present on the original instance but wasn't exported is justskipped in the target instance....
Convert ImportOSIntoInstance to OS API 10
- Change ImportOSIntoInstance not to get any "os_disk" and "swap_disk" arguments but to accept multiple target images to import, and to return a list of booleans with the result of each import- Change the relevant rpc call and the only caller to conform...
Convert ExportSnapshot to OS API 10
We pass the data via the environment rather than on the command line, asAPI 10 says. All the rest remains the same, and we export just one disk,as the master calls this function for every snapshotted disk.
LUExportInstance: snapshot all disks
Rather than just snapshotting the "sda" disk, we'll snapshot all of theinstance disks. If we can't snapshot a disk for any reason we'll log anerror and proceed anyway: in this case the resulting export will miss adisk. This also changes all the warning messages to self.LogWarning()....
Convert SnapshotBlockDevice's docstring to epydoc