ganeti-local
12 years agohttp.client: Add nice name to requests
Michael Hanselmann [Tue, 27 Sep 2011 14:43:49 +0000 (16:43 +0200)]
http.client: Add nice name to requests

With this change a node name instead of the IP address can be shown for
pending RPC requests:
Name                              Pending
rpc/node18.example.com/test_delay thread:Jq1/Job692/TEST_DELAY

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

12 years agorpc/http: Show pending RPC requests in lock monitor
Michael Hanselmann [Tue, 27 Sep 2011 14:43:45 +0000 (16:43 +0200)]
rpc/http: Show pending RPC requests in lock monitor

Not all requests use an instance of RpcRunner yet and therefore won't
show up (only instances have access to the global Ganeti context).
Currently only the IP address is accessible. Another patch will add a
nicer name for requests.

Example output (gnt-debug locks -o name,pending):
Name                      Pending
rpc/192.0.2.18/test_delay thread:Jq12/Job683/TEST_DELAY

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

12 years agohttp.client: Factorize code interacting with cURL
Michael Hanselmann [Tue, 27 Sep 2011 13:15:41 +0000 (15:15 +0200)]
http.client: Factorize code interacting with cURL

This simplifies HttpClientPool.ProcessRequests significantly and will be
handy for showing pending RPC requests in the lock monitor.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@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 agoAdding qemu-img dependency to INSTALL
Agata Murawska [Tue, 27 Sep 2011 13:22:36 +0000 (15:22 +0200)]
Adding qemu-img dependency to INSTALL

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agohttp.client: Reduce performance impact by assertion
Michael Hanselmann [Wed, 14 Sep 2011 15:17:54 +0000 (17:17 +0200)]
http.client: Reduce performance impact by assertion

Call dict.values once instead of N times.

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

12 years agorpc: Overhaul client structure
Michael Hanselmann [Mon, 26 Sep 2011 14:07:12 +0000 (16:07 +0200)]
rpc: Overhaul client structure

- Clearly separate node name to IP address resolution into separate
  functions
- Simplified code structure (one code path instead of several)
- Fully unittested
- Preparation for more RPC improvements

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

12 years agorpc: Make compression function module-global
Michael Hanselmann [Mon, 26 Sep 2011 10:11:58 +0000 (12:11 +0200)]
rpc: Make compression function module-global

No need to keep it in the class.

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

12 years agoKeep only one global RPC runner in Ganeti context
Michael Hanselmann [Mon, 26 Sep 2011 10:05:55 +0000 (12:05 +0200)]
Keep only one global RPC runner in Ganeti context

Instead of having one RPC runner per mcpu processor this will keep only
one instance as part of the masterd-wide Ganeti context. Upcoming
patches will change the RPC runner to report pending requests to the
lock manager.

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

12 years agoUpdate INSTALL with ovfconverter requirements
Agata Murawska [Mon, 26 Sep 2011 15:00:23 +0000 (17:00 +0200)]
Update INSTALL with ovfconverter requirements

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoTemporaryFilesManager implementation
Agata Murawska [Thu, 22 Sep 2011 12:17:25 +0000 (14:17 +0200)]
TemporaryFilesManager implementation

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoExport: unittests
Agata Murawska [Mon, 12 Sep 2011 11:40:37 +0000 (13:40 +0200)]
Export: unittests

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoExport: documentation
Agata Murawska [Mon, 12 Sep 2011 11:40:01 +0000 (13:40 +0200)]
Export: documentation

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoExport: saving data to ovf file
Agata Murawska [Mon, 12 Sep 2011 11:40:24 +0000 (13:40 +0200)]
Export: saving data to ovf file

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoExport: parsing data from config file
Agata Murawska [Mon, 12 Sep 2011 11:17:28 +0000 (13:17 +0200)]
Export: parsing data from config file

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoExport: initial commit - manifest, ova creation etc
Agata Murawska [Mon, 12 Sep 2011 11:17:02 +0000 (13:17 +0200)]
Export: initial commit - manifest, ova creation etc

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoImport: unittests
Agata Murawska [Mon, 12 Sep 2011 08:47:44 +0000 (10:47 +0200)]
Import: unittests

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoImport: backend, hypervisor and os
Agata Murawska [Mon, 12 Sep 2011 08:46:53 +0000 (10:46 +0200)]
Import: backend, hypervisor and os

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoImport: networks
Agata Murawska [Mon, 12 Sep 2011 08:13:30 +0000 (10:13 +0200)]
Import: networks

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoImport: disk conversion
Agata Murawska [Mon, 12 Sep 2011 08:34:06 +0000 (10:34 +0200)]
Import: disk conversion

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoImport: reading ovf file
Agata Murawska [Mon, 12 Sep 2011 08:33:42 +0000 (10:33 +0200)]
Import: reading ovf file

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agoInitial commit for ovfconverter tool
Agata Murawska [Wed, 24 Aug 2011 14:28:41 +0000 (16:28 +0200)]
Initial commit for ovfconverter tool

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

12 years agodoc: sphinx config file changes
Iustin Pop [Mon, 19 Sep 2011 07:36:13 +0000 (16:36 +0900)]
doc: sphinx config file changes

I wanted to just enable another extension (the graphviz one), but then
I went and did a lot of changes:

- replaced ' with " for consistency with our style guide
- imported new settings (commented out) that current python-sphinx
  (1.0.7) generates when starting a new project; for the keys that are
  different in 0.6 and 1.0+, I left the 0.6 version until we bump our
  documented version
- enabled graphviz; needed for a design doc I'm currently working on
- updated copyright years
- changed list style from single-line to multi-line
- added coverage/ dir to exclude_trees

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

12 years agodoc: re-wrap design-oob to 72 chars
Iustin Pop [Mon, 19 Sep 2011 07:33:21 +0000 (16:33 +0900)]
doc: re-wrap design-oob to 72 chars

I started with just adding some :term:`SoW` and similar to design-oob,
but then I realised this was 80-chars wrapped, not 72-chars. So I went
and re-wrapped most of it, plus adding the glossary references.

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

12 years agodoc: glossary improvements
Iustin Pop [Mon, 19 Sep 2011 07:32:35 +0000 (16:32 +0900)]
doc: glossary improvements

These will be used to remove some inline definitions and replace them
with :term:`foo`.

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

12 years agoserializer: Add comment about simplejson vs. built-in json
Michael Hanselmann [Mon, 26 Sep 2011 09:47:30 +0000 (11:47 +0200)]
serializer: Add comment about simplejson vs. built-in json

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

12 years agoRevert "Fail if dictionary uses invalid keys" and "Support newer “json” module"
Michael Hanselmann [Mon, 26 Sep 2011 09:19:16 +0000 (11:19 +0200)]
Revert "Fail if dictionary uses invalid keys" and "Support newer “json” module"

This reverts commit fd0351aef246f5d36e641209429e2ec093d325f8 and
9869e771704ada62bab001e729c52a36525ef081. The built-in module is a lot
slower in Python 2.6.

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

12 years agoserializer: Fail if dictionary uses invalid keys
Michael Hanselmann [Fri, 23 Sep 2011 14:26:10 +0000 (16:26 +0200)]
serializer: Fail if dictionary uses invalid keys

JSON only supports a very restricted set of types for dictionary keys,
among them strings, booleans and “null”. Integers and floats are
converted to strings. Since this can cause a lot of confusion in Python,
this check raises an exception if a caller tries to use such types.

Since the pre-Python 2.6 “simplejson” module doesn't support overriding
the function where the conversion takes place this check can only be
done for the newer “json” module.

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

12 years agoserializer: Support newer “json” module
Michael Hanselmann [Fri, 23 Sep 2011 14:23:59 +0000 (16:23 +0200)]
serializer: Support newer “json” module

This module is included from Python 2.6 and is based on
simplejson.

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

12 years agohtools: man page improvements
Iustin Pop [Tue, 20 Sep 2011 08:29:20 +0000 (17:29 +0900)]
htools: man page improvements

This patch moves all the backend options into the main htools man
page, and it adds documentation for the -t option, which so far was
not documented w.r.t. the file structure.

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

12 years agohspace: add short forms for the group policy
Iustin Pop [Tue, 20 Sep 2011 08:29:04 +0000 (17:29 +0900)]
hspace: add short forms for the group policy

This adds a shortened versions of the allocation policies, as writing
out the whole name in the command line can become tedious.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoFix interaction between CPU pinning and KVM migration
Andrea Spadaccini [Wed, 21 Sep 2011 13:38:57 +0000 (14:38 +0100)]
Fix interaction between CPU pinning and KVM migration

CPU pinning requires the KVM hypervisor to start in the paused state, in
order to retrieve information, and immediately unpauses it.

This does not play well with live migration, as the unpausing was done
before the migration started and so the receiving kvm process left the
migrated instance in the stopped status.

This patch fixes this behavior, by not launching the KVM process in
stopped state while on the receiving side of a migration.

Also, the stopping is now done outside _ExecuteCpuAffinity.

Signed-off-by: Andrea Spadaccini <spadaccio@google.com>
Reviewed-by: Tsachy Shacham <tsachy@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 agohtools: add a MonadPlus instance for Result
Iustin Pop [Tue, 20 Sep 2011 08:28:49 +0000 (17:28 +0900)]
htools: add a MonadPlus instance for Result

This will be used to implement more easily 'choice' parsing of input
data, without resorting to syntax (case … of Bad _ -> …).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Agata Murawska <agatamurawska@google.com>

12 years agoMerge branch 'devel-2.5'
Andrea Spadaccini [Tue, 20 Sep 2011 15:50:00 +0000 (16:50 +0100)]
Merge branch 'devel-2.5'

* devel-2.5:
  Add tls_ciphers and use_vdagent options
  Updated man pages with new SPICE TLS options
  Implementation of TLS-protected SPICE connections
  Added SPICE TLS option and related cert paths
  Fix OS creation's error handling when pausing sync

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

12 years agoRAPI: Add resource to powercycle node
Michael Hanselmann [Fri, 16 Sep 2011 09:38:15 +0000 (11:38 +0200)]
RAPI: Add resource to powercycle node

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@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 agoFix two pylint errors
Andrea Spadaccini [Tue, 20 Sep 2011 09:28:01 +0000 (10:28 +0100)]
Fix two pylint errors

- hv_kvm.py: silence F0401, that is raised if pylint does not find the
  affinity module
- rlib2.py: change disable-msg to disable

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

12 years agoFix backend.MigrateInstance docs
Andrea Spadaccini [Mon, 19 Sep 2011 13:32:34 +0000 (14:32 +0100)]
Fix backend.MigrateInstance docs

The MigrateInstance function does not return anything, so the relevant
lines are removed from the documentation. Instead, the raised exception
is documented.

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

12 years agohv_kvm: bugfix
Tsachy Shacham [Fri, 16 Sep 2011 10:04:19 +0000 (12:04 +0200)]
hv_kvm: bugfix

Signed-off-by: Tsachy Shacham <tsachy@google.com>
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoImport: further doc updates
Agata Murawska [Thu, 15 Sep 2011 08:39:49 +0000 (10:39 +0200)]
Import: further doc updates

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

12 years agoRAPI: Add resource to recreate instance's disks
Michael Hanselmann [Thu, 15 Sep 2011 15:41:59 +0000 (17:41 +0200)]
RAPI: Add resource to recreate instance's disks

This was still missing from RAPI.

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

12 years agoAdding an updated design doc for the caching mechanism
René Nussbaumer [Thu, 15 Sep 2011 11:16:53 +0000 (13:16 +0200)]
Adding an updated design doc for the caching mechanism

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

12 years agohv_xen: fix use of CPU pinning constants
Tsachy Shacham [Thu, 15 Sep 2011 08:58:44 +0000 (10:58 +0200)]
hv_xen: fix use of CPU pinning constants

… to be consistent with hv_kvm

Signed-off-by: Tsachy Shacham <tsachy@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agohv_kvm: fix hardcoded KVM command string
Tsachy Shacham [Thu, 15 Sep 2011 08:49:51 +0000 (10:49 +0200)]
hv_kvm: fix hardcoded KVM command string

Signed-off-by: Tsachy Shacham <tsachy@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agohv_kvm: support for CPU pinning
Tsachy Shacham [Wed, 14 Sep 2011 15:48:01 +0000 (17:48 +0200)]
hv_kvm: support for CPU pinning

Signed-off-by: Tsachy Shacham <tsachy@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
[iustin@google.com: fixed some small code and style issues]
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoconstants: support for CPU pinning under KVM
Tsachy Shacham [Thu, 15 Sep 2011 08:32:34 +0000 (10:32 +0200)]
constants: support for CPU pinning under KVM

Signed-off-by: Tsachy Shacham <tsachy@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

12 years agoMerge branch 'devel-2.5'
Guido Trotter [Thu, 15 Sep 2011 13:10:00 +0000 (14:10 +0100)]
Merge branch 'devel-2.5'

* devel-2.5: (33 commits)
  htools: remove dead code
  hail: don't select the primary as new secondary
  hail: add an extra safety check in relocate
  Fix RAPI documentation for gnt-instance console
  Add SPICE compression and streaming options
  Add SPICE support to gnt-instance console
  Make KVM use the QXL vga driver with SPICE
  Use a loop to check SPICE parameters dependency
  import: Fix a logic error due to missing "not"
  import: Make sure the disk_dump path is in EXPORT_DIR
  Switch other commonprefix to IsBelowDir
  utils: Introduce IsBelowDir
  Fixed a typo in gnt_cluster.py
  Added password for SPICE sessions
  Draft implementation of QMP connection
  Pylint fixes for autogenerated files
  Version bump for 2.5.0~beta3
  Makefile: Use $(LN_S) instead of “ln -s”
  Fixes to errors/warnings raised by pylint 0.24
  PEP8 for QA
  ...

Conflicts:
Makefile.am
          - preserve both changes
lib/rapi/rlib2.py
          - keep master version

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

12 years agoMake affinity module optional
Iustin Pop [Thu, 15 Sep 2011 09:59:22 +0000 (11:59 +0200)]
Make affinity module optional

This was overlooked in the review, sorry.

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

12 years agoconfigure.ac: changes for CPU pinning
Tsachy Shacham [Wed, 14 Sep 2011 15:47:58 +0000 (17:47 +0200)]
configure.ac: changes for CPU pinning

Also added optional affinity Python package for CPU pinning under KVM
to the INSTALL doc.

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

12 years agodocs unittest: Add verification of opcodes covered by RAPI
Michael Hanselmann [Wed, 14 Sep 2011 11:10:58 +0000 (13:10 +0200)]
docs unittest: Add verification of opcodes covered by RAPI

All opcodes which are not yet covered or can't with the current design
(e.g. cluster initialization) are excluded. This test is added to the
docs unittest since here the code already has access to a list of all
RAPI resources and does more checks on them.

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

12 years agodocs unittest: Split into two separate test cases
Michael Hanselmann [Wed, 14 Sep 2011 10:31:14 +0000 (12:31 +0200)]
docs unittest: Split into two separate test cases

The RAPI and hooks documentation aren't related at all.

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

12 years agodocs unittest: Make _ReadDocFile a global function
Michael Hanselmann [Wed, 14 Sep 2011 10:23:36 +0000 (12:23 +0200)]
docs unittest: Make _ReadDocFile a global function

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

12 years agorlib2: Declare all opcodes and equivalents
Michael Hanselmann [Wed, 14 Sep 2011 10:20:30 +0000 (12:20 +0200)]
rlib2: Declare all opcodes and equivalents

By declaring all used opcodes or opcodes equivalent to the operations
executed in a resource we will be able to ensure all opcodes are covered
by RAPI (with some exceptions).

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

12 years agobaserlib: Function to retrieve opcodes used by handler
Michael Hanselmann [Wed, 14 Sep 2011 10:21:53 +0000 (12:21 +0200)]
baserlib: Function to retrieve opcodes used by handler

This will be used to verify opcodes used by RAPI.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@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 agoFix unittest breakage from commit 132cdb87159e
Michael Hanselmann [Tue, 13 Sep 2011 12:24:58 +0000 (14:24 +0200)]
Fix unittest breakage from commit 132cdb87159e

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

12 years agorapi: Re-add “/2” resource
Michael Hanselmann [Tue, 13 Sep 2011 10:53:15 +0000 (12:53 +0200)]
rapi: Re-add “/2” resource

Like “/”, it'll just return a JSON null.

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

12 years agoWrap long line in ganeti.rapi.rlib2_unittest.py
Michael Hanselmann [Tue, 13 Sep 2011 09:55:24 +0000 (11:55 +0200)]
Wrap long line in ganeti.rapi.rlib2_unittest.py

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

12 years agorlib2: Improve test for _ParseInstanceReinstallRequest
Michael Hanselmann [Fri, 9 Sep 2011 10:55:28 +0000 (12:55 +0200)]
rlib2: Improve test for _ParseInstanceReinstallRequest

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

12 years agorlib2: Add test for /2/info
Michael Hanselmann [Fri, 9 Sep 2011 10:45:20 +0000 (12:45 +0200)]
rlib2: Add test for /2/info

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

12 years agorlib2: Add tests for /, /version and /2/features
Michael Hanselmann [Fri, 9 Sep 2011 10:30:31 +0000 (12:30 +0200)]
rlib2: Add tests for /, /version and /2/features

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

12 years agorlib2: Convert /2/instances to OpcodeResource
Michael Hanselmann [Fri, 9 Sep 2011 10:16:38 +0000 (12:16 +0200)]
rlib2: Convert /2/instances to OpcodeResource

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

12 years agorlib2: Convert /2/*/tags to OpcodeResource
Michael Hanselmann [Fri, 9 Sep 2011 09:56:10 +0000 (11:56 +0200)]
rlib2: Convert /2/*/tags to OpcodeResource

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

12 years agorlib2: Convert /2/nodes/[node_name]/storage/repair to OpcodeResource
Michael Hanselmann [Fri, 9 Sep 2011 09:40:05 +0000 (11:40 +0200)]
rlib2: Convert /2/nodes/[node_name]/storage/repair to OpcodeResource

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

12 years agorlib2: Convert /2/nodes/[node_name]/storage/modify to OpcodeResource
Michael Hanselmann [Fri, 9 Sep 2011 09:36:51 +0000 (11:36 +0200)]
rlib2: Convert /2/nodes/[node_name]/storage/modify to OpcodeResource

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

12 years agorlib2: Convert /2/nodes/[node_name]/storage to OpcodeResource
Michael Hanselmann [Fri, 9 Sep 2011 09:26:31 +0000 (11:26 +0200)]
rlib2: Convert /2/nodes/[node_name]/storage to OpcodeResource

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

12 years agorlib2: Convert /2/groups/[group_name] to OpcodeResource
Michael Hanselmann [Fri, 9 Sep 2011 08:50:15 +0000 (10:50 +0200)]
rlib2: Convert /2/groups/[group_name] to OpcodeResource

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

12 years agorlib2: Convert /2/nodes/[node_name]/role to OpcodeResource
Michael Hanselmann [Fri, 9 Sep 2011 08:46:51 +0000 (10:46 +0200)]
rlib2: Convert /2/nodes/[node_name]/role to OpcodeResource

Also fix a typo in a constant name.

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

12 years agorlib2: Convert /2/instances/[inst]/disk/[idx]/grow to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 16:39:14 +0000 (18:39 +0200)]
rlib2: Convert /2/instances/[inst]/disk/[idx]/grow to OpcodeResource

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

12 years agorlib2: Convert /2/instances/[inst]/modify to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 16:34:25 +0000 (18:34 +0200)]
rlib2: Convert /2/instances/[inst]/modify to OpcodeResource

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

12 years agorlib2: Convert /2/instances/[inst]/rename to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 16:28:26 +0000 (18:28 +0200)]
rlib2: Convert /2/instances/[inst]/rename to OpcodeResource

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

12 years agorlib2: Convert /2/instances/[inst]/failover to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 16:23:21 +0000 (18:23 +0200)]
rlib2: Convert /2/instances/[inst]/failover to OpcodeResource

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

12 years agorlib2: Convert /2/instances/[inst]/migrate to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 16:20:51 +0000 (18:20 +0200)]
rlib2: Convert /2/instances/[inst]/migrate to OpcodeResource

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

12 years agorlib2: Convert /2/instances/[inst]/export to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 16:16:58 +0000 (18:16 +0200)]
rlib2: Convert /2/instances/[inst]/export to OpcodeResource

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

12 years agorlib2: Convert /2/instances/[inst]/prepare-export to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 15:54:47 +0000 (17:54 +0200)]
rlib2: Convert /2/instances/[inst]/prepare-export to OpcodeResource

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

12 years agorlib2: Convert /2/instances/[inst]/deactivate-disks to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 15:47:59 +0000 (17:47 +0200)]
rlib2: Convert /2/instances/[inst]/deactivate-disks to OpcodeResource

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

12 years agorlib2: Convert /2/instances/[inst]/activate-disks to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 15:42:07 +0000 (17:42 +0200)]
rlib2: Convert /2/instances/[inst]/activate-disks to OpcodeResource

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

12 years agorlib2: Convert /2/instances/[inst]/replace-disks to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 15:39:31 +0000 (17:39 +0200)]
rlib2: Convert /2/instances/[inst]/replace-disks to OpcodeResource

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

12 years agorlib2: Convert /2/instances/[inst]/shutdown to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 13:02:41 +0000 (15:02 +0200)]
rlib2: Convert /2/instances/[inst]/shutdown to OpcodeResource

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

12 years agorlib2: Convert /2/instances/[inst]/startup to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 13:00:28 +0000 (15:00 +0200)]
rlib2: Convert /2/instances/[inst]/startup to OpcodeResource

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

12 years agorlib2: Convert /2/instances/[inst]/reboot to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 12:56:44 +0000 (14:56 +0200)]
rlib2: Convert /2/instances/[inst]/reboot to OpcodeResource

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

12 years agorlib2: Convert /2/instances/[inst]/info to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 12:43:57 +0000 (14:43 +0200)]
rlib2: Convert /2/instances/[inst]/info to OpcodeResource

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

12 years agorlib2: Convert /2/instances/[inst] to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 12:40:31 +0000 (14:40 +0200)]
rlib2: Convert /2/instances/[inst] to OpcodeResource

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

12 years agorlib2: Convert /2/groups/[group_name]/assign-nodes to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 12:35:16 +0000 (14:35 +0200)]
rlib2: Convert /2/groups/[group_name]/assign-nodes to OpcodeResource

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

12 years agorlib2: Convert /2/groups/[group_name]/rename to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 12:29:37 +0000 (14:29 +0200)]
rlib2: Convert /2/groups/[group_name]/rename to OpcodeResource

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

12 years agorlib2: Convert /2/groups/[group_name]/modify to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 12:17:36 +0000 (14:17 +0200)]
rlib2: Convert /2/groups/[group_name]/modify to OpcodeResource

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

12 years agorlib2: Convert /2/groups to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 11:59:17 +0000 (13:59 +0200)]
rlib2: Convert /2/groups to OpcodeResource

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

12 years agorlib2: Convert /2/nodes/[node_name]/evacuate to OpcodeResource
Michael Hanselmann [Thu, 8 Sep 2011 11:49:08 +0000 (13:49 +0200)]
rlib2: Convert /2/nodes/[node_name]/evacuate to OpcodeResource

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