ganeti-local
11 years agoAllow iallocator to work without LVM storage
Iustin Pop [Fri, 1 Mar 2013 11:45:38 +0000 (12:45 +0100)]
Allow iallocator to work without LVM storage

Currently, the iallocator interface requires LVM storage, due to the
way it computes the node storage information.

By changing the code to understand that GetVGName() can return None,
and by setting the disk_total/disk_free node parameters to the value
zero, we can workaround this issue until proper multi-storage
reporting is implemented.

The hail iallocator plugin works without changes once this is
implemented, as it already handles non-LVM storage as "foreign"
storage (with unlimited capacity).

The patch also changes a bit how the parameters are retrieved and
used; hopefully this is a bit safer and more readable.

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

11 years agoAllow rpc.MakeLegacyNodeInfo to parse non-LVM results
Iustin Pop [Fri, 1 Mar 2013 11:23:23 +0000 (12:23 +0100)]
Allow rpc.MakeLegacyNodeInfo to parse non-LVM results

'MakeLegacyNodeInfo' is not the best place for this, but we'd have to
duplicate it if we wanted a LVM-less version, so the easiest is to add
an optional parameter that allows it to accept/skip LVM-less results.

It still requires at most one VG result, so its behaviour isn't
changed in this respect.

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

11 years agoFix LUTestAllocator with instance alloc
Iustin Pop [Fri, 1 Mar 2013 09:59:55 +0000 (10:59 +0100)]
Fix LUTestAllocator with instance alloc

This is similar to commit 8775e62a; the addition of node_whitelist
broke this LU as well.

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

11 years agoFix confd issue regarding --no-lvm-storage
Dimitris Aragiorgis [Thu, 28 Feb 2013 01:29:33 +0000 (03:29 +0200)]
Fix confd issue regarding --no-lvm-storage

If cluster is initialized with --no-lvm-storage then volume_group_name
does not exist in config.data. Thus we must define it as optional in
confd.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
[iustin@google.com: fixed Haskell RPC definition]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

11 years agoFix networks in _PrepareNicModifications()
Dimitris Aragiorgis [Tue, 26 Feb 2013 20:28:42 +0000 (22:28 +0200)]
Fix networks in _PrepareNicModifications()

Passing --net 0:add,ip=5.5.5.5 failed due to a reference
of a non initialized variable (new_net_obj). Reorder the checks
and add some comments to be readable.

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

11 years agoFix sphinx label namespace
Iustin Pop [Thu, 28 Feb 2013 16:40:39 +0000 (17:40 +0100)]
Fix sphinx label namespace

Thanks Michael for pointing out the error!

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

11 years agoClarify use of move-instance with self-signed certificates
Iustin Pop [Thu, 28 Feb 2013 15:32:11 +0000 (16:32 +0100)]
Clarify use of move-instance with self-signed certificates

The document doesn't mention which certificates need to be passed as
ca-file, so let's try to clarify that.

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

11 years agoQA: Support diskless instances
Michael Hanselmann [Wed, 27 Feb 2013 14:51:36 +0000 (15:51 +0100)]
QA: Support diskless instances

This is an initial implementation of diskless instances.

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

11 years agoQA: Compare ipolicy directly with None
Michael Hanselmann [Wed, 27 Feb 2013 15:18:05 +0000 (16:18 +0100)]
QA: Compare ipolicy directly with None

If a value was set to numeric 0, the parameter wouldn't be passed to the
command.

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

11 years agoQA: List all ipolicy options in example configuration
Michael Hanselmann [Wed, 27 Feb 2013 15:10:08 +0000 (16:10 +0100)]
QA: List all ipolicy options in example configuration

This makes it easier to know what options are available.

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

11 years agoQA: Update assertion for diskless instances
Michael Hanselmann [Wed, 27 Feb 2013 16:45:04 +0000 (17:45 +0100)]
QA: Update assertion for diskless instances

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

11 years agoQA: Disable reinstall test for diskless instances
Michael Hanselmann [Wed, 27 Feb 2013 15:57:44 +0000 (16:57 +0100)]
QA: Disable reinstall test for diskless instances

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

11 years agoQA: Fix dictionary formatting
Michael Hanselmann [Wed, 27 Feb 2013 14:48:46 +0000 (15:48 +0100)]
QA: Fix dictionary formatting

Make it match the style guide.

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

11 years agoQA: Disable drbd-offline test if no DRBD instance is used
Michael Hanselmann [Wed, 27 Feb 2013 14:46:43 +0000 (15:46 +0100)]
QA: Disable drbd-offline test if no DRBD instance is used

If “instance-add-drbd-disk” is not enabled it usually also means to not
use DRBD at all.

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

11 years agoRemove early returns in network LUs
Dimitris Aragiorgis [Thu, 28 Feb 2013 13:55:03 +0000 (15:55 +0200)]
Remove early returns in network LUs

Remove any early returns in LUNetworkDisconnect/LUNetworkConnect
and replace them with if-else statements.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoTest AsyncStreamServer with abstract unix sockets
Guido Trotter [Tue, 19 Feb 2013 22:41:19 +0000 (14:41 -0800)]
Test AsyncStreamServer with abstract unix sockets

This was meant to be since "the beginning" but was never submitted as
somehow it failed with python 2.4. Now that the minimum python version
has been increased it can be added.

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

11 years agoQA: Disable RAPI tests for virtual clusters
Michael Hanselmann [Thu, 21 Feb 2013 14:32:29 +0000 (15:32 +0100)]
QA: Disable RAPI tests for virtual clusters

The QA script connects to the RAPI daemon. In virtual cluster setups the
daemon is usually listening on a local interface not reachable from the
outside.

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

11 years agoQA: Add virtual cluster support to queue drain test
Michael Hanselmann [Thu, 21 Feb 2013 15:27:22 +0000 (16:27 +0100)]
QA: Add virtual cluster support to queue drain test

The path to the queue drain file must use the virtual node path.

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

11 years agoQA: Disable copyfile test for virtual clusters
Michael Hanselmann [Thu, 21 Feb 2013 15:27:01 +0000 (16:27 +0100)]
QA: Disable copyfile test for virtual clusters

This test will need some more work for virtual clusters. Disable it in
the meantime.

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

11 years agoQA: Disable OOB tests for virtual clusters
Michael Hanselmann [Thu, 21 Feb 2013 15:26:31 +0000 (16:26 +0100)]
QA: Disable OOB tests for virtual clusters

They do not work properly at the moment.

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

11 years agoQA: Update virtual node's RAPI users file
Michael Hanselmann [Thu, 21 Feb 2013 14:33:45 +0000 (15:33 +0100)]
QA: Update virtual node's RAPI users file

The file is located below the virtual node directory.

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

11 years agoQA: Read virtual node's RAPI certificate
Michael Hanselmann [Thu, 21 Feb 2013 14:32:51 +0000 (15:32 +0100)]
QA: Read virtual node's RAPI certificate

The virtual node prefix must be added to the path.

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

11 years agoqa_os: Disable checks for virtual clusters
Michael Hanselmann [Thu, 21 Feb 2013 14:17:44 +0000 (15:17 +0100)]
qa_os: Disable checks for virtual clusters

The OS definitions are not virtualized. Tests configuring different OS
definitions on different nodes don't work properly.

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

11 years agoqa_instance: Virtual cluster support for instance list
Michael Hanselmann [Thu, 21 Feb 2013 14:15:34 +0000 (15:15 +0100)]
qa_instance: Virtual cluster support for instance list

Use path of virtual node when retrieving ssconf's instance list.

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

11 years agoqa_daemon: Virtual cluster support
Michael Hanselmann [Thu, 21 Feb 2013 14:14:19 +0000 (15:14 +0100)]
qa_daemon: Virtual cluster support

Use virtual node path when removing the watcher status file.

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

11 years agoqa_utils: Support virtual cluster for backup files
Michael Hanselmann [Thu, 21 Feb 2013 13:58:27 +0000 (14:58 +0100)]
qa_utils: Support virtual cluster for backup files

“qa_utils.BackupFile” is always called with the path for a normal node.
In virtual clusters the node prefix path must be added.

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

11 years agoqa_utils: Virtual cluster support for SSH commands
Michael Hanselmann [Thu, 21 Feb 2013 14:10:59 +0000 (15:10 +0100)]
qa_utils: Virtual cluster support for SSH commands

In virtual clusters, all “gnt-*” and “ganeti-*” commands require
environment variables to be set for the virtual cluster root directory
and node name. The “cmd” script generated by “vcluster-setup” is a
wrapper setting those variables.

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

11 years agoqa_config: Support callable test checks
Michael Hanselmann [Thu, 21 Feb 2013 13:54:54 +0000 (14:54 +0100)]
qa_config: Support callable test checks

Until now all tests depended on simple AND/OR conditions. With the
introduction of virtual cluster support, some tests can only run if
virtual clusters are not in use (e.g. not yet supported or not
possible). Instead of introducing more logic for enabling/disabling
tests, callable values are supported instead. “ht.WithDesc” should be
used on them to continue to provide a readable description.

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

11 years agoQA: Add config entries for virtual cluster
Michael Hanselmann [Fri, 8 Feb 2013 16:36:57 +0000 (17:36 +0100)]
QA: Add config entries for virtual cluster

If these new options are set, a virtual cluster is created and used.
Virtual clusters consist of 1..N virtual nodes on a single physical (or
virtual) node. The design of virtual clusters is described in
“doc/design-virtual-clusters.rst”.

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

11 years agoFix typo in docstring
Christos Stavrakakis [Tue, 26 Feb 2013 16:49:18 +0000 (18:49 +0200)]
Fix typo in docstring

Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agorapi.rst: Replace manual method lists with directive
Michael Hanselmann [Fri, 22 Feb 2013 14:19:12 +0000 (15:19 +0100)]
rapi.rst: Replace manual method lists with directive

Many resources, but not all, list their supported methods. With a new
reST directive, this list is now automatically generated and also lists
the required permissions.

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

11 years agoFix HooksDict() in case of no tags
Dimitris Aragiorgis [Tue, 26 Feb 2013 01:39:28 +0000 (03:39 +0200)]
Fix HooksDict() in case of no tags

In this method self.tags might be None and cannot be used
in join(). Use GetTags instead.

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

11 years agoAdd networks to _AllIDs()
Dimitris Aragiorgis [Tue, 26 Feb 2013 01:39:27 +0000 (03:39 +0200)]
Add networks to _AllIDs()

networks config objects have UUIDs and thus should be included
in _AllUUIDObjects().

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

11 years agoFix locking in LUNetworkConnect()
Dimitris Aragiorgis [Tue, 26 Feb 2013 01:39:26 +0000 (03:39 +0200)]
Fix locking in LUNetworkConnect()

Locks for group instances are aquired only if conflicts are checked.
To this end we must _CheckNodeGroupInstances() only then otherwise
this check will always fail (owned_instances will be []).

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

11 years agoFix networks in LUInstanceSetParams()
Dimitris Aragiorgis [Tue, 26 Feb 2013 01:39:25 +0000 (03:39 +0200)]
Fix networks in LUInstanceSetParams()

Params passed in _CreateNewNic() are not yet evaluated and include
the value passed by user for the network. A lookup must be done first
in order to find the corresponding network UUID which should be stored
in the newly created NIC object.

Params passed in _ApplyNicMods() include the value passed by user
for the network. Thus a lookup must be done first in order to find
the corresponding network UUID. Then compare it with the existing
value and act accordingly.

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

11 years agoHRoller: allow filtering by node group
Guido Trotter [Thu, 21 Feb 2013 21:40:14 +0000 (13:40 -0800)]
HRoller: allow filtering by node group

Accept the -G option, and if it's passed require that it matches a
nodegroup, then only output nodes belonging to that group.

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

11 years agoHRoller: print only online nodes
Guido Trotter [Thu, 21 Feb 2013 21:37:41 +0000 (13:37 -0800)]
HRoller: print only online nodes

To make the graphs work even when instances live on offline nodes (eg.
because we're offlining them just to exclude them, or because they have
instance still on them) we just filter them out at the end, when we're
going to print out the result.

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

11 years agoOfficially require Python 2.6+
Guido Trotter [Thu, 21 Feb 2013 17:50:55 +0000 (09:50 -0800)]
Officially require Python 2.6+

We have no way to test Python 2.4 compatibility anymore, and that
version is long deprecated. From version 2.8+ require Python 2.6 or
above (but still not 3.0).

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

11 years agobootstrap: Wait for SSH daemon to become reachable
Michael Hanselmann [Thu, 21 Feb 2013 17:45:42 +0000 (18:45 +0100)]
bootstrap: Wait for SSH daemon to become reachable

In some situations after restarting the SSH daemon by
“prepare-node-join” it's not immediately reachable. Like with the master
and node daemons, waiting for it to become reachable instead of failing
hard can help in such situations.

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

11 years agoTcpPing: Better error handling, logging
Michael Hanselmann [Thu, 21 Feb 2013 17:44:35 +0000 (18:44 +0100)]
TcpPing: Better error handling, logging

Log every attempt to reach a port on another node. Don't silently return
False if a target not recognized as an IP address is given (e.g. a
hostname).

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

11 years agoWipe disks added through "gnt-instance modify"
Michael Hanselmann [Mon, 25 Feb 2013 15:27:27 +0000 (16:27 +0100)]
Wipe disks added through "gnt-instance modify"

In issue 353 Sascha Lucas reported that disks are not wiped when added
through “gnt-instance modify”. This patch adds this functionality and
updates the docstring for “_WipeDisks”.

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

11 years agovcluster-setup: Create $vnode/etc/ganeti directory
Michael Hanselmann [Thu, 21 Feb 2013 15:47:23 +0000 (16:47 +0100)]
vcluster-setup: Create $vnode/etc/ganeti directory

This directory is required by “cfgupgrade” and some other tools.

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

11 years agoconstants: Use SSH constant for daemon ports
Michael Hanselmann [Thu, 21 Feb 2013 17:43:28 +0000 (18:43 +0100)]
constants: Use SSH constant for daemon ports

Moving the SSH/SCP constants around was necessary for this.

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

11 years agoFix style violations in commit 4a90bd4, small changes
Michael Hanselmann [Fri, 22 Feb 2013 15:50:41 +0000 (16:50 +0100)]
Fix style violations in commit 4a90bd4, small changes

- Commit 4a90bd4 contained a rather large number of style violations:
  - Indentation/sequence formatting
  - Wrapping of long lines
  - Docstrings whose first line was wrapped
  - A stray backslash in a docstring
- opcodes: Don't check for list or tuple. None of the other opcodes does
  it explicitely. As long as the length and the items match the value is
  accepted.
- server/noded: “if variable” doesn't test for None, but False

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

11 years agosphinx_ext: New directive for supported methods
Michael Hanselmann [Fri, 22 Feb 2013 14:18:56 +0000 (15:18 +0100)]
sphinx_ext: New directive for supported methods

Until now many resources, but not all and not consistently list their
supported methods (e.g. “Supports the following commands: ``GET`` …”).
Not only is it easy for this list to get out of date, but it would also
be nice if it listed the required access permissions.

This patch adds a new directive to insert a table listing all supported
methods and their access permissions for a resource.

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

11 years agosphinx_ext: Factorize getting RAPI handlers
Michael Hanselmann [Fri, 22 Feb 2013 14:17:17 +0000 (15:17 +0100)]
sphinx_ext: Factorize getting RAPI handlers

The list of resources and handlers will also be used for generating
a per-resource table.

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

11 years agosphinx_ext: Factorize handler methods/access
Michael Hanselmann [Fri, 22 Feb 2013 14:12:50 +0000 (15:12 +0100)]
sphinx_ext: Factorize handler methods/access

The factorized parts will be used to show a small table with methods and
required permissions for each resource.

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

11 years agoUse "none" instead of "everyone" in RAPI documentation
Michael Hanselmann [Fri, 22 Feb 2013 14:07:08 +0000 (15:07 +0100)]
Use "none" instead of "everyone" in RAPI documentation

The list of required access permissions uses the word “everyone” to mean
“no special permissions are needed”. The word “none” fits better.

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

11 years ago.gitignore: Add test/hs/harep
Michael Hanselmann [Fri, 22 Feb 2013 15:57:51 +0000 (16:57 +0100)]
.gitignore: Add test/hs/harep

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Dato Simó <dato@google.com>

11 years agoRewrap a comment in constants.py
Iustin Pop [Mon, 25 Feb 2013 08:40:42 +0000 (09:40 +0100)]
Rewrap a comment in constants.py

As it was 80 chars, and you know that bothers me :)

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

11 years agoEnable split queries for export in CLI
Iustin Pop [Fri, 22 Feb 2013 12:18:45 +0000 (13:18 +0100)]
Enable split queries for export in CLI

Rapi doesn't seem to export backup lists, so we enable the split query
only in gnt-backup.

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

11 years agoImprove the rpc-test program
Iustin Pop [Fri, 22 Feb 2013 11:25:18 +0000 (11:25 +0000)]
Improve the rpc-test program

This is an ugly patch, sorry. It adds the following features to
rpc-test, to help with (stress) testing the Haskell RPC client:

- customisable repeat count for the RPCs
- customisable parallelisation factor
- options to show timing stats and other information
- capability to execute any RPCs already defined, as opposed to having
  the RPC hardcoded; this requires a data file (defaulting to
  "rpc.json") that has the serialised RPC call

The polymorphism/way the RPC library is implemented requires us to
have some duplicate code (operating on different types); I wasn't able
to found a way to make this more abstract.

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

11 years agoImplement Export queries in Haskell
Iustin Pop [Thu, 21 Feb 2013 16:52:15 +0000 (17:52 +0100)]
Implement Export queries in Haskell

This is a simple query as it has only two fields, however it's the
first query that doesn't have a clear 'base' object and 1:1
correspondence between such objects and the results (groups, nodes and
networks do so).

We keep nodes as the 'base' object, since that's what we want to
filter on for RPC selection, and we have a very simple type as the
runtime type, since we only have one other field. The
'collectLiveData' function is the one that does the expansion from
[node] to [(node, path)], with the help of 'rpcExtractor'.

Also, this patch introduces a slightly different naming structure for
the exported names out of the module, to reduce naming conflicts.

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

11 years agoFix exports query with failed RPCs
Iustin Pop [Thu, 21 Feb 2013 16:41:34 +0000 (17:41 +0100)]
Fix exports query with failed RPCs

When the RPC to a node has failed (for whatever reason), we currently
return _FS_UNAVAIL, which means "this node doesn't support
exports". However, that is misleading: all nodes support exports, but
we failed to list them at the moment, so _FS_NODATA (temporary
failure) is more appropriate here.

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

11 years agoAdd export_list RPC call definitions
Iustin Pop [Thu, 21 Feb 2013 13:54:19 +0000 (14:54 +0100)]
Add export_list RPC call definitions

This is straightforward, as the call has no parameters and a very simple return type.

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

11 years agoImprove TemplateHaskell code to support empty objects
Iustin Pop [Thu, 21 Feb 2013 13:52:07 +0000 (14:52 +0100)]
Improve TemplateHaskell code to support empty objects

Currently, an empty objects will generate warnings as the arguments of
various functions are unused. By adding conditional code for this, we
can support generation of empty objects, e.g. like needed in Rpc code.

Additionally, the patch also converts RpcCallVersion to THH, now that
it can build it. We change the serialisation for this (from JSNull to
JSObject []), but this shouldn't matter as this is not used in
production.

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

11 years agoFix Curl/Internal.hs not being in gitignore
Iustin Pop [Thu, 21 Feb 2013 16:38:27 +0000 (17:38 +0100)]
Fix Curl/Internal.hs not being in gitignore

This is an autogenerated file, so it has to go into gitignore, thanks
Michael!

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

11 years agoAdd option to redirect luxi socket for debugging
Iustin Pop [Thu, 21 Feb 2013 12:51:03 +0000 (13:51 +0100)]
Add option to redirect luxi socket for debugging

Currently, the choice between masterd and conf/queryd is made
statically, based on whether a query is converted or not and whether
split queries are enabled. This makes it hard to test and develop
these new queries, so this patch adds an override for the socket.

The choice for going with two hardcoded strings and arbitrary socket
fallback is done so that it's easy to use this in virtual clusters as
well.

Additionally, the patch improves the error message on failed connects
when we use arbitrary sockets; before, it always "blamed" confd for
non-master sockets.

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

11 years agoFix another docstring typo
Iustin Pop [Thu, 21 Feb 2013 14:10:56 +0000 (15:10 +0100)]
Fix another docstring typo

… no comment :)

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

11 years agoImprove RAPI documentation on users and options
Michael Hanselmann [Thu, 21 Feb 2013 10:48:59 +0000 (11:48 +0100)]
Improve RAPI documentation on users and options

- Document fields in “rapi/users” file in the order they appear
  (username, password, options)
- Mention new “--require-authentication” option
- Clarify use of “write” on “GET” method

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

11 years agosphinx_ext: Drop text map for RAPI permissions
Michael Hanselmann [Thu, 21 Feb 2013 10:47:39 +0000 (11:47 +0100)]
sphinx_ext: Drop text map for RAPI permissions

Other parts of the documentation directly refer to the constants through
“pyeval”. There's no need for this map as it's just additional work to
maintain.

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

11 years agoRAPI: Add flag to require authentication
Michael Hanselmann [Wed, 20 Feb 2013 17:01:56 +0000 (18:01 +0100)]
RAPI: Add flag to require authentication

Most RAPI resources do not require authentication for the “GET” method.
In some setups it can be desirable to always require authentication.
This patch adds a command line parameter to always require it.

Some unrelated minor typos in the “ganeti-rapi” man page are also fixed.

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

11 years agoDescribe format of the monitoring agent HTTP queries
Michele Tartara [Thu, 21 Feb 2013 08:30:21 +0000 (09:30 +0100)]
Describe format of the monitoring agent HTTP queries

The previous patch was incomplete when erroneously pushed.

This patch, originally intended as part of the previous one, fixes it.

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

11 years agoDescribe format of the monitoring agent HTTP queries
Michele Tartara [Tue, 19 Feb 2013 14:52:35 +0000 (15:52 +0100)]
Describe format of the monitoring agent HTTP queries

Update the monitoring agent design document adding the format of the HTTP
queries that will have to be used to query the monitoring agent.

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

11 years agoRemove test of obsolete getNetworkUuid method
Helga Velroyen [Wed, 20 Feb 2013 12:07:02 +0000 (13:07 +0100)]
Remove test of obsolete getNetworkUuid method

This will remove the tests for the getNetworkUuid method.
The method will be obsolete after the changes regarding
identification of networks by UUID and not name are merged
into master. Will send another patch for removing the
actual method.

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

11 years agoSwitch the RPC module over to the multi interface
Iustin Pop [Wed, 20 Feb 2013 11:14:57 +0000 (12:14 +0100)]
Switch the RPC module over to the multi interface

This replaces the very-basic parMap of IO actions (fully serialised,
as parMap won't work here), to the multi interface.

This makes a simple "time gnt-node list" on a 6-node cluster go from
3.2s to ~0.9s, and allows even better parallelisation - before,
curlGetString was blocking, whereas the new interface does allow some
interleaving.

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

11 years agoAdd a Ganeti-specific implementation of Curl Multi
Iustin Pop [Wed, 20 Feb 2013 10:49:07 +0000 (11:49 +0100)]
Add a Ganeti-specific implementation of Curl Multi

As we want to be able to run queries against multiple nodes in
parallel, and furthermore in parallel with other work, we need to
implement the Curl Multi interface (see libcurl-multi(3)).

This patch adds a Ganeti-specific such implementation, to be used
until upstream Curl bindings provide it. The implemented interface
(there are two 'multi' interfaces) is the older curl_multi_perform(3).

It has one downside (which is also, somewhat, and advantage): we use
polling instead of more properly select() or poll. This is due to how
waiting for FDs is implemented in Haskell: currently, it's not
possible to wait for multiple FDs at once nicely, so we'd have to fork
many threads for each FD to be watched, or alternatively one could use
FFI select, but that would block the entire runtime.

With the current poll method, the implementation achieves consistent
~100 RPC/s per second (with 10 multi interfaces running in parallel,
each with 10 easy handles), and over ~1 hour of runtime the memory
usage is stable, so memory allocation/deallocation (manual when
dealing with FFI) _seems_ to be well handled.

Future optimisations could be to move to curl_multi_socket_action(3),
which might allow better integration with the Haskell runtime.

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

11 years agoAdd two utility functions for handling Either lists
Iustin Pop [Tue, 19 Feb 2013 13:26:48 +0000 (14:26 +0100)]
Add two utility functions for handling Either lists

These two functions permit operating in bulk on only the Left or Right
values in the original list, then reassembling the list back in the
original order.

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

11 years agoSimplify RPC error cases
Iustin Pop [Fri, 30 Nov 2012 01:24:56 +0000 (02:24 +0100)]
Simplify RPC error cases

This patch removes the node from the RPC error constructurs
CurlLayerError and OfflineNodeError. The rationale is that we anyway
return tuples (node, result), and removing this duplication allows
simplified signatures/calls in the execution of RPC calls.

Note: this was sent before as well, resending on top of current codebase.

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

11 years agoReduce duplication of curl options computation
Iustin Pop [Fri, 30 Nov 2012 01:36:57 +0000 (02:36 +0100)]
Reduce duplication of curl options computation

Some curl option are request-specific, but not node specific: e.g. rpc
timeout, etc. The patch changes the HttpClientRequest type so that we
can pre-seed such options, instead of rebuilding the list in each
individual request execution.

Note: this was sent before and LGTMed, but on a different codebase, so
resending an updated version.

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

11 years agoSwitch the curl bindings from optional to required
Iustin Pop [Fri, 15 Feb 2013 13:08:17 +0000 (14:08 +0100)]
Switch the curl bindings from optional to required

Currently, we support curl being optional via some sporting exercises:
ifdefs in the code, data types that represent 'Curl is disabled'
state, etc. However, with the future work on RPC, we would have to
even make the dependencies list conditional on it, etc. This is too
much work, when the curl library is included even in stable
distributions.

This patch changes curl from option to required, the same as the other
base libraries.

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

11 years agoqa_config.AcquireNode: Use sort key function
Michael Hanselmann [Wed, 6 Feb 2013 13:04:47 +0000 (14:04 +0100)]
qa_config.AcquireNode: Use sort key function

Use a sort key function instead of using a comparing function (“cmp=…”).
The latter is not supported in Python 3 and using a sort key function is
easier.

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

11 years agoqa_config: Add __repr__ for instance/node classes
Michael Hanselmann [Wed, 6 Feb 2013 13:04:43 +0000 (14:04 +0100)]
qa_config: Add __repr__ for instance/node classes

Having a readable representation makes debugging easier.

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

11 years agoLocking fixes regarding Issue 324
Dimitris Aragiorgis [Tue, 19 Feb 2013 17:41:48 +0000 (19:41 +0200)]
Locking fixes regarding Issue 324

LUNetworkConnect/LUNetworkDisconnect, in case locking is used, might
lock instances that exist in the requested node group. The acquired
locks should be checked if they are correct at the beginning of
CheckPrereq() via _CheckNodeGroupInstances().

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Michael Hanselmann <hansmi@google.com>

11 years agoTest "GetNodeInfo" for Xen hypervisor
Michael Hanselmann [Wed, 6 Feb 2013 13:56:03 +0000 (14:56 +0100)]
Test "GetNodeInfo" for Xen hypervisor

This patch adds unit tests for success and failure of the “GetNodeInfo”
method for the Xen hypervisor abstractions.

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

11 years agoFix small typo in a docstring
Iustin Pop [Wed, 20 Feb 2013 14:57:10 +0000 (15:57 +0100)]
Fix small typo in a docstring

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

11 years agoQA: Add validation for cluster name
Michael Hanselmann [Wed, 6 Feb 2013 11:40:52 +0000 (12:40 +0100)]
QA: Add validation for cluster name

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

11 years agoQA: Acquire instance via method
Michael Hanselmann [Wed, 6 Feb 2013 10:15:35 +0000 (11:15 +0100)]
QA: Acquire instance via method

Also make “used” a property.

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

11 years agocheck-news: Ensure release date is within three days
Michael Hanselmann [Wed, 20 Feb 2013 12:58:04 +0000 (13:58 +0100)]
check-news: Ensure release date is within three days

Commit b6ad806f contained a date a month in the future. With this patch
all release dates in NEWS may at most be three days into the future
(assuming the build machine's clock is correct).

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

11 years agoMerge branch 'devel-2.7'
Michael Hanselmann [Wed, 20 Feb 2013 13:05:22 +0000 (14:05 +0100)]
Merge branch 'devel-2.7'

* devel-2.7:
  NEWS: Fix the fix in commit 82b6f9a
  NEWS: Fix release date for 2.7.0 beta1
  Minor fixes regarding nic.network change
  Fix issue 378
  NEWS: Mention multi-alloc and fix typo
  Add cfgupgrade for changing nic.network to uuid
  Remove useless code in backend for network hooks
  Show network name and not uuid in instance info
  Add IQ_NETWORKS in query tests
  Implement network locking in Instance queries
  Changes in query to support nic.network as uuid
  Modify query LUs to supoprt nic.network as uuid
  Add GetInstanceNetworks() config method
  cmdlib changes to support nic.network as uuid
  Make network config methods take uuid as argument
  Document possible hypervisor bug in serial_console
  Update man pages wrt ExtStorage

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

11 years agoNEWS: Fix the fix in commit 82b6f9a
Michael Hanselmann [Wed, 20 Feb 2013 12:41:59 +0000 (13:41 +0100)]
NEWS: Fix the fix in commit 82b6f9a

February 2, 2013 was a Wednesday, not a Thursday.

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

11 years agoNEWS: Fix release date for 2.7.0 beta1
Michael Hanselmann [Wed, 20 Feb 2013 11:43:47 +0000 (12:43 +0100)]
NEWS: Fix release date for 2.7.0 beta1

Commit b6ad806f used a wrong date.

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

11 years agoBuild table with access permissions for RAPI resources
Michael Hanselmann [Thu, 14 Feb 2013 15:20:06 +0000 (16:20 +0100)]
Build table with access permissions for RAPI resources

Sometimes it can be difficult to determine the access permissions needed
for a certain RAPI resource without looking at code. This table, added
at the end of “rapi.rst”, shows all resources and the permissions needed
for their methods.

Another nice side-effect of this change is that there's an automatic
cross-checking between implemented resources and methods and the
documentation.

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

11 years agoAllow generating different RAPI resource lookup tables
Michael Hanselmann [Tue, 12 Feb 2013 12:38:53 +0000 (13:38 +0100)]
Allow generating different RAPI resource lookup tables

Until now the RAPI resource table returned by
“rapi.connector.GetHandlers” always uses fixed strings or compiled
regular expressions as dictionary keys. Now that a table of all RAPI
resources (and their access rights) should be written for the
documentation, a plain string version of the URIs must be available. The
compiled pattern might contain escape sequences and is not suitable.

This patch changes “GetHandlers” to accept a hook function which is used
to translate non-static resource URIs such as “/2/jobs/[job_id]/wait”.
The default implemention retains the original behaviour by translating
to compiled regular expressions.

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

11 years agoHRoller design updates
Guido Trotter [Fri, 15 Feb 2013 16:44:28 +0000 (17:44 +0100)]
HRoller design updates

- Specify that there will be options for selecting nodes by at least
  nodegroups and tags, rather than just individually.
- Specify a better handling for non-redundant instances (eg. plain or
  file) which today are simply ignored
- Specify that the rolling maintenance behavior is triggered by
  instances being up, but also overridable
- Remove execution of rolling maintenances altogether, as it is deemed
  unsafe in the current version, and move it to future work, discuss the
  requirements that were pointed out for it to be safe.

Cosmetic:
- Fix numbered list, which were rendered incorrectly in the HTML version

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

11 years agoMinor fixes regarding nic.network change
Dimitris Aragiorgis [Tue, 19 Feb 2013 16:28:42 +0000 (18:28 +0200)]
Minor fixes regarding nic.network change

Make LookupNetwork() return None in case target is None. This fixes
Issue 380. Rapi passes network=None and the lookup should not fail.

Make network client aware of new nic.network.gnt-network info shows
the IPs of each instance inside the network.  It parses nic.networks
field of QueryInstances() output, which now is a list of uuids an
not names.

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

11 years agobaserlib: Make "_OPCODE_ATTRS" public
Michael Hanselmann [Thu, 14 Feb 2013 16:44:25 +0000 (17:44 +0100)]
baserlib: Make "_OPCODE_ATTRS" public

"_OPCODE_ATTRS" will also be used in the Sphinx extension.

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

11 years agoMakefile: Add dependencies
Michael Hanselmann [Thu, 14 Feb 2013 16:10:41 +0000 (17:10 +0100)]
Makefile: Add dependencies

The RAPI documentation now depends on “connector.py” (handler
registration) and “rlib2.py” (access permissions).

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

11 years agoRAPI documentation: Add link targets
Michael Hanselmann [Thu, 14 Feb 2013 15:19:45 +0000 (16:19 +0100)]
RAPI documentation: Add link targets

A newly added table of RAPI access permissions will link to all
resources and their supported methods. For this reason link targets need
to be added.

The GET method on “/2/nodes/[node_name]” was not separately mentioned.
This is also fixed.

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

11 years agoFix issue 378
Dimitris Aragiorgis [Tue, 19 Feb 2013 14:45:30 +0000 (16:45 +0200)]
Fix issue 378

In case a NIC is not inside a network then netinfo None. Thus
netinfo["name"] fails.

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

11 years agoHelper to retrieve access permissions for RAPI resource
Michael Hanselmann [Wed, 13 Feb 2013 12:43:33 +0000 (13:43 +0100)]
Helper to retrieve access permissions for RAPI resource

Merge similar code into a helper function.

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

11 years agoSphinx extension: Module-level constant for tab width
Michael Hanselmann [Thu, 14 Feb 2013 15:17:52 +0000 (16:17 +0100)]
Sphinx extension: Module-level constant for tab width

Use a module-level constant for the tab width.

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

11 years agoRAPI documentation: Assertion for console fields
Michael Hanselmann [Thu, 14 Feb 2013 15:38:10 +0000 (16:38 +0100)]
RAPI documentation: Assertion for console fields

Assert that the documented fields are equal to those in the actual
object.

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

11 years agoStatus change reason support for Reboot
Michele Tartara [Tue, 12 Feb 2013 09:21:03 +0000 (09:21 +0000)]
Status change reason support for Reboot

Add support to the Reboot command for specifying the reason for the last
status change.

Some features are implemented as functions, even if used only once, because
they will be used by the future patches introducing reason support for all
the others commands able to alter the state of instances.

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

11 years agoInfrastructure for specifying instance status change reason
Michele Tartara [Tue, 12 Feb 2013 09:15:46 +0000 (09:15 +0000)]
Infrastructure for specifying instance status change reason

This patch introduces some infrastructural modifications that will be used by
the following commits to implement the support for specifying the reason for
the last status change of an instance.

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

11 years agoNEWS: Mention multi-alloc and fix typo
Michael Hanselmann [Thu, 14 Feb 2013 15:55:07 +0000 (16:55 +0100)]
NEWS: Mention multi-alloc and fix typo

As far as I could see, the ability to allocate multiple instances via
RAPI was not mentioned at all. A superfluous word is also removed.

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

11 years agoUnit tests for Query/Network.hs
Helga Velroyen [Thu, 7 Feb 2013 17:30:04 +0000 (18:30 +0100)]
Unit tests for Query/Network.hs

This patch adds a couple of unit tests for Query/Network.hs.
Note that they'll need to be adapted, once issue 362 is addressed.

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

11 years agoMake Confd client usable for testing
Michele Tartara [Tue, 5 Feb 2013 09:43:16 +0000 (09:43 +0000)]
Make Confd client usable for testing

Allow the Confd client to be able to connect to an arbitrary server
instead of just the real one running on a cluster.

This is meant to be used for testing.

If a data collector using the Confd client is tested with shelltest, it will
need to receive through the CLI the address and port of the server, and also the
FQDN for which information is being requested. In normal usage it will likely be
the name of the node the data collector is running on, but for testing we need a
way to explicitly specify it so that it corresponds to the one used inside the
configuration files that the test confd server is reading.

So, optConfdAddr and optConfdPort and optNode are provided by this patch, even
if not used, because they are an important part of the modifications for making
the Confd client testable.

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

11 years agoAdd Haskell parser for "xm uptime"
Michele Tartara [Wed, 6 Feb 2013 08:24:49 +0000 (09:24 +0100)]
Add Haskell parser for "xm uptime"

In order to fetch precise information about the uptime of the VMs
running in Xen, we need to analyze the output of the "xm uptime" command.

This commit adds the parser to do that, and its tests.

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

11 years agoAdd Haskell parser for "xm list --long"
Michele Tartara [Fri, 18 Jan 2013 10:10:47 +0000 (11:10 +0100)]
Add Haskell parser for "xm list --long"

In order to fetch precise information about the status of the VMs running in
Xen, we need to analyze the output of the "xm list --long" command.

This commit adds the parser to do that, and its tests.

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