[PATCH stable-2.15] Cancel RAPI job if the client drops the connection

2016-04-26 Thread 'Federico Morg Pareschi' via ganeti-devel
This commit fixes a bug where long-lasting OsDiagnose jobs would unnecessarily execute after a RAPI client had already closed the connection. This fix introduces a couple new polling/timeout constants for Luxi and RAPI to handle the polling of the HTTP connection while at the same time monitor the

[PATCH stable-2.15] Cancel RAPI job if the client drops the connection

2016-04-26 Thread 'Federico Morg Pareschi' via ganeti-devel
This commit fixes a bug where long-lasting OsDiagnose jobs would unnecessarily execute after a RAPI client had already closed the connection. This fix introduces a couple new polling/timeout constants for Luxi and RAPI to handle the polling of the HTTP connection while at the same time monitor the

[PATCH stable-2.15] Cancel RAPI job if the client drops the connection

2016-04-27 Thread 'Federico Morg Pareschi' via ganeti-devel
This commit fixes a bug where long-lasting OsDiagnose jobs would unnecessarily execute after a RAPI client had already closed the connection. This fix introduces a couple new polling/timeout constants for Luxi and RAPI to handle the polling of the HTTP connection while at the same time monitor the

[PATCH stable-2.16] Implement localized cache for lvs commands

2016-05-03 Thread 'Federico Morg Pareschi' via ganeti-devel
This patch optimizes unnecessary calls to the lvs command when running gnt-cluster verify (among other operations) by caching multiple series of lvs statements into a single operation and storing the results in a dictionary with device paths used as keys. Signed-off-by: Federico Morg Pareschi ---

[PATCH stable-2.16] Don't verify disks when all disk templates are ext

2016-05-05 Thread 'Federico Morg Pareschi' via ganeti-devel
Verify disks should not run on clusters or nodegroups with only ext storage, as it requires an unnecessary amount of locks for its jobs. This commit performs additional checks when submitting a gnt-cluster verify-disks job or during a watcher run to prevent this. Signed-off-by: Federico Morg Pares

[PATCH stable-2.16 2/2] Fix for commit: 7698b603

2016-05-05 Thread 'Federico Morg Pareschi' via ganeti-devel
Signed-off-by: Federico Morg Pareschi --- lib/backend.py | 11 ++- lib/storage/bdev.py | 11 +++ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/lib/backend.py b/lib/backend.py index ba71fbe..f0ce380 100644 --- a/lib/backend.py +++ b/lib/backend.py @@ -3805,7

[PATCH stable-2.16] Fix broken parameters in storage create methods

2016-05-06 Thread 'Federico Morg Pareschi' via ganeti-devel
Signed-off-by: Federico Morg Pareschi --- lib/storage/bdev.py| 13 +++-- lib/storage/drbd.py| 2 +- lib/storage/extstorage.py | 8 lib/storage/filestorage.py | 4 ++-- lib/storage/gluster.py | 4 ++-- 5 files changed, 16 insertions(+), 15 deletions(-) di

[PATCH stable-2.16] Fix broken parameters in storage create methods

2016-05-06 Thread 'Federico Morg Pareschi' via ganeti-devel
Due to a previous commit, some parameters and function calls were broken. This commit should fix it by moving all the arguments to **kwargs rather than *args (for consistency). Apologies for the inconvenience. Federico Morg Pareschi (1): Fix broken parameters in storage create methods lib/sto

[PATCH stable-2.16] Fix broken parameters in storage create methods

2016-05-06 Thread 'Federico Morg Pareschi' via ganeti-devel
This bug was introduced by commit 38c735d62ae and should be now fixed. Signed-off-by: Federico Morg Pareschi --- lib/storage/bdev.py| 13 +++-- lib/storage/drbd.py| 2 +- lib/storage/extstorage.py | 8 lib/storage/filestorage.py | 4 ++-- lib/storage/gluster.

[PATCH stable-2.16] Improve test coverage for block device creation

2016-05-10 Thread 'Federico Morg Pareschi' via ganeti-devel
This commit introduces further test classes and methods for the Create family of methods of the BlockDev subclasses and a few additional minor cosmetic changes. Signed-off-by: Federico Morg Pareschi --- lib/storage/base.py| 13 ++ lib/storage/gluster.py

[PATCH stable-2.16] Improve test coverage for block device creation

2016-05-10 Thread 'Federico Morg Pareschi' via ganeti-devel
There is no functional change from this patch. While the test coverage of our storage backend is still far from satisfactory, this patch tries to improve the little we have so that we can better catch refactoring bugs like those introduced by commit 38c735d62ae (and subsequiently fixed by 5529ea58a

[PATCH stable-2.16] Don't verify disks when all disk templates are ext

2016-05-10 Thread 'Federico Morg Pareschi' via ganeti-devel
Thanks for reviewing Brian, I have implemented the changes you suggested and I have already squashed the two commits into a single patch. Please have another look. Federico Morg Pareschi (1): Don't verify disks when all disk templates are ext lib/cmdlib/cluster/verify.py | 24 +++

[PATCH stable-2.16] Don't verify disks when all disk templates are ext

2016-05-10 Thread 'Federico Morg Pareschi' via ganeti-devel
Verify disks should not run on clusters or nodegroups with only ext storage, as it requires an unnecessary amount of locks for its jobs. This commit performs additional checks when submitting a gnt-cluster verify-disks job or during a watcher run to prevent this. Signed-off-by: Federico Morg Pares

[PATCH stable-2.16] Fix LogicalVolume Attach failure on missing path

2016-05-16 Thread 'Federico Morg Pareschi' via ganeti-devel
This commit fixes a bug where a LogicalVolume would try to attach to a non-existing device and then raise an exception, rather than gracefully returning a negative result. As a consequence, unit tests have also been introduced for Attach methods for block devices. Signed-off-by: Federico Morg Par

[PATCH stable-2.17] Prevent watcher from holding lock on verify group

2016-06-17 Thread 'Federico Morg Pareschi' via ganeti-devel
The ganeti-watcher holds the group file lock for too long, until after the execution of a group-verify-disk job. This locks for a long time if there are other jobs already running and blocking the verify from executing. When the lock is held, another ganeti-watcher run cannot be scheduled, so this

[PATCH stable-2.17] Prevent the watcher from submitting too many jobs

2016-06-23 Thread 'Federico Morg Pareschi' via ganeti-devel
When the watcher runs on each node group, if it can obtain the group lock, it submits a GROUP_VERIFY_DISKS job for each group. This happens every 5 minutes due to a cron job. This patch stops the watcher from submitting unnecessary verify disks jobs if there are some already pending in the queue to

[PATCH stable-2.17] Introduce a non-strict flag for group verify disk

2016-07-08 Thread 'Federico Morg Pareschi' via ganeti-devel
The group verify disk ganeti job is executed every 5 minutes by a cron job. This type of job tries to take all node locks in a nodegroup in shared mode and can easily get stuck for a long time if there are conflicting long-running jobs (like a create instance). With this commit, we introduce a --n

[PATCH stable-2.17] Introduce a non-strict flag for group verify disk

2016-07-08 Thread 'Federico Morg Pareschi' via ganeti-devel
The group verify disk ganeti job is executed every 5 minutes by a cron job. This type of job tries to take all node locks in a nodegroup in shared mode and can easily get stuck for a long time if there are conflicting long-running jobs (like a create instance). With this commit, we introduce a --n

[PATCH stable-2.16] Use fork instead of spawnv in the watcher

2016-07-11 Thread 'Federico Morg Pareschi' via ganeti-devel
With this commit, the ganeti-watcher now uses os.fork() instead of spawning independent processes for each nodegroup to verify. With the previous approach, there was very little memory being shared between each subprocess and this introduced a significant and unnecessary overhead. With this patch n

[PATCH stable-2.16] Use fork instead of spawnv in the watcher

2016-07-12 Thread 'Federico Morg Pareschi' via ganeti-devel
With this commit, the ganeti-watcher now uses os.fork() instead of spawning independent processes for each nodegroup to verify. With the previous approach, there was very little memory being shared between each subprocess and this introduced a significant and unnecessary overhead. With this patch n

[PATCH stable-2.16] Clean-up of code and fix of pylint warnings

2016-07-13 Thread 'Federico Morg Pareschi' via ganeti-devel
Signed-off-by: Federico Morg Pareschi --- lib/backend.py | 2 +- lib/storage/base.py | 4 ++-- lib/storage/bdev.py | 9 + lib/storage/drbd.py | 2 +- lib/storage/extstorage.py | 2 +- l

[PATCH stable-2.16] Removed unnecessary dependency from rpc in cli

2016-07-14 Thread 'Federico Morg Pareschi' via ganeti-devel
The cli.py module depended on the rpc/node.py module just for a single exported decorator. This ended up reserving unnecessary memory for no actual reason. By changing the imported and exported modules/methods, this commit saves memory on some command line tools like the ganeti-watcher. Signed-off

[PATCH stable-2.16] Refactor cli exception to its appropriate module

2016-07-14 Thread 'Federico Morg Pareschi' via ganeti-devel
Signed-off-by: Federico Morg Pareschi --- lib/cli.py| 18 +++--- lib/errors.py | 11 +++ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/lib/cli.py b/lib/cli.py index 362f2ae..033f9d0 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -76,7 +76,6 @@ __all__ = [

[PATCH stable-2.16] Removed unnecessary dependency from rpc in cli

2016-07-15 Thread 'Federico Morg Pareschi' via ganeti-devel
As a follow-up, I'm changing this patch to have a better-styled import as discussed with Brian offline. Federico Morg Pareschi (1): Removed unnecessary dependency from rpc in cli lib/cli.py| 5 - lib/client/gnt_cluster.py | 7 --- lib/client/gnt_node.py| 3 ++- 3 fi

[PATCH stable-2.16] Removed unnecessary dependency from rpc in cli

2016-07-15 Thread 'Federico Morg Pareschi' via ganeti-devel
The cli.py module depended on the rpc/node.py module just for a single exported decorator. This ended up reserving unnecessary memory for no actual reason. By changing the imported and exported modules/methods, this commit saves memory on some command line tools like the ganeti-watcher. Signed-off

[PATCH stable-2.16] Fix inconsistent spaces vs tabs indent in makefile

2016-08-17 Thread 'Federico Morg Pareschi' via ganeti-devel
The makefile guidelines say to use tabs instead of spaces. This commit makes the file consistent with these guidelines whenever possible, as long as it does not impact the visual alignment of elements. Signed-off-by: Federico Morg Pareschi --- Makefile.am | 64 ++-

[PATCH master] Add design document for a predictive queue system

2016-08-24 Thread 'Federico Morg Pareschi' via ganeti-devel
This design document introduces a new Ganeti job scheduler that prioritizes jobs in the queue based on their lock declaration and state of the cluster. Signed-off-by: Federico Morg Pareschi --- Makefile.am | 1 + doc/design-predictive-queue.rst | 210 +++

[PATCH master] Add design document for a predictive queue system

2016-08-25 Thread 'Federico Morg Pareschi' via ganeti-devel
Regardless of the stability/consistency of luxid, I think Klaus raised a valid point and having a quantized age based on the submission time is probably a more elegant implementation. I have updated the design document to reflect this decision, let me know if you find it appropriate, thanks. Feder

[PATCH master] Add design document for a predictive queue system

2016-08-25 Thread 'Federico Morg Pareschi' via ganeti-devel
This design document introduces a new Ganeti job scheduler that prioritizes jobs in the queue based on their lock declaration and state of the cluster. Signed-off-by: Federico Morg Pareschi --- Makefile.am | 1 + doc/design-predictive-queue.rst | 213 +++

[PATCH master] Add design document for a predictive queue system

2016-08-25 Thread 'Federico Morg Pareschi' via ganeti-devel
This design document introduces a new Ganeti job scheduler that prioritizes jobs in the queue based on their lock declaration and state of the cluster. Signed-off-by: Federico Morg Pareschi --- Makefile.am | 1 + doc/design-predictive-queue.rst | 213 +++

[PATCH master] Add design document for a predictive queue system

2016-08-26 Thread 'Federico Morg Pareschi' via ganeti-devel
This design document introduces a new Ganeti job scheduler that prioritizes jobs in the queue based on their lock declaration and state of the cluster. Signed-off-by: Federico Morg Pareschi --- Makefile.am | 1 + doc/design-predictive-queue.rst | 221 +++

[PATCH master] First implementation of the predictive scheduler

2016-09-02 Thread 'Federico Morg Pareschi' via ganeti-devel
This is just a partial implementation of the static lock prediction system. With this, Ganeti queue system tries to predict the locks of the running jobs and schedule new jobs that are less likely to block. It is a partial implementation which might cause starvation for jobs stuck in the queue, fol

[PATCH master] Implementation of the predictive job scheduler

2016-09-02 Thread 'Federico Morg Pareschi' via ganeti-devel
As outlined in the previous design doc (design-predictive-queue.rst), this commit provides the first (partial) implementation of such plan. There is no starvation prevention yet, I will submit that in a follow-up patch as this one was getting pretty big already. The testing infrastructure is still

[PATCH master 2/2] Implement starvation-prevention mechanism in queue

2016-09-08 Thread 'Federico Morg Pareschi' via ganeti-devel
This patch adds a starvation prevention mechanism to the Ganeti predictive job queue. It calculates the age of submitted jobs comparing the current time to the submission time and appropriately adjusts the job's lock weight accordingly to avoid starvation. Signed-off-by: Federico Morg Pareschi --

[PATCH master] Implement anti-starvation mechanism for jobs

2016-09-08 Thread 'Federico Morg Pareschi' via ganeti-devel
This patch depends on the not-yet-submitted predictive scheduler implementation. Please make sure the code is up-to-date with that patch before applying this one. This implementation introduces an anti-starvation mechanism for the predictive job queue in Ganeti. It is based on the predictive queue

[PATCH master 2/3] Improve the test data generation algorithms

2016-09-08 Thread 'Federico Morg Pareschi' via ganeti-devel
This commit improves some of the test data generation in the ConfigData dummy values of quickcheck, to have a saner and more robust testing infrastructure. Signed-off-by: Federico Morg Pareschi --- test/hs/Test/Ganeti/JQueue/LockDecls.hs | 26 ++ test/hs/Test/Ganeti/Objects.hs | 3

[PATCH master] Improve data generation for tests

2016-09-08 Thread 'Federico Morg Pareschi' via ganeti-devel
This patch depends on the not-yet-submitted predictive queue patch and its purpose is to improve the data generation and accuracy for most job/opcode test cases. Make sure the previous patch is checked into the master tree before applying this one. There should be no conflicts between this patch a

[PATCH master] First implementation of the predictive scheduler

2016-09-13 Thread 'Federico Morg Pareschi' via ganeti-devel
This is just a partial implementation of the static lock prediction system. With this, Ganeti queue system tries to predict the locks of the running jobs and schedule new jobs that are less likely to block. It is a partial implementation which might cause starvation for jobs stuck in the queue, fol

[PATCH master 2/2] Implement starvation-prevention mechanism in queue

2016-09-13 Thread 'Federico Morg Pareschi' via ganeti-devel
This patch adds a starvation prevention mechanism to the Ganeti predictive job queue. It calculates the age of submitted jobs comparing the current time to the submission time and appropriately adjusts the job's lock weight accordingly to avoid starvation. Signed-off-by: Federico Morg Pareschi --

[PATCH master] Improve the test data generation algorithms

2016-09-20 Thread 'Federico Morg Pareschi' via ganeti-devel
This commit improves some of the test data generation in the ConfigData dummy values of quickcheck, to have a saner and more robust testing infrastructure. Signed-off-by: Federico Morg Pareschi --- test/hs/Test/Ganeti/JQueue/LockDecls.hs | 25 ++--- test/hs/Test/Ganeti/Objects.hs | 38

[PATCH master] Fix for instance reinstall not updating config

2016-11-28 Thread 'Federico Morg Pareschi' via ganeti-devel
As per issue #1193, instance reinstalls with modified OS parameters did not persist among reinstalls and were not saved to the cluster's config data. With this patch, this problem should be fixed. Signed-off-by: Federico Morg Pareschi --- lib/cmdlib/instance_operation.py | 8 ++-- 1 file cha

[PATCH stable-2.15] Fix for incorrect parsing of DRBD versions

2016-12-01 Thread 'Federico Morg Pareschi' via ganeti-devel
Following issue #1194, this patch allows Ganeti to correctly parse drbd versions that also include a dash in their k-fix version component. Signed-off-by: Federico Morg Pareschi --- lib/storage/drbd_info.py| 17 +++-- test/py/ganeti.storage.drbd_unittest.py | 10 +

[PATCH stable-2.15] Fix for incorrect parsing of DRBD versions

2016-12-02 Thread 'Federico Morg Pareschi' via ganeti-devel
Following issue #1194, this patch allows Ganeti to correctly parse drbd versions that also include a dash in their k-fix version component. This technically makes Ganeti treat x.y.z.k the same as x.y.z-k with regards to compatibility. For practicality we can assume that these versions are the same

[PATCH master] Implementation of the starvation prevention in the scheduler

2016-12-16 Thread 'Federico Morg Pareschi' via ganeti-devel
This is the second implementation of the previously-sent patch that implements starvation prevention for the predictive scheduler. I am re-sending this for more clarity as the previous patch has been out for a while and has been a little bitrotten. Federico Morg Pareschi (1): Implement starvati

[PATCH master] Implement starvation-prevention mechanism in queue

2016-12-16 Thread 'Federico Morg Pareschi' via ganeti-devel
This patch adds a starvation prevention mechanism to the Ganeti predictive job queue. It calculates the age of submitted jobs comparing the current time to the submission time and appropriately adjusts the job's lock weight accordingly to avoid starvation. Signed-off-by: Federico Morg Pareschi --

[PATCH master] Improve the test data generation algorithms

2016-12-16 Thread 'Federico Morg Pareschi' via ganeti-devel
I've changed the commit message to make it more evident what was going on. Also some minor changes to make this patch merge without conflicts. Federico Morg Pareschi (1): Improve the test data generation algorithms test/hs/Test/Ganeti/JQueue/LockDecls.hs | 25 ++--- test/hs/Test/Ganeti/Object

[PATCH master] Improve the test data generation algorithms

2016-12-16 Thread 'Federico Morg Pareschi' via ganeti-devel
This commit improves some of the test data generation in the ConfigData dummy values of quickcheck. It generates more realistic instance, node and group names by sampling them from the provided ConfigData. This makes it possible to test for consistent data validation that might depend on multiple n

[PATCH master] FIX: Add missing LockDecls files to Makefile.am

2016-12-19 Thread 'Federico Morg Pareschi' via ganeti-devel
Trivial change to add the missing LockDecls.hs files to Makefile.am. This should remove some complaints to some of the tests that failed to build. Signed-off-by: Federico Morg Pareschi --- Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.am b/Makefile.am index e18ee7e..

[PATCH stable-2.15] Make man pages more consistent in parameter format

2016-12-20 Thread 'Federico Morg Pareschi' via ganeti-devel
This patch adds some more consistency in the parameter names displayed in various ganeti man pages. Signed-off-by: Federico Morg Pareschi --- man/gnt-group.rst| 8 man/gnt-instance.rst | 16 man/gnt-job.rst | 6 +++--- man/gnt-network.rst | 6 +++--- man/gn

[PATCH stable-2.15] Fix typo in cli_opts.py IGNORE_HVVERSIONS_OPT flag

2017-01-03 Thread 'Federico Morg Pareschi' via ganeti-devel
Signed-off-by: Federico Morg Pareschi --- lib/cli_opts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cli_opts.py b/lib/cli_opts.py index 0b1bb0c..75379aa 100644 --- a/lib/cli_opts.py +++ b/lib/cli_opts.py @@ -852,7 +852,7 @@ IGNORE_CONSIST_OPT = cli_option("--ignore-c

[PATCH master] Fix incorrect 'any' function call

2017-01-04 Thread 'Federico Morg Pareschi' via ganeti-devel
As introduced by commit 77807d831976cf018ace04961820987a91c1d58a and was not caught during the code review process. Signed-off-by: Federico Morg Pareschi --- lib/cmdlib/instance_set_params.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cmdlib/instance_set_params

[PATCH master] Fix incorrect 'any' function call

2017-01-04 Thread 'Federico Morg Pareschi' via ganeti-devel
As introduced by commit 77807d83 and d388e30c6d and was not caught during the code review process. Signed-off-by: Federico Morg Pareschi --- lib/cmdlib/instance_set_params.py | 6 +++--- tools/move-instance | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/

[PATCH master] Implement predictive queue cluster parameter

2017-01-09 Thread 'Federico Morg Pareschi' via ganeti-devel
This commit adds the enabled_predictive_queue cluster parameter that allows the cluster to specify if the predictive scheduler should be used or not when ordering ganeti jobs in the queue. It also adds the correct command line flags for the cluster init and cluster modify ganeti jobs. As a default

[PATCH stable-2.15] Make man pages more consistent in parameter format

2017-01-12 Thread 'Federico Morg Pareschi' via ganeti-devel
This patch adds some more consistency in the parameter names displayed in various ganeti man pages and their helper text in gnt commands. Signed-off-by: Federico Morg Pareschi --- lib/client/gnt_backup.py | 6 +++--- lib/client/gnt_cluster.py | 21 +- lib/client/gnt_debug.py