- Jan 09, 2009
-
-
Iustin Pop authored
The current fork+close fds sequence has deficiencies which are hard to work 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 can't track nicely - the queue locks the queue file, and again this fd needs to be kept open which is hard from the main loop (and this error is currently hidden by the fact that we don't log it) Given the above, it's much simpler, in case we will fork later, to close file descriptors right at the beginning of the program, and in Daemonize only close/reopen the stdin/out/err fds. In addition, we also close() the handlers we remove in SetupLogging so that the cleanup is more thorough. Reviewed-by: imsnah
-
Iustin Pop authored
In 1.2, due to the md+drbd7 legacy, we had a complex choice of replace modes, and the new drbd8 modes where forced into this syntax, with some complicated rules of transition from one mode to another (if REPLACE_ALL but not new node passed, switch to REPLACE_SEC, etc.). This patch cleans this situation by making a clear separation between the two main modes: - replace on current nodes (with the two sub-cases on primary and on secondary) - change to a new node (either via manually specified node or via iallocator) Reviewed-by: imsnah
-
- Jan 08, 2009
-
-
Iustin Pop authored
For offline nodes, we shouldn't add them to the NV_NODELIST and NV_NODENETTEST tests since they most likely won't succeed. The patch makes gnt-cluster verify happy again in such cases. Reviewed-by: imsnah
-
Iustin Pop authored
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. Reviewed-by: imsnah
-
Iustin Pop authored
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. Reviewed-by: iustinp The difference from the original patch is that we don't include the cmdlib changes, since those will come as a copy from the 1.2 cmdlib.py, and not as individual patches. Original-Author: ultrotter
-
Iustin Pop authored
This is plain copy of the 1.2 ReAttachNet and DisconnectNet methods on the DRBD8 device, with the logger to logging module changes and the ReAttachNet method renamed to AttachNet. These methods are not used anywhere right now, but will be used for migration and a simpler disk-replace. The code was originally committed on the 1.2 branch as revision numbers 1165 and 1204. Originally-Reviewed-by: imsnah, ultrotter
-
- Jan 07, 2009
-
-
Iustin Pop authored
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 iv_name to index switch. Original-Author: imsnah
-
Iustin Pop authored
This is an extract of commit 1166 on the 1.2 branch (Add a rpc call for drbd network reconfiguration), but only the blockdev_close part. The patch changes the blockdev_close call to take the instance so that it can remove the symlinks of the instance. Originally-Reviewed-by: imsnah
-
Iustin Pop authored
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). Reviewed-by: imsnah
-
Iustin Pop authored
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 It's just whitespace... isn't it? uhm... :) Anyway, fixing an error made when reformatting the code for the new "safer" behaviour. Reviewed-by: iustinp Original-Author: ultrotter
-
Iustin Pop authored
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. With this patch we move the call to this function into a pre-existing try-except block in the code, and catch the BlockDeviceError exception, logging a message and returning a failure state if it happens. Reviewed-by: iustinp The changes are related to the new hypervisor and logging syntax. Original-Author: ultrotter
-
Iustin Pop authored
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 function. This makes sure that every time an instance is started symlinks to its block devices are created, and the instance is started off them, rather than the underlying block devices. Reviewed-by: iustinp The changes we make to the patch is related to newer function signatures in 2.0, and to the fact that iv_name is deprecated and we use instead disk%d based on the disk index. Original-Author: ultrotter
-
Iustin Pop authored
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 manipulate it later without messing with the block devices (eg. by changing the system name to a symlink to the name itself). Since the HVM hypervisor changes the "virtual" name a note is added calling for a redesign that doesn't need this change, as different hypervisors and emulation types will anyway have different names for exported devices. Reviewed-by: iustinp The changes in this patch compared to the original are: - we keep passing the original disk object, not for its iv_name, but for it's physical_id which is needed by the file driver (this could be fixed maybe) - we don't use the iv_name anymore, since in 2.0 we already use the index of the device Original-Author: ultrotter
-
Iustin Pop authored
Commit 2117 changed _AssembleInstanceDisks to correctly parse the failure status of the new RpcResult structure, but it didn't fix the storing of only the result payload. Since RpcResult is not JSON serializable, LUActivateInstanceDisks is failing. Reviewed-by: ultrotter
-
- Jan 06, 2009
-
-
Iustin Pop authored
Two bad indentation cases and a missing variable. Reviewed-by: imsnah
-
- Dec 19, 2008
-
-
Michael Hanselmann authored
Reviewed-by: amishchenko
-
Michael Hanselmann authored
Reviewed-by: amishchenko
-
Michael Hanselmann authored
Reviewed-by: amishchenko
-
Michael Hanselmann authored
Reviewed-by: amishchenko
-
Michael Hanselmann authored
Previously, we set the permissions only after writing the key. This gave other users on the system a small window during which they could read the key. Reviewed-by: amishchenko
-
Michael Hanselmann authored
Reviewed-by: amishchenko
-
Michael Hanselmann authored
Reviewed-by: amishchenko
-
Michael Hanselmann authored
Passwords are stored in "$localstatedir/lib/ganeti/rapi_users". User options specify the access permissions of a user (see docstring for ganeti.http.ReadPasswordFile), for which only "write" is supported to grant write access. Every other user has read-only access. Reviewed-by: amishchenko
-
Michael Hanselmann authored
This will be used to evaluate access permissions to resources. Reviewed-by: amishchenko
-
Michael Hanselmann authored
Lines in the password file are of the following format: <username> <password> [options] Fields are separated by whitespace. Username and password are mandatory, options are optional and separated by comma (","). Empty lines and comments ("#") are ignored. Reviewed-by: amishchenko
-
Michael Hanselmann authored
Reviewed-by: amishchenko
-
Michael Hanselmann authored
As per RFC2617. Reviewed-by: amishchenko
-
Michael Hanselmann authored
The authentication class will override PreHandleRequest. Reviewed-by: amishchenko
-
- Dec 18, 2008
-
-
Michael Hanselmann authored
Reviewed-by: ultrotter
-
Michael Hanselmann authored
Reducing the actual number of RPC calls will come in another patch. Reviewed-by: ultrotter
-
Michael Hanselmann authored
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 user will see how many jobs are left unchecked. Reviewed-by: ultrotter
-
Michael Hanselmann authored
This is done by passing the job object to _ArchiveJobUnlocked instead of only the job ID. Also return whether job was actually archived. Reviewed-by: ultrotter
-
Michael Hanselmann authored
As it turned out, having many files in a single directory can be very painful. With this patch, only 10'000 files are stored in a directory for the job queue archive. With 10'000 directries, this allows for up to 100 million jobs be archived without having large numbers of files in a single directories. Not that it is realistic, anyway. Reviewed-by: ultrotter
-
Michael Hanselmann authored
Unfortunately, os.makedirs in Python 2.4 is not safe against multiple processes creating the same directory tree at the same time. This is only fixed in Python 2.5 and up. Adding more checks in our code doesn't make it any better. Reviewed-by: iustinp
-
Michael Hanselmann authored
They're cheap to instantiate and doing this changes makes the code a bit simpler. Reviewed-by: ultrotter
-
Michael Hanselmann authored
All other exceptions are named after the error name in RFC2616 (HTTP/1.1). Reviewed-by: amishchenko
-
Michael Hanselmann authored
Reviewed-by: amishchenko
-
Michael Hanselmann authored
Reviewed-by: amishchenko
-
Michael Hanselmann authored
Reviewed-by: amishchenko
-
- Dec 17, 2008
-
-
Michael Hanselmann authored
More complex unittests will need some refactoring in the HTTP code. Reviewed-by: amishchenko
-