ganeti-local
12 years agoRevert "Updated man pages with new SPICE TLS options"
Guido Trotter [Mon, 17 Oct 2011 15:46:20 +0000 (16:46 +0100)]
Revert "Updated man pages with new SPICE TLS options"

This reverts commit b8a10435271ec4457cdc254e0a6b466b2d3bff24.
This commit will be readded on master.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoRevert "Add tls_ciphers and use_vdagent options"
Guido Trotter [Mon, 17 Oct 2011 15:45:45 +0000 (16:45 +0100)]
Revert "Add tls_ciphers and use_vdagent options"

This reverts commit 3e40b5879fa0070d6dd0e689dcfc31f20198a5a8.
This commit will be readded on master.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agorapi.client.ModifyNode should PUT rather than POST
Guido Trotter [Tue, 18 Oct 2011 12:32:12 +0000 (13:32 +0100)]
rapi.client.ModifyNode should PUT rather than POST

This was caught (albeit in a sibylline manner) by unittests on master
which are not present in 2.5.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoFix RAPI node modify client and server calls
Guido Trotter [Tue, 18 Oct 2011 08:50:03 +0000 (09:50 +0100)]
Fix RAPI node modify client and server calls

rapi.client.ModifyNode accepts a "group" and not a "node" param.
(this bug is invisible but still not nice)

rlib2.R_2_nodes_name_modify submits the opcode with instance_name rather
than node_name as a param. This would break the call.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoxen: changes to facilitate "xl" support (xen 4.1)
Guido Trotter [Mon, 17 Oct 2011 11:05:00 +0000 (12:05 +0100)]
xen: changes to facilitate "xl" support (xen 4.1)

- Copy the xl config file, in case there's any
- Start instances by config file, not name (also xm compatible)
- Start paused domains with -p and not --paused (also xm compatible)
- Add a fixme for migration (changes are not xm compatible)

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoxen: abstract instance config file naming
Guido Trotter [Mon, 17 Oct 2011 11:04:18 +0000 (12:04 +0100)]
xen: abstract instance config file naming

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoAbstract xen's 'xm' command as a constant
Guido Trotter [Mon, 17 Oct 2011 10:35:52 +0000 (11:35 +0100)]
Abstract xen's 'xm' command as a constant

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoFix RAPI documentation build
Michael Hanselmann [Thu, 13 Oct 2011 14:58:19 +0000 (16:58 +0200)]
Fix RAPI documentation build

*mumble*

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agorapi: Allow auto-promotion on node role change
Michael Hanselmann [Thu, 13 Oct 2011 12:19:08 +0000 (14:19 +0200)]
rapi: Allow auto-promotion on node role change

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agorapi: Add resource for modifying node
Michael Hanselmann [Thu, 13 Oct 2011 12:11:00 +0000 (14:11 +0200)]
rapi: Add resource for modifying node

A separate patch will add “auto-promote” through
“/2/nodes/[node_name]/role”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoopcodes: Add comment to *SetParams result description
Michael Hanselmann [Thu, 13 Oct 2011 12:10:07 +0000 (14:10 +0200)]
opcodes: Add comment to *SetParams result description

Explicitely say that the second element of the tuple is the new value.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoMerge branch 'stable-2.5' into devel-2.5
Michael Hanselmann [Wed, 12 Oct 2011 11:03:15 +0000 (13:03 +0200)]
Merge branch 'stable-2.5' into devel-2.5

* stable-2.5:
  rpc: Disable HTTP client pool and reduce memory consumption
  hail: Fix result for node evacuation
  Fix assertion error on unclean master shutdown

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoMerge branch 'devel-2.4' into stable-2.5
Michael Hanselmann [Wed, 12 Oct 2011 11:00:19 +0000 (13:00 +0200)]
Merge branch 'devel-2.4' into stable-2.5

* devel-2.4:
  rpc: Disable HTTP client pool and reduce memory consumption
  Fix assertion error on unclean master shutdown

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agorpc: Disable HTTP client pool and reduce memory consumption
Michael Hanselmann [Wed, 12 Oct 2011 10:37:43 +0000 (12:37 +0200)]
rpc: Disable HTTP client pool and reduce memory consumption

We noticed that “ganeti-masterd” can use large amounts of memory,
especially on large clusters. Measurements showed a single PycURL client
using about 500 kB of heap memory (the actual usage depends on versions,
build options and settings).

The RPC client uses a per-thread HTTP client pool with one client per
node. At this time there are 41 non-main threads (25 for the job queue
and 16 for client requests). This means the HTTP client pools use a lot
of memory (ca. 200 MB for 10 nodes, ca. 1 GB for 50 nodes).

This patch disables the per-thread HTTP client pool. No cleanup of
unused code is done. That will be done in the master branch only.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoPreserve bridge MTU in KVM ifup script
Andrea Spadaccini [Tue, 11 Oct 2011 13:39:05 +0000 (14:39 +0100)]
Preserve bridge MTU in KVM ifup script

Closes: #201 - KVM_IFUP does not set bridge-MTU on tap devices
Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agohail: Fix result for node evacuation
Michael Hanselmann [Fri, 7 Oct 2011 09:58:09 +0000 (11:58 +0200)]
hail: Fix result for node evacuation

According to the iallocator documentation the “node-evacuate” call needs
to return a list of jobs, not a list of lists of jobs.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoMerge branch 'stable-2.5' into devel-2.5
Andrea Spadaccini [Tue, 4 Oct 2011 18:31:46 +0000 (19:31 +0100)]
Merge branch 'stable-2.5' into devel-2.5

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agocluster-merge: log an info message at node readd
Guido Trotter [Tue, 4 Oct 2011 18:02:39 +0000 (14:02 -0400)]
cluster-merge: log an info message at node readd

node readd can take a long time, it's good to have info messages to see
progress.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Andrea Spadaccini <spadaccio@google.com>

12 years agoBump version to 2.5.0~rc1 v2.5.0rc1
Michael Hanselmann [Tue, 4 Oct 2011 09:29:34 +0000 (11:29 +0200)]
Bump version to 2.5.0~rc1

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoFix issue when verifying cluster files
Michael Hanselmann [Mon, 3 Oct 2011 14:58:22 +0000 (16:58 +0200)]
Fix issue when verifying cluster files

If a cluster has any non-master-candidate nodes, those don't contain all
files (e.g. config.data). With commit aef59ae764dc (March 31st, 2011)
the logic was changed and subsequently verifying a cluster with non-mc
nodes would complain.

This patch fixes this issue by changing the algorithm. It also adds an
additional check for files which shouldn't exist on a machine. A newly
added unittest is included.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoRevert "utils.log: Write error messages to stderr"
Michael Hanselmann [Mon, 3 Oct 2011 10:46:27 +0000 (12:46 +0200)]
Revert "utils.log: Write error messages to stderr"

This reverts commit 34aa8b7c4bb6f5e2e788108e024c9cd70bdb3431. Writing
error messages to stderr would also include backtraces, something we
tried to avoid in the past.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoFix adding nodes after commit 64c7b3831dc
Michael Hanselmann [Mon, 3 Oct 2011 10:04:09 +0000 (12:04 +0200)]
Fix adding nodes after commit 64c7b3831dc

Commit 64c7b3831dc changed the RPC call for verifying SSH connections.
Unfortunately this case in adding nodes was missed.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoLUClusterVerifyGroup: Spread SSH checks over more nodes
Michael Hanselmann [Fri, 30 Sep 2011 15:48:28 +0000 (17:48 +0200)]
LUClusterVerifyGroup: Spread SSH checks over more nodes

When verifying a group the code would always check SSH to all nodes in
the same group, as well as the first node for every other group. On big
clusters this can cause issues since many nodes will try to connect to
the first node of another group at the same time. This patch changes the
algorithm to choose a different node every time.

A unittest for the selection algorithm is included.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoOptimise cli.JobExecutor with many pending jobs
Iustin Pop [Fri, 30 Sep 2011 14:35:29 +0000 (16:35 +0200)]
Optimise cli.JobExecutor with many pending jobs

In the case we submit many pending jobs (> 100) to the masterd, the
JobExecutor 'spams' the master daemon with status requests for the
status of all the jobs, even though in the end it will only choose a
single job for polling.

This is very sub-optimal, because when the master is busy processing
small/fast jobs, this query forces reading all the jobs from
this. Restricting the 'window' of jobs that we query from the entire
set to a smaller subset makes a huge difference (masterd only, 0s
delay jobs, all jobs to tmpfs thus no I/O involved):

- submitting/waiting for 500 jobs:
  - before: ~21 s
  - after:   ~5 s
- submitting/waiting for 1K jobs:
  - before: ~76 s
  - after:   ~8 s

This is with a batch of 25 jobs. With a batch of 50 jobs, it goes from
8s to 12s. I think that choosing the 'best' job for nice output only
matters with a small number of jobs, and that for more than that
people will not actually watch the jobs. So changing from 'perfect
job' to 'best job in the first 25' should be OK.

Note that most jobs won't execute as fast as 0 delay, but this is
still a good improvement.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoMerge branch 'stable-2.5' into devel-2.5
Andrea Spadaccini [Fri, 30 Sep 2011 14:25:48 +0000 (15:25 +0100)]
Merge branch 'stable-2.5' into devel-2.5

* stable-2.5:
  listrunner: Don't pass arguments if there are none
  ssh: Quote strings in error message
  utils.log: Write error messages to stderr
  Add signal handling doc to hbal man page
  Fix handling of cluster verify hooks
  Redistribute the RAPI certificate
  QA: Add tests for instance start/stop via RAPI
  RAPI: Fix wrong check on instance shutdown
  baserlib: Accept empty body in FillOpcode

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoUse --yes to deactivate master ip in cluster merge
Guido Trotter [Fri, 30 Sep 2011 12:44:46 +0000 (13:44 +0100)]
Use --yes to deactivate master ip in cluster merge

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Andrea Spadaccini <spadaccio@google.com>

12 years agoUse deactivate-master-ip in cluster-merge
Andrea Spadaccini [Thu, 29 Sep 2011 19:22:22 +0000 (20:22 +0100)]
Use deactivate-master-ip in cluster-merge

Use the gnt-cluster deactivate-master-ip command in cluster-merge to
disable the master IP.

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
(cherry picked from commit e87e5afb163a2a51e783914f78120406f6b5f4e0)

12 years agoAdd gnt-cluster commands to toggle the master IP
Andrea Spadaccini [Thu, 29 Sep 2011 18:48:18 +0000 (19:48 +0100)]
Add gnt-cluster commands to toggle the master IP

lib/client/gnt_cluster.py:
* Add activate-master-ip and deactivate-master-ip commands

man/gnt-cluster.rst:
* Document the new commands

lib/opcodes.py lib/cmdlib.py
* Add two opcodes and the LU that call the relevant RPCs

test/docs_unittest.py
* Silence an error about RAPI not implemented for the two new opcodes

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
(cherry picked from commit fb926117f623a61776b90e992126f953679ca066)

Conflicts:

test/docs_unittest.py
  - kept devel-2.5 version, without the RAPI opcode checks

12 years agoSplit starting and stopping master IP and daemons
Andrea Spadaccini [Thu, 29 Sep 2011 12:05:23 +0000 (13:05 +0100)]
Split starting and stopping master IP and daemons

lib/backend.py
* split StartMaster() in ActivateMasterIp() and StartMasterDaemons()
* split StopMaster() in DeactivateMasterIp() and StopMasterDaemons()

lib/server/noded.py, lib/rpc.py
* adapt the call chains to the new functions, define new RPCs

lib/bootstrap.py, lib/cmdlib.py, lib/server/masterd.py
* use the new RPCs

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
(cherry picked from commit fb460cf7e9bda225e4f1c070cd6b4fac1b3f6696)

12 years agolistrunner: Don't pass arguments if there are none
Michael Hanselmann [Fri, 30 Sep 2011 09:54:20 +0000 (11:54 +0200)]
listrunner: Don't pass arguments if there are none

If no arguments were specified the “exec_args” variable was “None”,
leading to the command being run as “… ./… None”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agossh: Quote strings in error message
Michael Hanselmann [Fri, 30 Sep 2011 09:29:50 +0000 (11:29 +0200)]
ssh: Quote strings in error message

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoutils.log: Write error messages to stderr
Michael Hanselmann [Fri, 30 Sep 2011 09:28:59 +0000 (11:28 +0200)]
utils.log: Write error messages to stderr

When “gnt-cluster copyfile” failed it would only print “Copy of file …
to node … failed”. A detailed message is written using logging.error.
Writing error messages to stderr can be helpful in figuring out what
went wrong (the messages also go to the log file, but not everyone might
know about it).

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoAdd signal handling doc to hbal man page
Iustin Pop [Fri, 30 Sep 2011 08:30:44 +0000 (10:30 +0200)]
Add signal handling doc to hbal man page

Also remove a bug note, since hbal can now for a long time directly
execute jobs.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoMigration: warn the user about hv version mismatch
Andrea Spadaccini [Tue, 27 Sep 2011 19:22:43 +0000 (20:22 +0100)]
Migration: warn the user about hv version mismatch

* hv_kvm.py, hv_xen.py
  - return the hypervisor version (if available) from GetNodeInfo

* cmdlib.py
  - if hypervisor version is available during the migration, and the
    versions differ, warn the user

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoFix handling of cluster verify hooks
Iustin Pop [Wed, 28 Sep 2011 10:38:12 +0000 (12:38 +0200)]
Fix handling of cluster verify hooks

The change to enforce boolean results for cluster verify group opcode
missed the HooksCallBack, which uses a very ugly 1/0
logic. Furthermore, the logic is wrong, since it unconditionally
resets the verify result to true.

The patch is changed to simply treat hook failures as failures, and do
nothing for offline/nodes.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoRedistribute the RAPI certificate
Iustin Pop [Wed, 28 Sep 2011 09:06:06 +0000 (11:06 +0200)]
Redistribute the RAPI certificate

This reverts to the old behaviour in Ganeti 2.4 and before.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoQA: Add tests for instance start/stop via RAPI
Michael Hanselmann [Thu, 22 Sep 2011 10:20:39 +0000 (12:20 +0200)]
QA: Add tests for instance start/stop via RAPI

This would have detected the issue fixed in the previous patch.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoRAPI: Fix wrong check on instance shutdown
Michael Hanselmann [Thu, 22 Sep 2011 10:19:56 +0000 (12:19 +0200)]
RAPI: Fix wrong check on instance shutdown

Commit 7fa310f6d84 (April 1st, 2011) converted the RAPI resource for
shutting down an instance to FillOpCode. Unfortunately it missed the
fact that the shutdown resource gets its parameters as query arguments.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agobaserlib: Accept empty body in FillOpcode
Michael Hanselmann [Thu, 8 Sep 2011 11:36:15 +0000 (13:36 +0200)]
baserlib: Accept empty body in FillOpcode

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
(cherry picked from commit c6e1a3eef05674d637570c39f25a799cec7ba187)

Signed-off-by: Michael Hanselmann <hansmi@google.com>

12 years agoAdd tls_ciphers and use_vdagent options
Andrea Spadaccini [Wed, 14 Sep 2011 22:00:43 +0000 (23:00 +0100)]
Add tls_ciphers and use_vdagent options

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoUpdated man pages with new SPICE TLS options
Andrea Spadaccini [Tue, 6 Sep 2011 17:37:46 +0000 (18:37 +0100)]
Updated man pages with new SPICE TLS options

man/gnt-cluster.rst:
* documented the --new-spice-certificate, --spice-certificate and
  --spice-ca-certificate options of renew-crypto.

man/gnt-instance.rst:
* documented the spice_use_tls KVM hypervisor option.

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoImplementation of TLS-protected SPICE connections
Andrea Spadaccini [Tue, 6 Sep 2011 17:14:51 +0000 (18:14 +0100)]
Implementation of TLS-protected SPICE connections

Added support for TLS-protected SPICE connections:

client/gnt_cluster.py, cli.py:
* added three new parameters to renew-crypto (--new-spice-certificate,
  --spice-certificate, --spice-ca-certificate) and their validation.

utils/x509.py:
* changed GenerateSelfSignedSslCert so that now also returns the
  generated key and certificate;
* added missing return value in the docstring of
  GenerateSelfSignedX509Cert.

lib/bootstrap.py:
* changed the signatures of the relevant functions and implemented
  certificates generation/writing.

tools/cfupgrade:
* changed GenerateClusterCrypto invocation to reflect the new signature;
* added SPICE certificate names.

lib/errors.py:
* added the X509CertError class.

lib/hypervisor/hv_kvm.py:
* silenced pylint warning R0915

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoAdded SPICE TLS option and related cert paths
Andrea Spadaccini [Tue, 6 Sep 2011 09:26:56 +0000 (10:26 +0100)]
Added SPICE TLS option and related cert paths

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoFix OS creation's error handling when pausing sync
Faidon Liambotis [Fri, 16 Sep 2011 12:58:41 +0000 (15:58 +0300)]
Fix OS creation's error handling when pausing sync

Commit 41e1e79 introduced a feature in which when wait_for_sync is not
set, DRBD sync is paused during the OS installation.

Doing so, however, broke OS creation's error handling: the result value
from the instance_os_add RPC call was overwritten by the one of the
blockdev_pause_resume_sync call before there was a chance for it to
be raised and thus masking possible errors in the OS creation.

Note that the wipe method, from which the pause technique was inspired,
does not suffer from this bug.

Signed-off-by: Faidon Liambotis <faidon@noc.grnet.gr>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agohtools: remove dead code
Iustin Pop [Wed, 14 Sep 2011 10:58:18 +0000 (12:58 +0200)]
htools: remove dead code

The tryEvac/evacuateInstance functions are no longer used in the new
multi-group world order, so we remove them and change the unit-test to
test the actual IAllocator function.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agohail: don't select the primary as new secondary
Iustin Pop [Wed, 14 Sep 2011 10:44:18 +0000 (12:44 +0200)]
hail: don't select the primary as new secondary

This just adds the primary node of the instance as 'non-allocable'
during the choosing of the new secondary.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agohail: add an extra safety check in relocate
Iustin Pop [Wed, 14 Sep 2011 10:43:38 +0000 (12:43 +0200)]
hail: add an extra safety check in relocate

If we select the primary as new secondary, better to fail than return
wrong data to Ganeti.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoFix RAPI documentation for gnt-instance console
Andrea Spadaccini [Tue, 13 Sep 2011 13:12:01 +0000 (14:12 +0100)]
Fix RAPI documentation for gnt-instance console

Fix a failing pyassert in the RAPI docs and update it to reflect the
addition of SPICE to gnt-instance console.

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoAdd SPICE compression and streaming options
Andrea Spadaccini [Thu, 8 Sep 2011 10:03:06 +0000 (11:03 +0100)]
Add SPICE compression and streaming options

Add the following SPICE audio/image compression and video streaming
detection hypervisor options:

* spice_image_compression
* spice_jpeg_wan_compression
* spice_zlib_glz_wan_compression
* spice_streaming_video
* spice_playback_compression

Also add the related documentation and silence pylint R0914 warning
about too many local variables in hv_kvm._GenerateKVMRuntime.

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoAdd SPICE support to gnt-instance console
Andrea Spadaccini [Fri, 9 Sep 2011 14:37:25 +0000 (16:37 +0200)]
Add SPICE support to gnt-instance console

Also update related unit tests.

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoMake KVM use the QXL vga driver with SPICE
Andrea Spadaccini [Wed, 7 Sep 2011 12:25:14 +0000 (13:25 +0100)]
Make KVM use the QXL vga driver with SPICE

Enable by default the QXL paravirtualized graphic card if SPICE is
enabled. The QXL driver is VESA compatible, so it degrades gracefully if
the guest OS does not have QXL drivers.

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoUse a loop to check SPICE parameters dependency
Andrea Spadaccini [Tue, 6 Sep 2011 08:52:55 +0000 (09:52 +0100)]
Use a loop to check SPICE parameters dependency

Use a loop to check if the user specified any SPICE option and SPICE
support is disabled.

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoFix assertion error on unclean master shutdown
Michael Hanselmann [Thu, 14 Jul 2011 20:49:34 +0000 (22:49 +0200)]
Fix assertion error on unclean master shutdown

Commit 66bd7445 added an assertion to ensure a finalized job has its
“end_timestamp” attribute set. Unfortunately it didn't cover a case when
the queue is recovering from an unclean master shutdown.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
(cherry picked from commit 45df0793c6bc83001aa545fda95c1ad9a35d732f)

12 years agoimport: Fix a logic error due to missing "not"
René Nussbaumer [Tue, 6 Sep 2011 07:02:13 +0000 (09:02 +0200)]
import: Fix a logic error due to missing "not"

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoimport: Make sure the disk_dump path is in EXPORT_DIR
René Nussbaumer [Wed, 31 Aug 2011 12:33:56 +0000 (14:33 +0200)]
import: Make sure the disk_dump path is in EXPORT_DIR

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoSwitch other commonprefix to IsBelowDir
René Nussbaumer [Mon, 5 Sep 2011 13:09:23 +0000 (15:09 +0200)]
Switch other commonprefix to IsBelowDir

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoutils: Introduce IsBelowDir
René Nussbaumer [Mon, 5 Sep 2011 11:59:06 +0000 (13:59 +0200)]
utils: Introduce IsBelowDir

This is mainly a wrapper to overcome the limitation of commonprefix
which makes a string by string comparisation and reports the common
prefix in both strings. However this is bad for directory handling.

IsBelowDir works around this limitation and should be used in favour of
commonprefix.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoFixed a typo in gnt_cluster.py
Andrea Spadaccini [Mon, 5 Sep 2011 14:15:00 +0000 (15:15 +0100)]
Fixed a typo in gnt_cluster.py

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoAdded password for SPICE sessions
Andrea Spadaccini [Wed, 24 Aug 2011 14:11:44 +0000 (15:11 +0100)]
Added password for SPICE sessions

Added an optional parameter called spice_password_file that allows
the user to protect the SPICE login with the password contained in
the specified file.

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoDraft implementation of QMP connection
Andrea Spadaccini [Sat, 3 Sep 2011 10:00:58 +0000 (11:00 +0100)]
Draft implementation of QMP connection

Basic implementation of the QMP connection and related tests.

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoPylint fixes for autogenerated files
Andrea Spadaccini [Tue, 30 Aug 2011 16:19:58 +0000 (17:19 +0100)]
Pylint fixes for autogenerated files

Applied s/disable-msg/disable/ also to Makefile.am, in order to inhibit
pylint warnings for autogenerated files.

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoVersion bump for 2.5.0~beta3 v2.5.0beta3
Michael Hanselmann [Wed, 31 Aug 2011 13:47:47 +0000 (15:47 +0200)]
Version bump for 2.5.0~beta3

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoMakefile: Use $(LN_S) instead of “ln -s”
Michael Hanselmann [Tue, 30 Aug 2011 15:37:54 +0000 (17:37 +0200)]
Makefile: Use $(LN_S) instead of “ln -s”

Some platforms apparently don't support “ln -s”, otherwise Autoconf
wouldn't have AC_PROG_LN_S.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoFixes to errors/warnings raised by pylint 0.24
Andrea Spadaccini [Mon, 29 Aug 2011 19:28:41 +0000 (20:28 +0100)]
Fixes to errors/warnings raised by pylint 0.24

Running pylint 0.24.0 revealed 2 errors and 1 warning. Here is how I
fixed them:

* jqueue.py: silenced E1101
* netutils.py: rewrote the list comprehension using extend()
* watcher/__init__.py: fixed a missing format string parameter

These changes are backwards-compatible with pylint 0.21.1.

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoPEP8 for QA
Andrea Spadaccini [Fri, 26 Aug 2011 15:31:12 +0000 (16:31 +0100)]
PEP8 for QA

- Makefile.am: added QA directory to the paths checked by pep8
- qa/: fixed the reported errors
- Makefile.am: also, added qa_group.py to qa_scripts

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agolistrunner: Allow passing of arguments to executable
Michael Hanselmann [Tue, 30 Aug 2011 08:47:49 +0000 (10:47 +0200)]
listrunner: Allow passing of arguments to executable

This wasn't possible until now.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoDeprecationWarning fixes for pylint
Andrea Spadaccini [Mon, 29 Aug 2011 19:15:15 +0000 (20:15 +0100)]
DeprecationWarning fixes for pylint

In version 0.21, pylint unified all the disable-* (and enable-*)
directives to disable (resp. enable). This leads to a lot of
DeprecationWarning being emitted even if one uses the recommended
version of pylint (0.21.1, as stated in devnotes.rst).

This commit changes all the disable-msg directives to disable.

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agolistrunner: Replace str.split with library functions
Michael Hanselmann [Mon, 29 Aug 2011 15:34:24 +0000 (17:34 +0200)]
listrunner: Replace str.split with library functions

- str.split("/").pop() should be os.path.basename
- str.split("\n") should be str.splitlines()

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoMinor updates and fixes to CPU pinning design doc
Tsachy Shacham [Wed, 24 Aug 2011 08:30:22 +0000 (10:30 +0200)]
Minor updates and fixes to CPU pinning design doc

Signed-off-by: Tsachy Shacham <tsachy@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoMerge branch 'devel-2.4' into devel-2.5
René Nussbaumer [Fri, 26 Aug 2011 14:50:58 +0000 (16:50 +0200)]
Merge branch 'devel-2.4' into devel-2.5

Conflicts:
NEWS (trivial)
configure.ac (trivial)
daemons/ensure-dirs.in (deleted)

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoutils: Fix UnescapeAndSplit parsing bug
Michael Hanselmann [Fri, 26 Aug 2011 12:21:35 +0000 (14:21 +0200)]
utils: Fix UnescapeAndSplit parsing bug

If a value passed to UnescapeAndSplit ended with a backslash an
exception would be raised:

$ gnt-instance modify -H mem=x\\ inst1.example.com
[…]
    e2 = slist.pop(0)
IndexError: pop from empty list

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoDelete master IPs from mergee master nodes
Andrea Spadaccini [Thu, 25 Aug 2011 16:47:07 +0000 (17:47 +0100)]
Delete master IPs from mergee master nodes

Added a step in cluster-merge that removes the cluster IP from the
master node of the mergee clusters.

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoUse pep8 utility in “make lint”
Michael Hanselmann [Thu, 25 Aug 2011 10:15:10 +0000 (12:15 +0200)]
Use pep8 utility in “make lint”

This utility checks whether the code conforms to PEP8. Some checks had
to be disabled for Ganeti.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoTwo more PEP8 fixes
Michael Hanselmann [Thu, 25 Aug 2011 15:57:25 +0000 (17:57 +0200)]
Two more PEP8 fixes

cmdlib: Avoid wrapping using backslash

gnt_group: Avoid ** magic using keyword arguments (the “pep8” tool
doesn't like the inline comment in this case and will complain about
spaces around the “**” operator)

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agocheck-python-code: Give location(s) of lines longer than 80 chars
Michael Hanselmann [Tue, 23 Aug 2011 13:12:44 +0000 (15:12 +0200)]
check-python-code: Give location(s) of lines longer than 80 chars

Until now it would only say that there was a line longer than 80
characters, but not where.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoPEP8 style fixes
Michael Hanselmann [Thu, 25 Aug 2011 10:36:56 +0000 (12:36 +0200)]
PEP8 style fixes

Identified using the “pep8” utility.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoWrap a few long lines
Guido Trotter [Tue, 23 Aug 2011 12:42:33 +0000 (13:42 +0100)]
Wrap a few long lines

Had to break it as well, today! ;)

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agolistrunner: Avoid exception if machine is rebooted
Michael Hanselmann [Tue, 23 Aug 2011 16:07:09 +0000 (18:07 +0200)]
listrunner: Avoid exception if machine is rebooted

Handle exceptions gracefully when trying to read the command's output.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoRemove wrong type declaration from option
Guido Trotter [Tue, 23 Aug 2011 11:15:12 +0000 (12:15 +0100)]
Remove wrong type declaration from option

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Andrea Spadaccini <spadaccio@google.com>

12 years agoFix wrong method name in cluster-merge
Andrea Spadaccini [Tue, 23 Aug 2011 10:28:42 +0000 (11:28 +0100)]
Fix wrong method name in cluster-merge

Fixed a wrong method name in the last patch.

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoVersion bump 2.4.4 v2.4.4
René Nussbaumer [Tue, 23 Aug 2011 09:42:51 +0000 (11:42 +0200)]
Version bump 2.4.4

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoFix --skip-stop-instances help message
Guido Trotter [Tue, 23 Aug 2011 09:47:08 +0000 (10:47 +0100)]
Fix --skip-stop-instances help message

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agocluster-merge: Add the --skip-stop-instances opt
Andrea Spadaccini [Tue, 23 Aug 2011 08:48:40 +0000 (09:48 +0100)]
cluster-merge: Add the --skip-stop-instances opt

This option allows to do a check for running instances on the mergee
clusters instead of stopping them.

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

12 years agoUpdate NEWS file
René Nussbaumer [Tue, 23 Aug 2011 09:21:36 +0000 (11:21 +0200)]
Update NEWS file

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoDocumentation fix for importing with --src-dir option
René Nussbaumer [Tue, 23 Aug 2011 09:10:36 +0000 (11:10 +0200)]
Documentation fix for importing with --src-dir option

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
(cherry picked from commit b7d7876bd0e9844fab8be28bfa1fd5d563ec7412)

Conflicts:

lib/cmdlib.py (easily fixed)

12 years agoAdding missing test data for commit 7a380ddfc
René Nussbaumer [Tue, 23 Aug 2011 09:04:27 +0000 (11:04 +0200)]
Adding missing test data for commit 7a380ddfc

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoFix a parsing issue with DRBD 8.3.11 in the Linux Kernel
René Nussbaumer [Tue, 23 Aug 2011 07:23:39 +0000 (09:23 +0200)]
Fix a parsing issue with DRBD 8.3.11 in the Linux Kernel

In the Linux kernel commit 4b0715f096 introduced a display bug into
/proc/drbd which broke our regex.

The bug was first introduced into Linux 2.6.39-rc1. This bug is still
unfixed as of today.

This patch adapt the regular expression to workaround this bug for the
time being.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agowatcher: Wait for child processes by default
Michael Hanselmann [Mon, 22 Aug 2011 15:44:11 +0000 (17:44 +0200)]
watcher: Wait for child processes by default

This patch retains the behaviour of ganeti-watcher in previous Ganeti
versions.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoUpdate release date in NEWS for 2.5.0~beta2 v2.5.0beta2
Michael Hanselmann [Mon, 22 Aug 2011 09:20:06 +0000 (11:20 +0200)]
Update release date in NEWS for 2.5.0~beta2

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoTry 3 times before giving up on per-node commands
Guido Trotter [Fri, 19 Aug 2011 11:29:28 +0000 (12:29 +0100)]
Try 3 times before giving up on per-node commands

When contacting lots of nodes some may fail. Give it a couple more
chances before giving up on them.

Possible future TODO: continue, but just mark them as offline.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoAllow retrying commands in cluster-merge
Andrea Spadaccini [Thu, 18 Aug 2011 09:25:46 +0000 (10:25 +0100)]
Allow retrying commands in cluster-merge

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoAdd a TODO on the VerifyCluster option
Guido Trotter [Fri, 19 Aug 2011 11:23:45 +0000 (12:23 +0100)]
Add a TODO on the VerifyCluster option

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoTransform node readd exceptions into just errors
Guido Trotter [Fri, 19 Aug 2011 11:21:59 +0000 (12:21 +0100)]
Transform node readd exceptions into just errors

We are after the point of no return, no point in failing everything
because a node failed to readd. Better to just report it and move on.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoOffline node when adding it to a merged cluster
Guido Trotter [Fri, 19 Aug 2011 11:20:29 +0000 (12:20 +0100)]
Offline node when adding it to a merged cluster

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoBump version to 2.5.0~beta2
Michael Hanselmann [Fri, 19 Aug 2011 14:44:11 +0000 (16:44 +0200)]
Bump version to 2.5.0~beta2

Also update NEWS file.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agosphinx_ext: workaround epydoc warning
Iustin Pop [Fri, 19 Aug 2011 14:48:26 +0000 (16:48 +0200)]
sphinx_ext: workaround epydoc warning

Similar to commit c29e35f, this works around epydoc breakage by
aliasing the module. Makes 'apidoc' pass again on my machine.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agocheck-news: Show per-file line number
Michael Hanselmann [Fri, 19 Aug 2011 14:34:08 +0000 (16:34 +0200)]
check-news: Show per-file line number

… not the global line number.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoUnify some file headers
Michael Hanselmann [Fri, 19 Aug 2011 14:33:48 +0000 (16:33 +0200)]
Unify some file headers

Remove unnecessary commas, add empty lines where necessary to make them
consistent.

I'm working on a script to check this, but it's not yet ready.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoMakefile: Add design-ovf-support to list of doc files
Michael Hanselmann [Fri, 19 Aug 2011 14:31:41 +0000 (16:31 +0200)]
Makefile: Add design-ovf-support to list of doc files

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoensure-dirs: Fix epydoc error
Michael Hanselmann [Fri, 19 Aug 2011 12:41:53 +0000 (14:41 +0200)]
ensure-dirs: Fix epydoc error

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>