Small typo in ganeti-watcher
Reviewed-by: imsnah
Skip offline nodes in gnt-cluster commands
This patch makes gnt-cluster copyfile and command skip the offlinenodes.
Reviwed-by: ultrotter, imsnah
burnin: Add tests for add/remove disks and NICs
This patch adds testing of add/remove disks and NICs to the burnin.
Heavy redo of gnt-instance info output
In 2.0, we have more parameters in drbd's logical_id, and passing theresults over json makes them unicode which looks worse with the defaultformatting. As such, a redo of the output is needed.
This patch: - adds a separate function to format the logical_id of devices...
Fix some errors in instance modify --disk remove
The RpcResult introduction still left some bugs (after multiple patches): - we don't correctly check the result type - rename a variable to prevent a conflict
Fix an error handling case in instance info
The checking for invalid instance names in LUQueryInstanceData is brokensince commit 1642.
Introduce a very simple LU to force config updates
This LU can be used to force a push of the config in case it's needed,for example after an upgrade to update the ssconf_release_version file.
Add a new ssconf file with the ganeti version
The patch adds a new ssconf file containing the ganeti version.
Work around a DRBD sync speed race condition
This is modified forward-port of commit 1544 on the 1.2 branch:
When DRBD is doing its dance to establish a connection with its peer, it also sends the synchronization speed over the wire. In some cases setting the sync speed only after setting up both...
burnin: Add activate/deactivate disks
burnin: use the new replace_disks constants
This patch updates burnin to the latest replace disks constant, andchanges the constants' values to be more accurate.
burnin: do not use offline nodes
This patch makes burnin skip the offline nodes in it's builtin nodeselection. It also removes an extra line.
Fix gnt-os for offline nodes
We shouldn't query offline nodes in gnt-os. This patch adds an utilityfunction to ConfigWriter that returns the names of online nodes and usesit in LUDiagnoseOS to query only the good nodes.
Silence warning on node list for offline nodes
The warning in node list is meant for nodes that return wronginformation, but for offline nodes this case is normal.
Rework the daemonization sequence
The current fork+close fds sequence has deficiencies which are hard towork around: - logging can start logging before we fork (e.g. if we need to emit messages related to master checking), and thus use FDs which we...
Cleanup replace-disks modes and options
In 1.2, due to the md+drbd7 legacy, we had a complex choice of replacemodes, and the new drbd8 modes where forced into this syntax, with somecomplicated rules of transition from one mode to another (if REPLACE_ALL...
Fix cluster verify/node net test for offline nodes
For offline nodes, we shouldn't add them to the NV_NODELIST andNV_NODENETTEST tests since they most likely won't succeed.
The patch makes gnt-cluster verify happy again in such cases.
rpc: Add a method for easy check of remote results
The patch adds a new method to the rpc.RpcResult class called"RemoteFailMsg" which is useful for the RPC calls which return a(status, payload) style result.
Add an instance_migratable rpc call
This is a forward-port of commit 1194 on the 1.2 branch:
This call will check whether an instance is up on its primary, and that it has been started with symlinks. We currently have no on-secondary checks, nor any hypervisor specific call....
bdev: forward-port ReAttachNet/DisconnectNet
This is plain copy of the 1.2 ReAttachNet and DisconnectNet methods onthe DRBD8 device, with the logger to logging module changes and theReAttachNet method renamed to AttachNet.
These methods are not used anywhere right now, but will be used for...
backend: Remove symlinks by disk name
This is a modified forward-port of commit 1184 on the 1.2 branch:
backend: Remove symlinks by disk name, not using a wildcard
Reviewed-by: ultrotter
The changes to the original patch are related to the docstring style and...
Pass instance name to rpc call blockdev_close
This is an extract of commit 1166 on the 1.2 branch (Add a rpc call fordrbd network reconfiguration), but only the blockdev_close part.
The patch changes the blockdev_close call to take the instance so that...
Fix the _RemoveBlockDevLinks() function
This is a forward-port of commit 1163 on the 1.2 branch: This fixes the removal of the instance symlinks (probably breakage from the glob changes).
Remove instance's symlinks
This is a forward-port of commits 1150 and 1151 on the 1.2 branch: Add _RemoveBlockDevLinks auxiliary function, called when an instance fails to start and when it is shut down.
Reviewed-by: iustinp
and: Fix cut&paste error when removing symlinks...
Catch BlockDeviceError when starting instance
This is a forward-port of commit 1149 on the 1.2 branch: _GatherAndLinkBlockDevs used to raise the errors.BlockDeviceError exception when it failed to create a block device, and with this patch set it does so also when it fails to create a symlink to it....
Create symlinks to intances' block devices
This is a forward-port of commit 1148 on the 1.2 branch: Change the _GatherBlockDevs private function, called only one time by StartInstance, to _GatherAndLinkBlockDevs, and make it transform the device returned even more by calling the new _SimlinkBlockDev auxiliary...
Simplify hypervisor block_devices structure
This is a partial forward-port of commit 1136 on the 1.2 branch:
The hypervisor doesn't need to be passed the whole block device structure, so we'll just give it the block device name on the local node, and the name as seen by the instance. This will make it easier to...
_AssembleInstanceDisks: fix rpcresult handling
Commit 2117 changed _AssembleInstanceDisks to correctly parse thefailure status of the new RpcResult structure, but it didn't fix thestoring of only the result payload. Since RpcResult is not JSONserializable, LUActivateInstanceDisks is failing....
Fix some pylint-detected issues
Two bad indentation cases and a missing variable.
ganeti.bootstrap: Set permissions on newly uploaded files
Reviewed-by: amishchenko
ganeti.cmdlib: Check remote API certificate on "gnt-cluster verify"
ganeti.bootstrap: Upload remote API certificate to new nodes
ganeti.bootstrap: Prepare for remote API certificate
ganeti.bootstrap: Write SSL key to temporary file and set permissions
Previously, we set the permissions only after writing the key. Thisgave other users on the system a small window during which they couldread the key.
ganeti.bootstrap: Generate SSL certificate for remote API
ganeti.bootstrap: Move SSL certificate generation into separate function
ganeti-rapi: Implement HTTP authentication
Passwords are stored in "$localstatedir/lib/ganeti/rapi_users". Useroptions specify the access permissions of a user (see docstring forganeti.http.ReadPasswordFile), for which only "write" is supportedto grant write access. Every other user has read-only access....
ganeti-rapi: Introduce per-request context
This will be used to evaluate access permissions to resources.
ganeti.http: Function to read password file
Lines in the password file are of the following format:
<username> <password> [options]
Fields are separated by whitespace. Username and password aremandatory, options are optional and separated by comma (",")....
ganeti.http: Add support for private data in HTTP requests
ganeti.http: Add support for basic HTTP authentication
As per RFC2617.
ganeti.http: Prepare authentication for HTTP server
The authentication class will override PreHandleRequest.
Job queue: Allow more than one file rename per RPC call
ganeti.jqueue: Group job archivals to reduce number of RPC calls
Reducing the actual number of RPC calls will come in another patch.
Prevent RPC timeout on auto-archiving jobs
With a large job queue, auto-archiving jobs can take a very long time,causing timeouts on the luxi RPC layer. With this change, auto-archive returns after half of the RPC timeout has passed. The userwill see how many jobs are left unchecked....
jqueue: When auto-archiving jobs, calculate job status only once
This is done by passing the job object to _ArchiveJobUnlocked insteadof only the job ID. Also return whether job was actually archived.
Use subdirectories for job queue archive
As it turned out, having many files in a single directory can bevery painful. With this patch, only 10'000 files are stored in adirectory for the job queue archive. With 10'000 directries, thisallows for up to 100 million jobs be archived without having large...
Add rename function automatically creating directories if needed
Unfortunately, os.makedirs in Python 2.4 is not safe against multipleprocesses creating the same directory tree at the same time. This isonly fixed in Python 2.5 and up. Adding more checks in our code doesn't...
ganeti.http: Don't pass poller object around
They're cheap to instantiate and doing this changes makes the codea bit simpler.
Rename http.HttpInternalError to HttpInternalServerError
All other exceptions are named after the error name in RFC2616 (HTTP/1.1).
ganeti.http: Add more constants and errors
ganeti.http: Ignore ENOTCONN when shutting down the connection
Implement support for additional headers with HTTP errors
Add simple unittests for ganeti.http
More complex unittests will need some refactoring in the HTTP code.
ganeti.bootstrap: Whitespace fix
Add job queue size limit
A job queue with too many jobs can increase memory usage and/or makethe master daemon slow. The current limit is just an arbitrary number.A "soft" limit for automatic job archival is prepared.
utils.KillProcess: Use waitpid() to wait for child processes
Sometimes the proc filesystem doesn't reflect the current status ofa process. By calling waitpid(), we make sure to get the currentinformation, at least for child processes. The timeout is still...
Release ganeti 2.0~alpha1
LUConnectConsole: fix primary_node online check
The primary node is part of the instance, not of the opcode.
_RunCmdPipe: handle EINTR in poller.poll()
poll() can be interrupted. rather than failing we retry until itreturns.
KVM: improve socat interface
Call socat with a full path specified at configure time, rather thanjust by its name, and check for the binary to exist at hypervisorverify.
KVM: use a different default kernel path
It makes sense for the default kvm kernel not to be called "xenU".
ganeti.http: Add three TODOs for improvements
ganeti.http: Explicitly initiate handshake
Otherwise it would be done on the first read/write operation, makingerror handling more difficult (such as EOF during handshake).
ganeti.http: Implement handshake socket operation
ganeti.http: Handle SSL_ERROR_ZERO_RETURN
Also add a comment next to the place where the SSL connection is shutdown.
cleanup: ConfigWriter, initialize all attributes
We should initialized the _last_cluster_serial in the constructor too (just tobe consistent).
cleanup: rapi v2 instance tags wrong attribute
This was changed in the past, but it seems this class was forgotten.
cleanup: http server, line too long
cleanup: http client, line too long
cleanup: xen hypervisor
Wrong indentation and uniformize one method signature.
cleanup: kvm code likes to redefine names
lib/ssh.py: import the logging module
This only means most of our error paths in this module were not working(and generating exceptions).
SshRunner: add docstring for _BuildSshOptions
Improve _autoconf.py comments
This adds a docstring to the _autoconf.py file detailing how it'sgenerated (the other comment it's not visible in pydoc/epydoc).
cleanup: use _ for unused loop counter
cleanup: WorkerPool, wrong variable name
Quoting Michael: "why is this even working?"
Reviewed-by: imsnah,amishchenko
cleanup: TcpPing, wrong variable name
The default value of 'False' wasn't initialized properly. It doesn'trequire initialization, but it's cleaner this way.
cleanup: SetEtcHostsEntry unused var
cleanup: fix IAllocator hypervisor usage
Two problems: the iallocator.hypervisor wasn't initialized to None inthe constructor, so pylint doesn't realize it's initialized later withsetattr.
Second, 'hypervisor' is a module, so we shouldn't use it as a variable....
cleanup: LUReplaceDisks unused vars
And a small whitespace fix.
cleanup: do not hide upper-scope name
hypervisor is a module, so we shouldn't use it as an argument.
cleanup: fix use of _CheckNodeOnline
A few cases of wrong variable name.
cleanup: LUAddNode, LUSetNodeParams unused variable
This is a leftover from the abstraction of AdjustCandidatePool, and italso requires the config lock, so it's better to remove it.
cleanup: LURenameCluster wrong variable name
cleanup: fix export NIC count the same way as disk
For safety, we use the same algorithm as in disk count.
cleanup: fix backend._RecursiveFindBD
_RecursiveFindBD takes a parameter that isn't used; moreover, nowhere inthe SVN history can I find a case that it has been used.
As such, remove this parameter and fix its callers.
cleanup: more unused vars
cleanup: sanitize a default parameter
Instead of relying that the usage of the parameter is ok with mutabledefault parameters, let's just make it safer..
cleanup: exceptions should derive from Exception
cleanup: fix GatherMasterVotes
Remove unused vars
cleanup: _InitSSHSetup doesn't need its argument
cleanup: fix 'variable unused' warning
In the iteration we don't care about the node names, so we change thefor loop to be over the values (and not itervalues).
ganeti.http: Rename HttpBase._using_ssl to HttpBase.using_ssl
It'll be queried from other classes.
ganeti.http: Rename HttpSocketBase to HttpBase
It's more appropriate.
Fix epydoc format warnings
This patch should fix all outstanding epydoc parsing errors; as such, weswitch epydoc into verbose mode so that any new errors will be visible.
Switch epydoc to parse only
epydoc seems to be mightily confused by decorators and how they changefunctions (it starts mixing the parameters of the decorated functioninto the decorator itself); so we want it to parse only and not look atthe objects themselves....
ganeti.backend: Improve compression check
ganeti.http: Docstring updates
ganeti.http: Remove _HttpClientError
This is a leftover from old code.