ganeti-local
11 years agoMerge branch 'devel-2.7'
Iustin Pop [Fri, 15 Feb 2013 11:53:30 +0000 (12:53 +0100)]
Merge branch 'devel-2.7'

* devel-2.7:
  Rename lib/objectutils to outils.py
  Fix typo in gnt-group manpage
  Fix wrong type in a docstring of the RAPI subsystem
  Finish the remote→restricted commands rename
  Enable use of the priority option in hbal
  Add CLI-level option to override the priority
  Add functions to parse CLI-level format of priorities
  Add a function to change an OpCode's priority
  Make hbal opcode annotation more generic
  Add unit tests for RADOSBLockDevice
  Fix rbd showmapped output parsing
  Change default xen root path to /dev/xvda1
  Removes check for conflicts from NetworkDisconnect
  If _UnlockedLookupNetwork() fails raise error
  Force conflicts check in LUNetworkDisconnect

Also updated objects.py with more outils renames.

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

11 years agoRevert "Disable live-RPC queries under split query"
Iustin Pop [Thu, 14 Feb 2013 12:39:18 +0000 (13:39 +0100)]
Revert "Disable live-RPC queries under split query"

This reverts commit fb251c2c4c582ec0d6c00a6f6c5e134ed5196e03. On the
master branch we want to continue to have them enabled.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoRename lib/objectutils to outils.py
Iustin Pop [Fri, 15 Feb 2013 09:29:47 +0000 (10:29 +0100)]
Rename lib/objectutils to outils.py

Back when this was introduced, I mentioned that it breaks heavily tab
completion (ob<TAB> doesn't work anymore), but at that moment I didn't
have a suggestion what to name it. I think outils is good and short
enough, and doesn't conflict with anything else, so here it goes.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoAdd hroller design to Makefile and design-drafts
Guido Trotter [Fri, 15 Feb 2013 09:32:10 +0000 (10:32 +0100)]
Add hroller design to Makefile and design-drafts

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

11 years agoHroller design doc
Guido Trotter [Fri, 8 Feb 2013 13:24:17 +0000 (14:24 +0100)]
Hroller design doc

Hroller in 2.7 was implemented (as an experiment) but never explicitly
designed. This design mentions the current functionality, and explains
the changes that will happen for the next release to support live
maintenance scheduling (rolling reboot).

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

11 years agoFix typo in gnt-group manpage
Ben Lipton [Wed, 13 Feb 2013 17:21:07 +0000 (12:21 -0500)]
Fix typo in gnt-group manpage

The --ipol-disk-templates parameter should actually be
--ipolicy-disk-templates.

Signed-off-by: Ben Lipton <ben.lipton@gmail.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix wrong type in a docstring of the RAPI subsystem
Michele Tartara [Tue, 12 Feb 2013 15:40:16 +0000 (15:40 +0000)]
Fix wrong type in a docstring of the RAPI subsystem

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoQA: Set disk template directly via instance object
Michael Hanselmann [Tue, 5 Feb 2013 16:43:34 +0000 (17:43 +0100)]
QA: Set disk template directly via instance object

Use a method on the instance object instead of going through
“qa_config.GetInstanceTemplate”. This provides for better encapsulation.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoRemove qa_config.GetInstanceNicMac
Michael Hanselmann [Tue, 5 Feb 2013 16:33:39 +0000 (17:33 +0100)]
Remove qa_config.GetInstanceNicMac

Call the wrapped instance method directly.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Use constants for disk templates
Michael Hanselmann [Tue, 5 Feb 2013 16:31:12 +0000 (17:31 +0100)]
QA: Use constants for disk templates

Disk template names shouldn't be hardcoded.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoFix a merge issue in 3c296f56
Bernardo Dal Seno [Tue, 12 Feb 2013 13:53:44 +0000 (14:53 +0100)]
Fix a merge issue in 3c296f56

Lines removed in devel-2.7 (250a9404) weren't removed in the merge with
master.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoFinish the remote→restricted commands rename
Iustin Pop [Fri, 8 Feb 2013 13:42:36 +0000 (14:42 +0100)]
Finish the remote→restricted commands rename

The documentation still points to /etc/ganeti/remote-commands,
although the code is already using restricted-command. Update the
documentation and a few docstrings accordingly.

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

11 years agoEnable use of the priority option in hbal
Iustin Pop [Fri, 8 Feb 2013 12:43:01 +0000 (13:43 +0100)]
Enable use of the priority option in hbal

This patch adds the option to hbal, and uses it to tweak the submitted
jobs. There are also two small shelltests for testing the parsing.

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

11 years agoAdd CLI-level option to override the priority
Iustin Pop [Fri, 8 Feb 2013 12:23:50 +0000 (13:23 +0100)]
Add CLI-level option to override the priority

This just defined the new priority, with the same name as the Python one.

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

11 years agoAdd functions to parse CLI-level format of priorities
Iustin Pop [Fri, 8 Feb 2013 12:14:26 +0000 (13:14 +0100)]
Add functions to parse CLI-level format of priorities

The current serialisation format for submit priorities is
integer-based, same as the opcode json serialisation. But for CLI
level, we need to support a string-based format, so we add functions
to parse and format this representation.

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

11 years agoAdd a function to change an OpCode's priority
Iustin Pop [Fri, 8 Feb 2013 11:22:24 +0000 (12:22 +0100)]
Add a function to change an OpCode's priority

This simply updates the metaopcode submit priority.

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

11 years agoMake hbal opcode annotation more generic
Iustin Pop [Fri, 8 Feb 2013 11:12:56 +0000 (12:12 +0100)]
Make hbal opcode annotation more generic

Currently, hbal code always uses annotateOpCode function, which means
we would have to pass the options data to all function in the call
chain if we wanted to make this more flexible.

By abstracting the type of the annotator and passing it as an argument
to the function, we can be more flexible.

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

11 years agoAdd unit tests for RADOSBLockDevice
Stratos Psomadakis [Tue, 12 Feb 2013 12:07:13 +0000 (14:07 +0200)]
Add unit tests for RADOSBLockDevice

Add unit tests for the RADOSBlockDevice JSON output parsing function,
and modify the unit tests for the plain output parsing function to
work with the new code.

Signed-off-by: Stratos Psomadakis <psomas@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix rbd showmapped output parsing
Stratos Psomadakis [Fri, 8 Feb 2013 16:36:34 +0000 (18:36 +0200)]
Fix rbd showmapped output parsing

'rbd showmapped' output formatting differs between older and newer versions of
the ceph tools. Try to use json output formatting if available (currently
available only in the ceph master branch). For bobtail, argonaut and older
releases fallback to manually parsing the 'rbd showmapped' output, handling the
differences in the output format for each rbd version correctly.

Signed-off-by: Stratos Psomadakis <psomas@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoChange default xen root path to /dev/xvda1
Guido Trotter [Tue, 12 Feb 2013 09:39:16 +0000 (10:39 +0100)]
Change default xen root path to /dev/xvda1

All recent-enough versions of linux see the xen paravirtual device as
/dev/xvd*.

This doesn't break old installations, as the default is only used on new
clusters.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoRemoves check for conflicts from NetworkDisconnect
Helga Velroyen [Wed, 30 Jan 2013 16:56:20 +0000 (16:56 +0000)]
Removes check for conflicts from NetworkDisconnect

This removes the check for conflicts from the Haskell
version of the OpCode NetworkDisconnect. This alignes
the Haskell code with the patch
"Force conflicts check in LUNetworkDisconnect" (which
is currently under review). I will submit these patches
together then.

This is a cherry-pick of commit 0ae4b35.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoIf _UnlockedLookupNetwork() fails raise error
Helga Velroyen [Wed, 30 Jan 2013 16:35:10 +0000 (17:35 +0100)]
If _UnlockedLookupNetwork() fails raise error

Make _UnlockedLookupNetwork() raise OpPrereqError (instead of returning
None) in case it does not find the requested network. Remove useless and
duplicate code such as:

if net_uuid is None:
  raise...

This is a cherry-pick of commit 1cce2c4.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoForce conflicts check in LUNetworkDisconnect
Helga Velroyen [Wed, 30 Jan 2013 16:12:26 +0000 (17:12 +0100)]
Force conflicts check in LUNetworkDisconnect

Until now if one disconnects a network with --no-conflicts-check
and then remove it, there is a possibility to leave instances with NICs
referencing non-existing networks. This causes network queries,
instance removal and modification to fail.

This patch allows a network to be disconnected from a nodegroup,
only if instances residing in the nodegroup do not have NICs attached
to the network. Otherwise OpPrereqError is raised. The
--no-conflicts-check option is removed from the gnt-network disconnect
command as well.

This is a cherry-pick of commit 6bb939a.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoMerge branch 'devel-2.7'
Michael Hanselmann [Tue, 12 Feb 2013 12:43:12 +0000 (13:43 +0100)]
Merge branch 'devel-2.7'

* devel-2.7: (23 commits)
  QA: Support additional arguments for initialization
  qa_utils: Fix order of arguments passed to _AssertRetCode
  Improve reporting on errors.AddressPoolError exceptions
  Add note about lv-tags rename
  Make use of HooksDict() for networks
  Remove family and size from network objects
  Remove network_type slot (Issue 363)
  Moved uniformity check for exclusive_storage flag
  "exclusive_storage" cannot be changed on single nodes
  Upgrades made on loading the configuration are always saved
  Show correct daemon name on Luxi connect errors
  Update the security document for Ganeti 2.7
  OS environment: add network information
  ConfigData: run UpgradeConfig on network objects
  Make ParticalNic's network field of type String
  Make gnt-os list work with no OSes
  Fix OCF files installation in devel/upload
  baserlib: Fix two mistakes in docstring
  Workaround hlint behaviour with no warnings/errors
  Remove use of 'head' and add hlint warning for it
  ...

Conflicts:
qa/qa_cluster.py: Trivial
qa/qa_node.py: Node attributes
src/Ganeti/Types.hs: Network cleanup
test/hs/Test/Ganeti/Objects.hs: Network cleanup

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Support additional arguments for initialization
Michael Hanselmann [Thu, 7 Feb 2013 13:15:36 +0000 (14:15 +0100)]
QA: Support additional arguments for initialization

In some scenarios it can be useful to add more arguments to “gnt-cluster
init”, such as “--no-drbd-storage”, if DRBD is not installed.

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

11 years agoqa_utils: Fix order of arguments passed to _AssertRetCode
Michael Hanselmann [Thu, 7 Feb 2013 12:09:42 +0000 (13:09 +0100)]
qa_utils: Fix order of arguments passed to _AssertRetCode

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

11 years agoImprove reporting on errors.AddressPoolError exceptions
Michael Hanselmann [Tue, 12 Feb 2013 11:17:21 +0000 (12:17 +0100)]
Improve reporting on errors.AddressPoolError exceptions

This patch improves the error messages given when a
“errors.AddressPoolError” exception is caught. Includes some small style
fixes.

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

11 years agoAdd note about lv-tags rename
Iustin Pop [Tue, 12 Feb 2013 09:04:21 +0000 (10:04 +0100)]
Add note about lv-tags rename

This is not included on the 2.6 branch, so update the NEWS for 2.7.0 beta1.

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

11 years agoMake use of HooksDict() for networks
Dimitris Aragiorgis [Mon, 11 Feb 2013 12:42:38 +0000 (14:42 +0200)]
Make use of HooksDict() for networks

This can be used in hypervisor code as well. For consistency
export *NETWORK_NAME and not *NETWORK throughout the code.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoRemove family and size from network objects
Dimitris Aragiorgis [Mon, 11 Feb 2013 12:42:36 +0000 (14:42 +0200)]
Remove family and size from network objects

This info is not used by Ganeti and therefore is removed.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoRemove network_type slot (Issue 363)
Dimitris Aragiorgis [Mon, 11 Feb 2013 12:42:34 +0000 (14:42 +0200)]
Remove network_type slot (Issue 363)

This slot was not used by Ganeti so the same info can be
provided via tags. In order not to break configuration data
we add a FromDict() method in Network config object that
removes the deprecated network_type (if found) and then invoke
the parent's method (which does the validation).

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoQA: Remove dictionary-like interface from config objects
Michael Hanselmann [Tue, 5 Feb 2013 15:42:09 +0000 (16:42 +0100)]
QA: Remove dictionary-like interface from config objects

These are no longer used.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Drop dictionary support from qa_utils._GetName
Michael Hanselmann [Tue, 5 Feb 2013 15:32:30 +0000 (16:32 +0100)]
QA: Drop dictionary support from qa_utils._GetName

This is no longer needed now that instance/node objects in QA have
attributes. Use a helper function instead to retrieve an entity's
identifying attribute.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Convert instances from items to attributes
Michael Hanselmann [Tue, 5 Feb 2013 15:34:36 +0000 (16:34 +0100)]
QA: Convert instances from items to attributes

The new objects support attributes. Item access (like a dictionary) is
going away in a couple of patches.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Convert nodes from items to attributes
Michael Hanselmann [Tue, 5 Feb 2013 15:30:42 +0000 (16:30 +0100)]
QA: Convert nodes from items to attributes

The new objects support attributes, which are cleaner than
dictionary-style access. Item access (like a dictionary) is going away
in a couple of patches. Also, pylint is better at checking attributes
than dictionary entries.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Release nodes through method
Michael Hanselmann [Tue, 5 Feb 2013 15:18:54 +0000 (16:18 +0100)]
QA: Release nodes through method

Instead of having a module-level function in “qa_config” to release a
node, a new method on node objects is used.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoMoved uniformity check for exclusive_storage flag
Bernardo Dal Seno [Fri, 1 Feb 2013 15:31:43 +0000 (16:31 +0100)]
Moved uniformity check for exclusive_storage flag

Cluster-verify used to check that the value of exclusive_storage is uniform
within node groups. Now, it's impossible to change the flag for a single
node, so that check has been removed and an equivalent one has been added
in ConfigWriter.VerifyConfig(). Unit test provided. The unit test covers
only the new check, not the whole VerifyConfig method.

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

11 years ago"exclusive_storage" cannot be changed on single nodes
Bernardo Dal Seno [Fri, 1 Feb 2013 14:46:54 +0000 (15:46 +0100)]
"exclusive_storage" cannot be changed on single nodes

There's never been support for a configuration where nodes in the same node
group have different values of the exclusive_storage flag. This patch
disables the possibility to change the flag for individual nodes.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoUpgrades made on loading the configuration are always saved
Bernardo Dal Seno [Wed, 6 Feb 2013 13:52:30 +0000 (14:52 +0100)]
Upgrades made on loading the configuration are always saved

Before, only some upgrades were written back to the configuration file. A
little refactoring of _UpgradeConfig() has been done to write unit tests.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoQA: Convert nodes to objects
Michael Hanselmann [Tue, 5 Feb 2013 14:20:16 +0000 (15:20 +0100)]
QA: Convert nodes to objects

Up until now nodes were stored as a dictionary. The keys were hardcoded
in a lot of places and entries modified directly.

This patch introduces a new class for nodes in QA named “_QaNode”. It
still supports accessing details via dictionary syntax, but that will be
removed after a couple of patches changing all users. Unit tests for
“qa_config.AcquireNode” are also included.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoShow correct daemon name on Luxi connect errors
Iustin Pop [Fri, 8 Feb 2013 15:51:25 +0000 (16:51 +0100)]
Show correct daemon name on Luxi connect errors

Since now confd also serves a Luxi endpoint, the current message in
cli.FormatError is misleading when actually failing to connect to
it. The patch adds a somewhat hackish way to show the right daemon
name.

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

11 years agoUpdate the security document for Ganeti 2.7
Iustin Pop [Fri, 8 Feb 2013 14:47:07 +0000 (15:47 +0100)]
Update the security document for Ganeti 2.7

This should address 359, but I'm not sure if it covers all of 2.7…

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

11 years agoQA: Release instances through method
Michael Hanselmann [Tue, 5 Feb 2013 14:10:28 +0000 (15:10 +0100)]
QA: Release instances through method

Instead of having a module-level function in “qa_config” to release an
instance, a new method on instance objects is used.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Convert instances to objects
Michael Hanselmann [Tue, 5 Feb 2013 14:07:08 +0000 (15:07 +0100)]
QA: Convert instances to objects

Up until now instances were stored as a dictionary. The keys were
hardcoded in a lot of places and entries modified directly.

This patch introduces a new class for instances in QA named
“_QaInstance”. It still supports accessing details via dictionary
syntax, but that will be removed after a couple of patches changing all
users. Unit tests for “qa_config.AcquireInstance” are also included.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoQA: Release instance in ganeti-qa
Michael Hanselmann [Wed, 6 Feb 2013 10:51:38 +0000 (11:51 +0100)]
QA: Release instance in ganeti-qa

Release instances directly from “ganeti-qa” instead of doing so in the
three tests removing instances. This is in line with how nodes are
released and makes it easier to find and debug double-release issues.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoQA: Stop using "in" operator for node
Michael Hanselmann [Tue, 5 Feb 2013 15:40:48 +0000 (16:40 +0100)]
QA: Stop using "in" operator for node

The new configuration object for nodes will not support it anymore.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoQA: Support entity objects in qa_utils._GetName
Michael Hanselmann [Tue, 5 Feb 2013 15:22:42 +0000 (16:22 +0100)]
QA: Support entity objects in qa_utils._GetName

This is a temporary solution until nodes and instances are converted to
objects with attributes.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoqa_config: Simplify IsTemplateSupported
Michael Hanselmann [Tue, 5 Feb 2013 12:51:30 +0000 (13:51 +0100)]
qa_config: Simplify IsTemplateSupported

The same code can be written in a single expression. The earlier patch
named “Refactor storage of runtime exclusive storage flag in QA”
provided the unit test.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoRefactor storage of runtime exclusive storage flag in QA
Michael Hanselmann [Tue, 5 Feb 2013 12:48:25 +0000 (13:48 +0100)]
Refactor storage of runtime exclusive storage flag in QA

This is a follow-up for “qa_config: Remove exclusive storage flag from
config”. Instead of storing the flag in a module-level variable it is
now stored within the new QA configuration class and unit tests are
provided. Wrappers in “qa_config” maintain the existing interface.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoRefactor QA configuration code
Michael Hanselmann [Mon, 4 Feb 2013 15:06:23 +0000 (16:06 +0100)]
Refactor QA configuration code

Ever since its introduction (sometime before commit cec9845 in September
2007), the QA configuration was stored in a dictionary at module-level
in “qa/qa_config.py”. The configuration was loaded, verified and
evaluated using module-level functions. Since then the configuration has
become more complicated and more functionality has been added. This
patch refactors handling the configuration to use a class and provides
unittests.

- The configuration is loaded through a class method which also verifies
  it for consistency
- Wrapper methods are provided in “qa_config” to not change the
  interface
- Unit tests are provided for the new configuration class
- The configuration object is still stored in a module-level variable
  and can be retrieved using “GetConfig” (direct access should be
  avoided so an uninitialized configuration can be detected)

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoqa_config: Remove exclusive storage flag from config
Michael Hanselmann [Mon, 4 Feb 2013 16:05:29 +0000 (17:05 +0100)]
qa_config: Remove exclusive storage flag from config

Commit 6a0f22e added the ability to track the status of the cluster-wide
flag for exclusive storage. It did so in a way which modifies the
in-memory configuration dictionary. This patch changes the code to use a
plain global variable as a temporary solution until a configuration
object is added.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoOS environment: add network information
Guido Trotter [Thu, 7 Feb 2013 13:30:38 +0000 (14:30 +0100)]
OS environment: add network information

1) Move the hooks environment dict generator inside the object. This
also adds missing values such as network family and uuid.
2) Use the same generator both for the os environment and for the
instance hooks.
3) Update manpage and hooks documentation.

Also update a forgotten docstring about a tuple's content.

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

11 years agoConfigData: run UpgradeConfig on network objects
Guido Trotter [Fri, 8 Feb 2013 07:44:48 +0000 (08:44 +0100)]
ConfigData: run UpgradeConfig on network objects

Although this does nothing for now, running it is safe, and consistent
with how other objects behave.

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

11 years agoMake ParticalNic's network field of type String
Guido Trotter [Thu, 7 Feb 2013 14:47:48 +0000 (15:47 +0100)]
Make ParticalNic's network field of type String

This was applied to "master" along with extra changes affecting the
master branch only. Cherry-picking just the Objects.hs change.

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

11 years agoMake gnt-os list work with no OSes
Iustin Pop [Fri, 8 Feb 2013 09:47:04 +0000 (10:47 +0100)]
Make gnt-os list work with no OSes

When absolutely no OSes are present on the cluster, the result of
OpOsDiagnose is an empty list. This is currently handled in gnt-os as
an error condition, probably due to how OpOsDiagnose used to return
errors in the past.

However, with the query backend, an empty list is a reasonable answer,
so I see no reason why gnt-os should treat that as an error,
especially as it doesn't give any hint of what is "wrong". Simply
removing that code block allows it to proceed normally, and list no
OSes.

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

11 years agoFix OCF files installation in devel/upload
Iustin Pop [Fri, 8 Feb 2013 09:34:45 +0000 (10:34 +0100)]
Fix OCF files installation in devel/upload

LIBDIR was not defined, so the files ended up directly under /, not
good. Now they're properly installed under /usr/lib/ocf, as per
http://linux-ha.org/wiki/OCF_Resource_Agents.

Also add "set -u" to prevent future occurrences of this kind of bug.

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

11 years agobaserlib: Fix two mistakes in docstring
Michael Hanselmann [Fri, 8 Feb 2013 09:52:26 +0000 (10:52 +0100)]
baserlib: Fix two mistakes in docstring

The method names were wrong due to copy & paste.

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

11 years agovcluster: Make _MakeNodeRoot public
Michael Hanselmann [Thu, 7 Feb 2013 12:12:53 +0000 (13:12 +0100)]
vcluster: Make _MakeNodeRoot public

The QA code will also have to generate virtual paths and this function
comes in handy.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoWorkaround hlint behaviour with no warnings/errors
Iustin Pop [Thu, 7 Feb 2013 13:32:49 +0000 (14:32 +0100)]
Workaround hlint behaviour with no warnings/errors

When hlint sees a perfectly nice code tree, it will skip generating
the reports (both stdout and html). This means that usually the old
report will remain in place, so it makes development harder, as the
html file is out of sync with the tree.

To workaround this, we generate an empty/minimal file in this case.

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

11 years agoRemove use of 'head' and add hlint warning for it
Iustin Pop [Thu, 7 Feb 2013 13:22:01 +0000 (14:22 +0100)]
Remove use of 'head' and add hlint warning for it

Since 'head' is unsafe to use in most cases, this patch removes its
use from most of the code, adds a lint warning for it (and for tail as
well), and adds override annotations in the few cases where it's
actually OK to use it (mainly when using head over the result of
functions which guarantee to return a non-empty list by documentation,
not type).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoHarep.hs: fix a couple typos in comments and docstrings
Dato Simó [Wed, 6 Feb 2013 20:01:54 +0000 (20:01 +0000)]
Harep.hs: fix a couple typos in comments and docstrings

Signed-off-by: Dato Simó <dato@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agohv_kvm: Error messages, punctuation, other style fixes
Michael Hanselmann [Thu, 7 Feb 2013 11:01:22 +0000 (12:01 +0100)]
hv_kvm: Error messages, punctuation, other style fixes

- Capitalize acronyms such as “QMP” or “SPICE”
- Remove punctuation from error messages
- Improve error reporting when sending a monitor command failed
- Put “or” at end of line
- Fix indentation for a concatenated string

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

11 years agohv_kvm: Add TODO regarding monitor commands
Michael Hanselmann [Thu, 7 Feb 2013 10:44:57 +0000 (11:44 +0100)]
hv_kvm: Add TODO regarding monitor commands

Monitor calls should be replaced with QMP once KVM >= 0.14 is required.

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

11 years agoAdd release date for 2.7.0 beta1 v2.7.0beta1
Guido Trotter [Wed, 6 Feb 2013 13:11:35 +0000 (14:11 +0100)]
Add release date for 2.7.0 beta1

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoFix improperly formatted docstring
Michele Tartara [Wed, 6 Feb 2013 09:16:01 +0000 (09:16 +0000)]
Fix improperly formatted docstring

Change the docstring of chompPrefix to prevent the error
"doc comment parse failed" that was raised by some version of
haddock while generating the documentation for this function.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoVersion bump for 2.7.0~beta1
Guido Trotter [Mon, 4 Feb 2013 14:28:41 +0000 (15:28 +0100)]
Version bump for 2.7.0~beta1

Also update the documentation target versions and the cfgupgrade tool to
recognize 2.6 and upgrade to 2.7

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

11 years agoUpdate hooks.rst for Ganeti 2.7
Guido Trotter [Wed, 6 Feb 2013 10:28:12 +0000 (11:28 +0100)]
Update hooks.rst for Ganeti 2.7

- The migrate instance hook now also executes on the primary node in
  the "pre" phase.
- Instance hooks now get full network information on each nic, if a
  nic's network is set.

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

11 years agoMerge branch 'devel-2.7'
Michael Hanselmann [Tue, 5 Feb 2013 16:51:52 +0000 (17:51 +0100)]
Merge branch 'devel-2.7'

* devel-2.7:
  Redirect output for gnt-* list/list-fields commands
  Add function to execute QA commands with redirected output
  Implement option to skip logging of QA commands
  Fix typo in a comment
  Add some more Haskell/Python equivalence tests
  Fix Haskell log file naming after virtual cluster changes
  QA: Clean up after "instance-remove-drbd-offline" test
  Switch KVM to multi-error verify results
  Make LXC fail verification if cgroup is not mounted
  Add a helper function for hypervisor verification
  hv_lxc: fix whitespace errors
  s/nic/NIC/ in manpages
  LXC: add support for the memory controller
  LXC: adapt hv for newer lxc userspace tools

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoRedirect output for gnt-* list/list-fields commands
Iustin Pop [Tue, 5 Feb 2013 15:26:04 +0000 (16:26 +0100)]
Redirect output for gnt-* list/list-fields commands

This enabled the redirection; QA output after this patch should become
much much smaller (on a 'quick' QA, we are left with ~0.5MB output on
stdout and 64MB redirected output).

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

11 years agoAdd function to execute QA commands with redirected output
Iustin Pop [Tue, 5 Feb 2013 15:24:05 +0000 (16:24 +0100)]
Add function to execute QA commands with redirected output

Some QA commands generate non-trivial output: for a full QA, the gnt-*
list commands generate more than 300MB of data. To make the QA logs
more parseable by humans, we need support for redirecting output of
commands to a different place.

This patch adds a 'AssertRedirectedCommand' that does this,
redirecting the output to a (fixed) log file in the Ganeti log
directory.

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

11 years agoImplement option to skip logging of QA commands
Iustin Pop [Tue, 5 Feb 2013 15:22:00 +0000 (16:22 +0100)]
Implement option to skip logging of QA commands

This patch adds an optional kwarg that allows skipping the "Command:
…" line in QA output. This is helpful if we only need to run some
maintenance actions, that are QA-related and not Ganeti-related.

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

11 years agoMaking ParticalNic's network field of type String
Helga Velroyen [Tue, 5 Feb 2013 09:08:46 +0000 (10:08 +0100)]
Making ParticalNic's network field of type String

This is yet another fix for type confusion between python
and haskell. ;) The network field of PartialNic should be
a string and not of type Network. This makes it necessary
to add a helper function to look up a network by name
and not by UUID.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoFix typo in a comment
Iustin Pop [Tue, 5 Feb 2013 13:04:14 +0000 (14:04 +0100)]
Fix typo in a comment

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoAdd some more Haskell/Python equivalence tests
Iustin Pop [Mon, 4 Feb 2013 13:52:43 +0000 (14:52 +0100)]
Add some more Haskell/Python equivalence tests

This would have caught the log file problem fixed in the previous
patch (9411474b), for example. Also we test user/group equivalence,
name only.

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

11 years agoFix Haskell log file naming after virtual cluster changes
Iustin Pop [Mon, 4 Feb 2013 13:34:33 +0000 (14:34 +0100)]
Fix Haskell log file naming after virtual cluster changes

Commit 3329f4de changed the Haskell log file from constants to
functions, but introduced a bug: it uses now the daemon name instead
of the correct log file, which means "ganeti-confd.log" instead of
"conf-daemon.log".

In order to fix this, we need to abstract the log file base (in
constants.py) into a separate set of constants, so that we can reuse
it in the Haskell code.

This fixes issue 343.

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

11 years agoQA: Clean up after "instance-remove-drbd-offline" test
Bernardo Dal Seno [Fri, 1 Feb 2013 17:32:42 +0000 (18:32 +0100)]
QA: Clean up after "instance-remove-drbd-offline" test

This test used to leave a node with orphan logical volumes and unused DRBD
minors. Now, the expected leftovers are cleaned up after the test, and
cluster-verify is run.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoqa_config: Remove useless "options" variable
Michael Hanselmann [Mon, 4 Feb 2013 15:06:26 +0000 (16:06 +0100)]
qa_config: Remove useless "options" variable

It is only used in one place and not necessary.

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

11 years agoExtract container converters
Michael Hanselmann [Mon, 4 Feb 2013 13:38:34 +0000 (14:38 +0100)]
Extract container converters

“objects.ConfigObject” contains two useful functions for working with
containers of serialized objects, “_ContainerToDicts” and
“_ContainerFromDicts”. This patch separates those functions and moves
them into “objectutils” as they'll be useful for converting parts of the
QA configuration to objects. Unittests are added to cover the parts not
already tested through other code paths.

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

11 years agohv_xen: Fix epydoc error
Michael Hanselmann [Mon, 4 Feb 2013 14:28:51 +0000 (15:28 +0100)]
hv_xen: Fix epydoc error

“utils.RunCmd” is re-exported from “utils.process.RunCmd”. Epydoc
doesn't fully understand this, so we have to refer to the original.

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

11 years agoobjects: Improve handling of TCP/UDP port pool
Michael Hanselmann [Mon, 4 Feb 2013 13:00:40 +0000 (14:00 +0100)]
objects: Improve handling of TCP/UDP port pool

- Handle de-serialization correctly when pool is not defined
- Serialize to empty list when the attribute is None (this should never
  happen in reality as the attribute is always set when de-serializing)
- Add tests

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

11 years agoSwitch KVM to multi-error verify results
Iustin Pop [Mon, 4 Feb 2013 10:12:23 +0000 (11:12 +0100)]
Switch KVM to multi-error verify results

This uses the new _FormatVerifyResults helper function to return
multiple errors.

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

11 years agoMake LXC fail verification if cgroup is not mounted
Iustin Pop [Mon, 4 Feb 2013 09:57:22 +0000 (10:57 +0100)]
Make LXC fail verification if cgroup is not mounted

Since LXC now relies on cgroup memory limits to enforce memory, let's
make hypervisor verification (and thus cluster-verify) return errors
when the cgroup filesystem is not mounted.

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

11 years agoAdd a helper function for hypervisor verification
Iustin Pop [Mon, 4 Feb 2013 10:10:14 +0000 (11:10 +0100)]
Add a helper function for hypervisor verification

This will allow easier multi-error results from hypervisors; right
now, we only report the first error, which is not nice.

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

11 years agohv_lxc: fix whitespace errors
Guido Trotter [Sat, 2 Feb 2013 12:06:27 +0000 (13:06 +0100)]
hv_lxc: fix whitespace errors

The latest lxc patches included a few whitespace style errors, that make
lint fail. This patch fixes those.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agos/nic/NIC/ in manpages
Guido Trotter [Sat, 2 Feb 2013 11:38:49 +0000 (12:38 +0100)]
s/nic/NIC/ in manpages

For consistency, let's make sure NICs are capitalized always in the same
way.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoLXC: add support for the memory controller
Faidon Liambotis [Sun, 23 Dec 2012 16:14:25 +0000 (18:14 +0200)]
LXC: add support for the memory controller

Add support for the memory resource controller, useful to actually place
memory limits on instances.

Support is still optional, in case the kernel doesn't have it compiled
in, or -in the case of Debian- has it dependent on a kernel command-line
switch (cgroup_enable=memory specifically).

Signed-off-by: Faidon Liambotis <paravoid@debian.org>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoMerge branch 'devel-2.7'
Michael Hanselmann [Fri, 1 Feb 2013 16:21:55 +0000 (17:21 +0100)]
Merge branch 'devel-2.7'

* devel-2.7: (24 commits)
  Fix typo in ganeti-noded man page
  QA: Run instance tests with different cluster configurations
  QA: Run cluster-verify after instance tests
  QA: Refactored launching of the various instance tests
  QA: Use lists of nodes as argument to instance tests
  QA: Instance tests check the configuration before running
  QA: Added functions to allocate/free N nodes at once
  QA: Added exclusive_storage to qa_config
  QA: Better initialization of a global dictionary
  QA: Added disk template to config
  QA cleanup: Removed instance-disk-failure test
  QA fix: TestInstanceExportWithRemove() updates configuration
  QA: Cluster-verify reports shared PVs with exclusive storage
  QA: Added constants for LVM volumes
  QA: Templates incompatible with exclusive storage reported
  QA: Uniformity check for exclusive_storage in cluster-verify
  QA: Test for basic features of exclusive storage
  QA: Added function to read cluster configuration fields
  QA: Added function to check cluster-verify result
  Document better gnt-network
  ...

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

11 years agoLXC: adapt hv for newer lxc userspace tools
Faidon Liambotis [Sun, 23 Dec 2012 16:14:24 +0000 (18:14 +0200)]
LXC: adapt hv for newer lxc userspace tools

Currently hv_lxc depends on the behavior and output of older LXC tools,
which have since changed, making it unable to function in current
distributions (e.g. Debian wheezy).

Adapt the tools and expectation for the output and make it into a
working state again, at least for LXC 0.8.0.

LXC tools seem to be split into two categories: the actual, binary lxc
tools, plus a set of shell scripts to provide a higher-level interface.
Ganeti doesn't need the latter and the shell scripts make some
assumptions (like /var/lib/lxc) so remove the only reference to such a
shell script (lxc-ls).

While at it, remove a few comments about "current (Spring 2010)
distributions" that do not apply anymore.

This is a backwards-incompatible change, meaning it won't work on
systems with older LXC userspace. However, hv_lxc is experimental anyway
and there's virtually no documentation about it in the tree.

Signed-off-by: Faidon Liambotis <paravoid@debian.org>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoFix typo in ganeti-noded man page
Michele Tartara [Fri, 1 Feb 2013 13:46:04 +0000 (14:46 +0100)]
Fix typo in ganeti-noded man page

Add a missing "in".

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

11 years agoQA: Run instance tests with different cluster configurations
Bernardo Dal Seno [Mon, 28 Jan 2013 16:26:40 +0000 (17:26 +0100)]
QA: Run instance tests with different cluster configurations

Instance tests are run with or without the exclusive-storage flag set. More
configurations can be added easily.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoQA: Run cluster-verify after instance tests
Bernardo Dal Seno [Sat, 26 Jan 2013 01:40:03 +0000 (02:40 +0100)]
QA: Run cluster-verify after instance tests

We want to make sure that instance operations don't leave the cluster in a
bad state. The "instance-remove-drbd-offline" test leaves some debris
behind, so it's been moved to the last position.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoQA: Refactored launching of the various instance tests
Bernardo Dal Seno [Wed, 23 Jan 2013 16:23:48 +0000 (17:23 +0100)]
QA: Refactored launching of the various instance tests

The code launching instance tests for "plain" and "drbd" templates has been
unified. In this way it's easier to add more templates, and to re-use the same
tests with different configurations.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoQA: Use lists of nodes as argument to instance tests
Bernardo Dal Seno [Fri, 25 Jan 2013 20:39:38 +0000 (21:39 +0100)]
QA: Use lists of nodes as argument to instance tests

Some instance test functions took two node arguments, some took one, and
some took two but the second argument could be None. This patch makes such
functions uniform by using a list of nodes as an argument.  This simplifies
the following refactoring.

No test logic has been changed.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoQA: Instance tests check the configuration before running
Bernardo Dal Seno [Fri, 25 Jan 2013 20:01:23 +0000 (21:01 +0100)]
QA: Instance tests check the configuration before running

Instance test functions check the current configuration, and they will run
the actual tests only if the configuration supports them.  This will be
used for refactoring in following patches.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoQA: Added functions to allocate/free N nodes at once
Bernardo Dal Seno [Fri, 25 Jan 2013 18:06:40 +0000 (19:06 +0100)]
QA: Added functions to allocate/free N nodes at once

These make possible to simplify the logic of tests requiring more
nodes. Used in the following patches.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoQA: Added exclusive_storage to qa_config
Bernardo Dal Seno [Mon, 28 Jan 2013 12:55:50 +0000 (13:55 +0100)]
QA: Added exclusive_storage to qa_config

QA configuration now tracks the state of the exclusive_storage flag at
cluster level. This will be used to selectively enable tests according to
the configuration.

Also, it's now possible to specify the initial value of the
exclusive_storage flag in the configuration file.

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

11 years agoQA: Better initialization of a global dictionary
Bernardo Dal Seno [Mon, 28 Jan 2013 15:46:23 +0000 (16:46 +0100)]
QA: Better initialization of a global dictionary

The global 'cfg' variable is initialized to an empty dictionary, so there
is no more need to disable some pylint checks.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoQA: Added disk template to config
Bernardo Dal Seno [Tue, 22 Jan 2013 16:41:12 +0000 (17:41 +0100)]
QA: Added disk template to config

The disk templates used by the instances are tracked in the QA
configuration.  This will be used to selectively enable tests according to
the configuration.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoQA cleanup: Removed instance-disk-failure test
Bernardo Dal Seno [Tue, 29 Jan 2013 17:11:31 +0000 (18:11 +0100)]
QA cleanup: Removed instance-disk-failure test

The test was broken, out of sync with the rest of the code, and prone to
crashes. Until someone does a better job, it's better to remove the
test. This simplifies further refactoring.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoQA fix: TestInstanceExportWithRemove() updates configuration
Bernardo Dal Seno [Sat, 26 Jan 2013 02:38:10 +0000 (03:38 +0100)]
QA fix: TestInstanceExportWithRemove() updates configuration

When the instance is removed from the cluster by this test, it's also freed
in the QA configuration.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>