ganeti-local
10 years ago(2.11) Make BlockDev subclasses adhere to new interface
Klaus Aehlig [Mon, 3 Feb 2014 10:53:40 +0000 (11:53 +0100)]
(2.11) Make BlockDev subclasses adhere to new interface

In commit 702c3270 two new parameters were added to the
constructor of BlockDev. Make the subclassess accept these
additional parameters as well.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

10 years ago(2.11) Make disk.name and disk.uuid available in bdev
Dimitris Aragiorgis [Fri, 31 Jan 2014 15:36:55 +0000 (17:36 +0200)]
(2.11) Make disk.name and disk.uuid available in bdev

Until now Disk name and uuid was not available on bdev level.
In case of ExtStorage, this info is useful, and may be for other
templates in the future too.

This patch treats the name and uuid object slots just like the size
one and passes them to BlockDev.__init__() and to BlockDev.Create().

The ExtStrorage interface exports these options to scripts via the
VOL_CNAME and VOL_UUID environment variables.

This fixes Issue 696.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years ago(2.13) kvm: Add migration capabilities as an hvparam
Dimitris Aragiorgis [Fri, 21 Mar 2014 10:16:10 +0000 (12:16 +0200)]
(2.13) kvm: Add migration capabilities as an hvparam

Latest QEMU versions support various migration capabilities. Each
can be enabled/disabled with 'migrate_set_capability' monitor
command.

Version 1.7.0 defines x-rdma-pin-all, auto-converge, zero-blocks,
and xbzrle migration capabilities.

Since migration capabilities are more than one, and because hvparams
accept only strings/integers and not dicts we decide to provide
the capabilities that should be on via a ":" separated string.

In other words one can use the following to enable xbzrle and
auto-converge:

-H kvm:migration_caps=xbzrle:auto-converge

IMPORTANT: xbzrle may result to BSOD for instances running
Windows 2008r8 on drbd.

Update man page of gnt-instance to include the new hvparam.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years ago(2.8r) Workaround for Issue 621
Dimitris Aragiorgis [Mon, 25 Nov 2013 16:25:08 +0000 (18:25 +0200)]
(2.8r) Workaround for Issue 621

Upon LUNetworkDisconnect() and LUNetworkConnect() try to acquire
all cluster's instances.

By that _LS_ACQUIRE_ALL acquire mode is set and not
_LS_ACQUIRE_EXACT and thus the deleted lock does cause any problem.

NOTE: This workaround is not merged upstream. They prefer to have
one opcode fail and make the end user retry, rather than have a
greedy way that locks all instances to resolve this. Since synnefo
does not use nodegroups, locking all instances is the same with
locking instances on default nodegroup.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

10 years agoAdd a test for parsing version strings
Klaus Aehlig [Tue, 29 Apr 2014 11:43:35 +0000 (13:43 +0200)]
Add a test for parsing version strings

...even in the presence of patch levels.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

10 years agoSet correct Ganeti version on setup commands
Klaus Aehlig [Tue, 29 Apr 2014 09:13:42 +0000 (11:13 +0200)]
Set correct Ganeti version on setup commands

When asked to execute a setup command, prefix it with
a command sequence to test for the existence of the
needed Ganeti version and switching to it.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

10 years agoAdd a utility to combine shell commands
Klaus Aehlig [Mon, 28 Apr 2014 16:20:45 +0000 (18:20 +0200)]
Add a utility to combine shell commands

Add a function that combines individual shell commands into
a single command (calling the standard shell) that executes
the given commands in sequence while they succeed.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

10 years agoAdd design doc for performance tests
Thomas Thrainer [Wed, 16 Apr 2014 12:40:21 +0000 (14:40 +0200)]
Add design doc for performance tests

This design doc describes which tests are added in order to test the
performance of Ganeti, specifically when handling multiple jobs in
parallel.

Note that this design doc is submitted to stable-2.10 so performance
changes over different Ganeti versions can be captured.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

10 years agoMerge branch 'stable-2.9' into stable-2.10
Klaus Aehlig [Fri, 25 Apr 2014 14:41:33 +0000 (16:41 +0200)]
Merge branch 'stable-2.9' into stable-2.10

* stable-2.9
  If Automake version > 1.11, force serial tests

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoIf Automake version > 1.11, force serial tests
Petr Pudlak [Fri, 25 Apr 2014 13:53:33 +0000 (15:53 +0200)]
If Automake version > 1.11, force serial tests

This fixes broken compilation on Debian Jessie (#802).
See also http://stackoverflow.com/questions/15820844/

Thanks to Apollon Oikonomopoulos for finding the solution
and Klaus Aehlig for helping to do it conditionally.

Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix failed DRBD disk creation cleanup
Hrvoje Ribicic [Thu, 24 Apr 2014 16:53:10 +0000 (16:53 +0000)]
Fix failed DRBD disk creation cleanup

When creating a DRBD disk, Ganeti reserves minor numbers on a per-node
basis. In case of a failed disk creation, these reservations should be
released. During the name/uuid refactoring, the invocation of the
function that releases the minors was not updated, resulting in no
minors being released in case of a DRBD disk creation failure.
Ganeti's verification utilities catch this error and rightly complain.
This patch fixes the issue by providing the UUID and not the name.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoFix lint errors introduced during cherry-pick
Thomas Thrainer [Wed, 23 Apr 2014 07:25:58 +0000 (09:25 +0200)]
Fix lint errors introduced during cherry-pick

Calm a few lint errors introduced during cherry-picking code in
qa_job_utils.py. The fixes were intentionally made in a way which should
produce merge conflicts later on, so it's not forgotten to undo them.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoHooking up verification for shared file storage
Helga Velroyen [Tue, 22 Apr 2014 11:00:35 +0000 (13:00 +0200)]
Hooking up verification for shared file storage

As for the cluster modify, it was also forgotten to
hook up the verification of the shared file storage
paths despite all infrastructure was done already.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix --shared-file-storage-dir option of gnt-cluster modify
Helga Velroyen [Tue, 22 Apr 2014 10:51:07 +0000 (12:51 +0200)]
Fix --shared-file-storage-dir option of gnt-cluster modify

While all infrastructure to make shared-file storage
runtime-configurable was already submitted, the actual
setting of the path was forgotten. This patch fixes it.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoClarify default setting of 'metavg'
Helga Velroyen [Tue, 22 Apr 2014 11:23:50 +0000 (13:23 +0200)]
Clarify default setting of 'metavg'

This fixes issue 810, suggesting to clarify where the
default for 'metavg' comes from.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoFix invocation of GetCommandOutput in QA
Thomas Thrainer [Thu, 17 Apr 2014 08:59:34 +0000 (10:59 +0200)]
Fix invocation of GetCommandOutput in QA

The cherry-picked function _GetOutputFromMaster() calls
GetCommandOutput() with parameters only present in newer Ganeti
branches. Remove those parameters as they cause errors in stable-2.10.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoClean up RunWithLocks
Thomas Thrainer [Wed, 16 Apr 2014 15:07:30 +0000 (17:07 +0200)]
Clean up RunWithLocks

This patch cleans RunWithLocks up a little bit by reducing the number
of delay function terminations, and using the QAThread class to ensure
exceptions are thrown at the right time and in the right place.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

(cherry picked from commit 9558c2a4fc9eee309d56a6a84cc2a5935054dd1e)

10 years agoAdd an exception-trapping thread class
Thomas Thrainer [Wed, 16 Apr 2014 15:07:09 +0000 (17:07 +0200)]
Add an exception-trapping thread class

To have better control over threads, this patch adds a helper Thread
subclass which captures any exceptions occurring for later use.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

(cherry picked from commit e677d5e8e1c0ea7ef24e78f9ae842c9371449a77)

10 years agoWait for delay to provide interruption information
Thomas Thrainer [Wed, 16 Apr 2014 15:06:50 +0000 (17:06 +0200)]
Wait for delay to provide interruption information

The RunWithLocks test assumed that gnt-debug delay would have the info
needed for interruption ready immediately after being run, and in some
situations this is not the case. This patch makes the test more patient
and forgiving by retrying a number of times.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

(cherry picked from commit fbab1c76fbf3e84aeb82ed28be7d30a491de3718)

10 years agoAdd an expected block option to RunWithLocks
Thomas Thrainer [Wed, 16 Apr 2014 15:06:19 +0000 (17:06 +0200)]
Add an expected block option to RunWithLocks

To compensate for the cases where a QA test is supposed to block when
a lock is present, add an additional option showing whether blocking is
supposed to happen or not.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

(cherry picked from commit 57efdaf53a4d40a39befaa7e9a5ce9ff72063523)

Conflicts:
qa/qa_rapi.py (didn't backport changes to this file)

10 years agoTrack if a QA test was blocked by locks
Thomas Thrainer [Wed, 16 Apr 2014 15:05:46 +0000 (17:05 +0200)]
Track if a QA test was blocked by locks

This patch adds threading to the RunWithTests function, allowing one
thread to execute the QA test, and the other to monitor if it is being
blocked by locks set up during the test. If it is, terminate the
blocking job, and let the QA continue, reporting the test failure at
the very end.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

(cherry picked from commit 34c5ec6c78aa164eebb4ad6cfc14b38e81aad8ec)

10 years agoAdd a RunWithLocks QA utility function
Thomas Thrainer [Wed, 16 Apr 2014 15:04:54 +0000 (17:04 +0200)]
Add a RunWithLocks QA utility function

This patch adds a QA utility function that acquires a set of locks, and
attempts to run a given function with the locks in place. Should the
given function block, this function does not detect this - later
patches will address the issue.

An example of its use is provided by having the move-instance test
modified to use it.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

(cherry picked from commit 343c9ed28a48e0056cade771046fdc6b046aed7d)

Conflicts:
qa/qa_rapi.py (didn't backport changes to this file)

10 years agoMerge branch 'stable-2.9' into stable-2.10
Klaus Aehlig [Tue, 15 Apr 2014 16:11:35 +0000 (18:11 +0200)]
Merge branch 'stable-2.9' into stable-2.10

* stable-2.9
  Set exclusion tags correctly in requested instance
  Export extractExTags and updateExclTags
  Document spindles in the hbal man page
  Sample logrotate conf breaks permissions with split users

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose A. Lopes <jabolopes@google.com>

10 years agoSet exclusion tags correctly in requested instance
Klaus Aehlig [Tue, 15 Apr 2014 14:49:51 +0000 (16:49 +0200)]
Set exclusion tags correctly in requested instance

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>

10 years agoExport extractExTags and updateExclTags
Klaus Aehlig [Tue, 15 Apr 2014 14:00:22 +0000 (16:00 +0200)]
Export extractExTags and updateExclTags

...from the htools Loader. These functions are needed when
parsing the requested instance of an allocator request.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>

10 years agoFix 'gnt-cluster' and 'gnt-node list-storage' outputs
Jose A. Lopes [Tue, 15 Apr 2014 11:13:45 +0000 (13:13 +0200)]
Fix 'gnt-cluster' and 'gnt-node list-storage' outputs

* Update table for 'gnt-node list-storage'
* Add newline between description and the actual command in 'gnt-cluster version'

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoDocument spindles in the hbal man page
Klaus Aehlig [Mon, 14 Apr 2014 15:26:59 +0000 (17:26 +0200)]
Document spindles in the hbal man page

When spindles were introduced as a resource, they were also
used in the computation of the cluster metric. Document this.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Jose Lopes <jabolopes@google.com>

10 years agoPostpone 2.10.3 release to Wednesday, 16th
Thomas Thrainer [Mon, 14 Apr 2014 13:19:19 +0000 (15:19 +0200)]
Postpone 2.10.3 release to Wednesday, 16th

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoSample logrotate conf breaks permissions with split users
Jose A. Lopes [Mon, 14 Apr 2014 12:52:34 +0000 (14:52 +0200)]
Sample logrotate conf breaks permissions with split users

The sample logrotate configuration file
(doc/examples/ganeti.logrotate) contains the following line

  create 640 root root

which is fine if Ganeti if configured without split users.  However,
this will change permissions and ownership of log files if Ganeti is
configured with split users enabled.  By removing this line, logrotate
will preserve the permissions of the logfiles when rotating the logs.

This fixes issue 789.

Signed-off-by: Jose A. Lopes <jabolopes@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

10 years agoRevision bump for 2.10.3
Thomas Thrainer [Thu, 10 Apr 2014 08:54:26 +0000 (10:54 +0200)]
Revision bump for 2.10.3

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoUpdate NEWS file for 2.10.3
Thomas Thrainer [Thu, 10 Apr 2014 08:53:19 +0000 (10:53 +0200)]
Update NEWS file for 2.10.3

Set the release date to Monday, April 14th.
Mention changes made since 2.10.2.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoWarn in UPGRADE about not tar'ing exported insts
Thomas Thrainer [Thu, 10 Apr 2014 10:35:59 +0000 (12:35 +0200)]
Warn in UPGRADE about not tar'ing exported insts

The /var/lib/ganeti directory contains per default also the export
directory, which holds exported instances. Warn in UPGRADE in the backup
step about (potentially) excluding those exports from the backup.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix non-running test and remove custom_nicparams rename
Hrvoje Ribicic [Wed, 9 Apr 2014 16:15:06 +0000 (16:15 +0000)]
Fix non-running test and remove custom_nicparams rename

Due to a missing base class, the test that was supposed to check if
RAPI instance parameter renames during modifications are working did
not execute. As the instances are not covered by the QA tests, the
tests failed to show that custom nicparams cannot actually be set
through RAPI at the time. Given that the instance interface is
asymmetric beyond simple repairs, this is fine in 2.10. This patch
sets the test to execute, removes the setting of custom_nicparams in
the test, and removes the renaming of the param in the RAPI request.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAccount for NODE_RES lock in opportunistic locking
Hrvoje Ribicic [Tue, 8 Apr 2014 11:33:53 +0000 (11:33 +0000)]
Account for NODE_RES lock in opportunistic locking

This patch extends the opportunistic locking to take both the
NODE_RES and NODE locks into account when selecting nodes to be used
by the iallocator.

Signed-off-by: Gerard Oskamp <gjo@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoFix request flooding of noded during disk sync
Thomas Thrainer [Tue, 8 Apr 2014 08:15:36 +0000 (10:15 +0200)]
Fix request flooding of noded during disk sync

If a user manually pauses the DRBD sync, Ganeti started to poll the node
daemon without any waiting between request. This caused heavy load on
the node. This patch fixes this by waiting at least 5 secondes between
two polls if no sensible estimate for the remaining sync time could be
made.

Fixes issue 792

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoMerge branch 'stable-2.9' into stable-2.10
Hrvoje Ribicic [Tue, 8 Apr 2014 10:54:54 +0000 (12:54 +0200)]
Merge branch 'stable-2.9' into stable-2.10

* stable-2.9
  Allow QA asserts to produce more messages
  Add messages about skipped QA disk template tests
  Fix list-drbd QA test
  Update installation guide wrt to DRBD version
  Update NEWS for 2.9.6
  Revision bump for 2.9.6

Conflicts:
NEWS - Combined both news files
configure.ac - Took the 2.10 version numbers

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoRevision bump for 2.9.6
Klaus Aehlig [Mon, 7 Apr 2014 10:48:01 +0000 (12:48 +0200)]
Revision bump for 2.9.6

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoUpdate NEWS for 2.9.6
Klaus Aehlig [Mon, 7 Apr 2014 10:47:44 +0000 (12:47 +0200)]
Update NEWS for 2.9.6

Describe all the changes to Ganeti made since the
2.9.5 release. Also set the release date.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoUpdate installation guide wrt to DRBD version
Helga Velroyen [Fri, 4 Apr 2014 10:58:57 +0000 (12:58 +0200)]
Update installation guide wrt to DRBD version

This patch updates the supported DRBD version number to
8.4.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoFix list-drbd QA test
Hrvoje Ribicic [Sun, 30 Mar 2014 17:08:07 +0000 (19:08 +0200)]
Fix list-drbd QA test

The list-drbd QA test assumed falsely that no instance has more than
one disk. This can happen, and this patch accounts for it.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAdd messages about skipped QA disk template tests
Hrvoje Ribicic [Thu, 3 Apr 2014 11:14:27 +0000 (11:14 +0000)]
Add messages about skipped QA disk template tests

When disk templates were ignored in the QA, no messages were emitted,
in contrast to pretty much all tests. To make it easier to see why
a test was not executed, this patch performs a minor refactoring and
adds some output for the templates.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAllow QA asserts to produce more messages
Hrvoje Ribicic [Thu, 3 Apr 2014 11:11:56 +0000 (11:11 +0000)]
Allow QA asserts to produce more messages

This patch adds a tiny helper function that allows error messages
output by the QA asserts to be prefixed with whatever the user
supplies.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoKVM: use running HVPs to calc blockdev options
Apollon Oikonomopoulos [Fri, 28 Mar 2014 16:07:53 +0000 (18:07 +0200)]
KVM: use running HVPs to calc blockdev options

Commit 0fe22ad2 moved the call to _GenerateKVMBlockDevicesOptions() from
_GenerateKVMRuntime() to _ExecuteKvmRuntime. However, while in
_GenerateKVMRuntime() there is only one set of HVPs, those of the
instance's configuration, in _ExecuteKVMRuntime there are two sets of
HVPs:

  - The instance's configured HVPs
  - The HVPs the instance used when it was started

Currently, _GenerateKVMBlockDevicesOptions() uses the first set of HVPs
only, meaning that it will always read the configured HVPs. Since
_ExecuteKVMRuntime() is also called at migration time, it should use the
instance's running HVPs, otherwise migration while fail.

The following scenario will lead to a crash on migration:

 1. Start the instance (assuming 'paravirtual' disk_type)
 2. gnt-instance modify -H disk_type=scsi <instance_name>
 3. gnt-instance migrate <instance_name>

Step 3 will start the instance on the remote node with all disks
configured as 'scsi' and qemu will crash post-migration.

We fix this by making sure _GenerateKVMBlockDevicesOptions gets the
running HVPs as well.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoKVM: reserve a PCI slot for the SCSI controller
Apollon Oikonomopoulos [Fri, 28 Mar 2014 18:29:17 +0000 (20:29 +0200)]
KVM: reserve a PCI slot for the SCSI controller

Currently instances with disk_type=scsi are broken, because the SCSI
controller uses a PCI slot not accounted for in the PCI assignment
logic. We reserve a throw-away slot just for that.

This is a temporary workaround and will be reverted during the upcoming
refactoring.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoCheck for LVM-based verification results only when enabled
Helga Velroyen [Tue, 1 Apr 2014 08:47:34 +0000 (10:47 +0200)]
Check for LVM-based verification results only when enabled

This patch fixes a little glitch in 'gnt-cluster verify'.
If LVM-based storage was disabled, it would still check
LVM-related verification results and print a confusing
error message.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix "existing" typos
Helga Velroyen [Tue, 1 Apr 2014 08:28:14 +0000 (10:28 +0200)]
Fix "existing" typos

This patch fixes the wording of a couple of messages,
including two typos of the word 'existing'.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoFix output of gnt-instance info after migration
Thomas Thrainer [Tue, 1 Apr 2014 07:41:43 +0000 (09:41 +0200)]
Fix output of gnt-instance info after migration

After migrating a DRBD based instance, the output of gnt-instance info
was wrong wrt. DRBD minors. This patch fixes the output in such cases.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoVerify configuration version number before parsing
Klaus Aehlig [Mon, 31 Mar 2014 12:11:04 +0000 (14:11 +0200)]
Verify configuration version number before parsing

As the attempt to convert the dict used as json representation
of the configuration into a configuration object already makes
assumptions about the internal representation, verify the version
before such an attempt. Fixes issue 783.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoMerge branch 'stable-2.9' into stable-2.10
Hrvoje Ribicic [Thu, 27 Mar 2014 16:19:45 +0000 (16:19 +0000)]
Merge branch 'stable-2.9' into stable-2.10

* stable-2.9
  Fix failing gnt-node list-drbd command

* stable-2.8
  Add reason parameter to RAPI client functions

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

Conflicts:
lib/rapi/client.py: Add both parameters

10 years agoMerge branch 'stable-2.8' into stable-2.9
Hrvoje Ribicic [Thu, 27 Mar 2014 16:01:42 +0000 (17:01 +0100)]
Merge branch 'stable-2.8' into stable-2.9

* stable-2.8
  Add reason parameter to RAPI client functions

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix failing gnt-node list-drbd command
Hrvoje Ribicic [Thu, 27 Mar 2014 11:37:36 +0000 (11:37 +0000)]
Fix failing gnt-node list-drbd command

The UUID/name switch avoided this particular bit of code, and as a
result the list-drbd command failed as it tried to compare UUIDs and
names. This patch fixes the retrieval, converts the newly returned
UUIDs to names, and modifies the QA to the results and not only the
invocation are checked.

Signed-off-by: Gerard Oskamp <gjo@google.com>
Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

10 years agoFix specification of TIDiskParams
Klaus Aehlig [Mon, 3 Feb 2014 16:50:11 +0000 (17:50 +0100)]
Fix specification of TIDiskParams

Commit 580b1fdd incorrectly assumes that disk parameters are
just the standard ones, whereas the man page explicitly states
that additional parameters can be passed as well, if they make
sense for the chosen storage type. Fix this.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

Cherry-picked from b26a275a0. Fixes issue 779.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoAdd unittests for instance modify parameter renaming
Hrvoje Ribicic [Wed, 26 Mar 2014 10:43:59 +0000 (10:43 +0000)]
Add unittests for instance modify parameter renaming

The get/put QA test could be used for instances as well, but unlike
other objects, instances have a very large number of discrepancies and
missing fields. To avoid enumerating every discrepancy and testing
almost nothing, only a unit test is used to verify the last patch.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoAdd renaming of instance custom params
Hrvoje Ribicic [Tue, 25 Mar 2014 14:28:44 +0000 (14:28 +0000)]
Add renaming of instance custom params

Much like the groups before, this patch allows custom_* params to be
submitted under the same name they can be retrieved as in the info
call.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoAdd RAPI symmetry tests for groups
Hrvoje Ribicic [Mon, 24 Mar 2014 19:57:05 +0000 (19:57 +0000)]
Add RAPI symmetry tests for groups

This patch invokes the RAPI symmetry tests for groups.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoExtend RAPI symmetry tests with RAPI-only aliases
Hrvoje Ribicic [Mon, 24 Mar 2014 19:53:36 +0000 (19:53 +0000)]
Extend RAPI symmetry tests with RAPI-only aliases

This patch allows users to specify specific parameter aliases enabled
by RAPI, and test whether their value can be retrieved and set.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoAdd test for group custom parameter renaming
Hrvoje Ribicic [Tue, 25 Mar 2014 15:19:32 +0000 (15:19 +0000)]
Add test for group custom parameter renaming

This patch introduces a simple test checking if a custom_* parameter is
renamed and passed to the opcode correctly.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoAdd renaming of group custom ndparams, ipolicy, diskparams
Hrvoje Ribicic [Mon, 24 Mar 2014 19:49:37 +0000 (19:49 +0000)]
Add renaming of group custom ndparams, ipolicy, diskparams

This patch adds the ability to set the group-specific parameters in the
same way they are described when returned by the info command - with
the "custom_" prefix.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoAdd the RAPI symmetry test for nodes
Hrvoje Ribicic [Mon, 24 Mar 2014 16:23:02 +0000 (16:23 +0000)]
Add the RAPI symmetry test for nodes

This patch adds the RAPI symmetry test for nodes.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoAdd aliases for nodes
Hrvoje Ribicic [Mon, 24 Mar 2014 16:21:35 +0000 (16:21 +0000)]
Add aliases for nodes

This patch adds a single alias for the secondary_ip property of the
node.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoAllow choice of HTTP method for modification
Hrvoje Ribicic [Mon, 24 Mar 2014 16:15:50 +0000 (17:15 +0100)]
Allow choice of HTTP method for modification

The original design of the RAPI symmetry test assumed that all RAPI
calls that modify parameters use the PUT method. This is not true in
the case of the node parameter modification method, and while that
itself should be addressed or at least examined, the test method has
to change to accomodate both PUT and POST requests.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoAdd cluster RAPI symmetry test
Hrvoje Ribicic [Mon, 24 Mar 2014 11:57:53 +0000 (11:57 +0000)]
Add cluster RAPI symmetry test

This patch adds the test for RAPI symmetry at the cluster level. There
are some fields that have not been exposed yet, and their absence was
noted.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoFix failing cluster query test
Hrvoje Ribicic [Tue, 25 Mar 2014 12:14:51 +0000 (12:14 +0000)]
Fix failing cluster query test

This patch makes a mock use a dictionary instead of an object, allowing
alias finding to work on it.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoAdd aliases for cluster parameters
Hrvoje Ribicic [Mon, 24 Mar 2014 15:15:42 +0000 (15:15 +0000)]
Add aliases for cluster parameters

This patch adds aliases for two cluster parameters.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoAdd support for value aliases to RAPI
Hrvoje Ribicic [Tue, 25 Mar 2014 17:46:41 +0000 (17:46 +0000)]
Add support for value aliases to RAPI

This patch extends the metaclass used to generate RAPI handlers to
allow creating aliases of certain values returned by GET methods.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoProvide tests for GET/PUT symmetry
Hrvoje Ribicic [Mon, 24 Mar 2014 10:06:32 +0000 (11:06 +0100)]
Provide tests for GET/PUT symmetry

The RAPI should allow all the parameters of objects to be gotten and
set under the same names. This patch adds a test that checks if this is
the case by using the underlying opcode arguments.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoSort imports
Hrvoje Ribicic [Mon, 24 Mar 2014 10:26:36 +0000 (10:26 +0000)]
Sort imports

This patch does some housecleaning and sorts imports.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoAdd reason parameter to RAPI client functions
Michele Tartara [Wed, 26 Mar 2014 13:20:28 +0000 (14:20 +0100)]
Add reason parameter to RAPI client functions

Only the functions for starting, stopping and rebooting a VM had a reason
parameter. Now, all the RAPI client functions generating opcodes do.

Also, one test is expanded to verify that a RAPI request with both body and
query supports the reason parameter properly.

Fixes Issue 776.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoAlso consider filter fields for deciding if using live data
Klaus Aehlig [Tue, 7 Jan 2014 17:27:37 +0000 (18:27 +0100)]
Also consider filter fields for deciding if using live data

If the query fields don't require live data, we use the shortcut
and don't request live data. However, we cannot take this shortcut
if the fields the filter depends on requires live data.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

Cherry-picked from a8551d9c.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoDocument the python-fdsend dependency
Apollon Oikonomopoulos [Wed, 26 Mar 2014 09:26:25 +0000 (11:26 +0200)]
Document the python-fdsend dependency

KVM NIC hotplugging requires python-fdsend to be installed, but this
is only reported in the hotplug design document. We add mentions in
INSTALL and NEWS.

Signed-off-by: Apollon Oikonomopoulos <apoikos@gmail.com>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoMerge branch 'stable-2.9' into stable-2.10
Klaus Aehlig [Mon, 24 Mar 2014 13:28:38 +0000 (14:28 +0100)]
Merge branch 'stable-2.9' into stable-2.10

* stable-2.9
  Make watcher submit queries low priority

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

10 years agoMake watcher submit queries low priority
Klaus Aehlig [Mon, 24 Mar 2014 12:37:41 +0000 (13:37 +0100)]
Make watcher submit queries low priority

Make the watcher collect its data using low-priority jobs,
to avoid blocking user/admin jobs. Note that repair jobs are
still submitted normal priority. Fixes issue 772.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>

10 years agoBump version to 2.10.2
Thomas Thrainer [Thu, 20 Mar 2014 09:28:19 +0000 (10:28 +0100)]
Bump version to 2.10.2

Change the release version to 2.10.2 in configure.ac.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoPrepare NEWS file for 2.10.2
Thomas Thrainer [Thu, 20 Mar 2014 09:26:47 +0000 (10:26 +0100)]
Prepare NEWS file for 2.10.2

Mention all relevant changes / fixes which go into this release.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoAllow releases scheduled 5 days in advance
Thomas Thrainer [Thu, 20 Mar 2014 09:24:32 +0000 (10:24 +0100)]
Allow releases scheduled 5 days in advance

With the really slow QA's it makes sense to schedule releases more than
3 days in advance, like in this case where the release on Monday is
scheduled on Thursday.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoMerge branch 'stable-2.9' into stable-2.10
Thomas Thrainer [Thu, 20 Mar 2014 09:01:48 +0000 (10:01 +0100)]
Merge branch 'stable-2.9' into stable-2.10

* stable-2.8
  Include qa/patch in Makefile
  Handle empty patches better
  Move message formatting functions to separate file
  Add optional ordering of QA patch files
  Allow multiple QA patches
  Refactor current patching code

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoMerge branch 'stable-2.8' into stable-2.9
Thomas Thrainer [Thu, 20 Mar 2014 08:35:52 +0000 (09:35 +0100)]
Merge branch 'stable-2.8' into stable-2.9

* stable-2.8
  Include qa/patch in Makefile
  Handle empty patches better
  Move message formatting functions to separate file
  Add optional ordering of QA patch files
  Allow multiple QA patches
  Refactor current patching code

Conflicts:
Makefile.am (include all added files)
qa/qa_cluster.py (trivial)

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoInclude qa/patch in Makefile
Thomas Thrainer [Thu, 20 Mar 2014 07:54:02 +0000 (08:54 +0100)]
Include qa/patch in Makefile

Fix the build by including the qa/patch directory in Makefile.am.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoHandle empty patches better
Hrvoje Ribicic [Wed, 19 Mar 2014 11:40:43 +0000 (11:40 +0000)]
Handle empty patches better

The previous patch loading utilities omitted empty patches, as they
were thought to be of no significance, and when no patches were used,
the import and therefore dependency should not be used. If a user has
added an empty patch file, and made an entry in the order file, the QA
would treat this as an error as it had no means of differentiating
between a patch not present and an empty patch.

This patch fixes the solution by better handling empty patches, and
logging warnings when they are encountered.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMove message formatting functions to separate file
Hrvoje Ribicic [Wed, 19 Mar 2014 11:37:29 +0000 (11:37 +0000)]
Move message formatting functions to separate file

The formatting functions in qa_utils.py cannot be used by modules
imported there, such as qa_config. This patch factors the function
calls into a separate file. Also reorders imports in touched files.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoAdd optional ordering of QA patch files
Hrvoje Ribicic [Tue, 18 Mar 2014 20:46:06 +0000 (20:46 +0000)]
Add optional ordering of QA patch files

To explicitly specify the order of patches executed, the QA provides an
"order" file. It can contain names of patches that will be executed
first, and in the order listed, before all the other patches that still
follow an alphabetical order.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoAllow multiple QA patches
Hrvoje Ribicic [Tue, 18 Mar 2014 20:25:18 +0000 (20:25 +0000)]
Allow multiple QA patches

This patch allows support for multiple patches placed in the "patch"
directory, which are executed in alphabetical order.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoRefactor current patching code
Hrvoje Ribicic [Tue, 18 Mar 2014 19:57:46 +0000 (19:57 +0000)]
Refactor current patching code

* Refactors the current patch code to allow for multiple patches that
  can be applied, yet leaves only one for now.

* Rewords the message shown to the user in case the modules needed for
  patching are missing.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix conflict between virtio + spice or soundhw
Dimitris Aragiorgis [Mon, 17 Mar 2014 12:00:19 +0000 (14:00 +0200)]
Fix conflict between virtio + spice or soundhw

With regard to PCI slot occupied by a KVM instance we have
observed the following:

1) Slot 0 will always be Host bridge.
2) Slot 1 will always be ISA bridge.
3) Slot 2 will always be VGA controller (even with -display none).
4) If soundhw=hda|ac97|es1370 an extra PCI slot is occupied.
   This slot *MUST* be the No. 3.

5) Option '-balloon virtio' gets an extra PCI slot.
   Still it can take id, bus, and addr args and be placed anywhere

6) If spice is used instead of vnc we have:
   * No extra PCI slot gets occupied without vdagent
   * Otherwise we have the following extra optionsa [1]
     a) -device virtio-serial-pci
        (this can take id, bus, and addr args too)
     b) -device virtserialport,chardev=spicechannel0,...
     c) -chardev spicevmc,id=spicechannel0

This patch does the following:

1) Change _DEFAULT_PCI_RESERVATIONS to "1110...."
2) Move soundhw option early in the command line and if hda etc.
   reserve slot 3.
3) Add id, bus, and addr in balloon option and reserve next slot.
4) Add id, bus, and addr in -device virtio-serial-pci option and if
   passed reserve next slot.

[1] http://www.linux-kvm.org/page/SPICE

Fixes issue 757.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Jose A. Lopes <jabolopes@google.com>

10 years agoFix bitarray ops wrt PCI slots
Dimitris Aragiorgis [Mon, 17 Mar 2014 12:00:18 +0000 (14:00 +0200)]
Fix bitarray ops wrt PCI slots

Introduce new method `_GetFreeSlot()` responsible only for bitarray
operations. It fixes search in case of bitarray is either '0000..'
or '1111..'.

Use it instead of `_UpdatePCISlots()` and in `_GetFreePCISlot()`.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Jose A. Lopes <jabolopes@google.com>

10 years agoMerge branch 'stable-2.9' into stable-2.10
Klaus Aehlig [Fri, 7 Mar 2014 17:35:17 +0000 (18:35 +0100)]
Merge branch 'stable-2.9' into stable-2.10

* stable-2.9
  Fix error introduced during merge
  gnt-cluster copyfile: accept relative paths

* stable-2.8
  Improve RAPI detection of the watcher
  Add patching QA configuration files on buildbots
  Enable a timeout for instance shutdown
  Allow KVM commands to have a timeout
  Allow xen commands to have a timeout
  Fix wrong docstring

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix error introduced during merge
Michele Tartara [Fri, 7 Mar 2014 17:26:44 +0000 (17:26 +0000)]
Fix error introduced during merge

A parameter was lost while resolving a conflict in the signature of a function.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agognt-cluster copyfile: accept relative paths
Klaus Aehlig [Fri, 7 Mar 2014 17:11:28 +0000 (18:11 +0100)]
gnt-cluster copyfile: accept relative paths

If, on the command line, the argument to gnt-cluster copyfile is
a relative path, consider this a shorthand for the corresponding
absolute path.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoMerge branch 'origin/stable-2.8' into stable-2.9
Michele Tartara [Fri, 7 Mar 2014 15:28:54 +0000 (15:28 +0000)]
Merge branch 'origin/stable-2.8' into stable-2.9

* stable-2.8
  Improve RAPI detection of the watcher
  Add patching QA configuration files on buildbots
  Enable a timeout for instance shutdown
  Allow KVM commands to have a timeout
  Allow xen commands to have a timeout
  Fix wrong docstring

Conflicts:
lib/hypervisor/hv_xen.py
test/py/ganeti.hypervisor.hv_xen_unittest.py

Resolution:
  The conflicts were due to a new mandatory parameter hvparams being added
  (in 2.9) to the same functions that received the optional timeout parameter
  (in 2.8). They were resolved by keeping the hvparams in its place, and
  enqueuing the timeout parameter after it.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoImprove RAPI detection of the watcher
Michele Tartara [Fri, 7 Mar 2014 13:59:49 +0000 (13:59 +0000)]
Improve RAPI detection of the watcher

If the watcher is not allowed to access RAPI, it doesn't mean that it is dead
and needs to be restarted.

Fixes Issue 752.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

10 years agoAdd patching QA configuration files on buildbots
Petr Pudlak [Thu, 21 Nov 2013 14:06:41 +0000 (15:06 +0100)]
Add patching QA configuration files on buildbots

In order to work, it is necessary:
* Write a JSON Patch to file "qa/qa-patch.json" in a source repository.
  (And be careful not to commit it!) The file must conform to RFC6902
  and describes what changes should be done to the QA JSON
  configuration. This is simple as
   [
     { "op": "add",
       "path": "default",
       "value": false },
     { "op": "add",
       "path": "/tests/instance-add-file",
       "value": true }
   ]

* Install "jsonpatch" and "jsonpointer" modules on the machines QA is
  running on. Either using "easy_install" or as Debian packages using
  "pypi-install".

QA only loads the modules if the patch file is present and non-empty.
Therefore no changes to buildbots are needed, if the feature is not
used.

It's advisable to add a git pre-commit hook for the main repository to
prevent changes to "qa/patch.json", keeping it to "[]". Suggestion for
such a hook:

  # Exit code 1 if the patch file isn't just "[]":
  python -c 'import json, sys; \
    exit(0 if json.load(open("qa/qa-patch.json", "r")) == [] else 1)'

Locally it's possible to tell git not to track changes to the file at
all (see https://help.github.com/articles/ignoring-files):

  git update-index --assume-unchanged qa/qa-patch.json

Cherry-pick of e5398c3afde43e9165e96ab5cc8e0426519ad8ad from stable-2.11.

Signed-off-by: Petr Pudlak <pudlak@google.com>
Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Jose A. Lopes <jabolopes@google.com>

10 years agoEnable a timeout for instance shutdown
Michele Tartara [Fri, 7 Mar 2014 09:50:33 +0000 (10:50 +0100)]
Enable a timeout for instance shutdown

Add the timeout parameter to the StopInstance function of the hypervisor base
class and to all its implementations.

Also, change the tests as required by this change.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAllow KVM commands to have a timeout
Michele Tartara [Fri, 7 Mar 2014 09:47:38 +0000 (10:47 +0100)]
Allow KVM commands to have a timeout

Modify the function that sends commands to the KVM monitor so that it is
possible to specify an optional timeout after which the command is killed.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoAllow xen commands to have a timeout
Michele Tartara [Fri, 7 Mar 2014 09:46:02 +0000 (10:46 +0100)]
Allow xen commands to have a timeout

Modify the function that runs Xen commands so that it is possible to specify an
optional timeout after which the command is killed.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoFix wrong docstring
Michele Tartara [Fri, 7 Mar 2014 09:22:29 +0000 (10:22 +0100)]
Fix wrong docstring

Fields must be the final elements in an epytext string.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

10 years agoRevision bump for the 2.10.1 release
Thomas Thrainer [Tue, 4 Mar 2014 10:06:59 +0000 (11:06 +0100)]
Revision bump for the 2.10.1 release

Set the version to 2.10.1.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoUpdate NEWS file for 2.10.1
Thomas Thrainer [Tue, 4 Mar 2014 10:04:22 +0000 (11:04 +0100)]
Update NEWS file for 2.10.1

Set the release date to tomorrow and mentioned fixed bugs in the NEWS
file.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

10 years agoUse node UUIDs for executing LU hooks
Thomas Thrainer [Mon, 3 Mar 2014 14:57:12 +0000 (15:57 +0100)]
Use node UUIDs for executing LU hooks

LUNodeAdd, the only LU using a node name still, is changed to overwrite
PreparePostHookNodes() and use node UUIDs only as well.
This allows to remove the support for 3-tuples as results of
BuildHooksNodes() and removes the translation to node names.

Fixes issue 742.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoAdd PreparePostHookNodes to LUs
Thomas Thrainer [Mon, 3 Mar 2014 14:49:57 +0000 (15:49 +0100)]
Add PreparePostHookNodes to LUs

This method can be used to alter the list of node UUIDs on which post
hooks are executed. PreparePostHookNodes is called after Exec, so LUs
can use data only known after the execution of the LU.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

10 years agoFix error propagation in post-commit hooks
Michele Tartara [Mon, 3 Mar 2014 17:36:36 +0000 (18:36 +0100)]
Fix error propagation in post-commit hooks

An error in the post-commit hooks could not be propagated correctly and could
result in e.g. the return code of gnt-cluster verify to be 0 even in presence of
an error in its output.

Fixes Issue 744.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>