ganeti-local
10 years agoUpdate htools text-backend documentation
Bernardo Dal Seno [Tue, 4 Jun 2013 23:13:35 +0000 (01:13 +0200)]
Update htools text-backend documentation

Both instances and nodes have new fields.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

11 years agoUse RpcResult.Warn where appropriate the cmdlib
Klaus Aehlig [Tue, 4 Jun 2013 16:11:39 +0000 (18:11 +0200)]
Use RpcResult.Warn where appropriate the cmdlib

To avoid repetitive code, make use of the functionality factored
out to the Warn method of RpcResult.

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

11 years agoAdd a Warn function to RpcResult
Klaus Aehlig [Tue, 4 Jun 2013 15:19:31 +0000 (17:19 +0200)]
Add a Warn function to RpcResult

At various places, LU code just wants to warn about
a failed rpc, but continue nevertheless. So factor out
that common checking, message formatting, and notifying.

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

11 years agoFix shadowing of library function
Michele Tartara [Mon, 3 Jun 2013 16:43:13 +0000 (12:43 -0400)]
Fix shadowing of library function

The "reads" field shadows a library function from Prelude. This commit
fixes the problem.

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

11 years agoAdd shelltests for diskstats
Michele Tartara [Wed, 29 May 2013 21:40:30 +0000 (21:40 +0000)]
Add shelltests for diskstats

Check that the behavior of running the diskstats data collector is as
expected.

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

11 years agoLet the monitoring daemon provide the diskstats collector
Michele Tartara [Wed, 29 May 2013 21:08:14 +0000 (17:08 -0400)]
Let the monitoring daemon provide the diskstats collector

Add the collector to the list of those provided my the monitoring daemon.

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

11 years agoAdd diskstats data collector
Michele Tartara [Wed, 29 May 2013 20:29:36 +0000 (20:29 +0000)]
Add diskstats data collector

Add a new data collector responsible for gathering disk performance
statistics.

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

11 years agoAdd constant with the path of the diskstats
Michele Tartara [Wed, 29 May 2013 20:11:10 +0000 (20:11 +0000)]
Add constant with the path of the diskstats

This will be used by the diskstats storage collector.

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

11 years agoAdd a CLI parameter for input files
Michele Tartara [Wed, 29 May 2013 20:09:22 +0000 (20:09 +0000)]
Add a CLI parameter for input files

For many data collectors it is useful (especially for testing) to have to
possibility to specify an input file.

This commit adds a generic option for doing that.

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

11 years agoAdd unit tests for the Diskstats parser
Michele Tartara [Tue, 28 May 2013 21:16:55 +0000 (17:16 -0400)]
Add unit tests for the Diskstats parser

Add one test parsing an actual /proc/diskstats file and one QuickCheck
test.

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

11 years agoAdd function for generating arbitrary non-negative numbers
Michele Tartara [Tue, 28 May 2013 21:14:00 +0000 (17:14 -0400)]
Add function for generating arbitrary non-negative numbers

In many tests it is useful to have the possibility to easily generate
non-negative integer numbers.

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

11 years agoFactor out and rename testFile function
Michele Tartara [Fri, 24 May 2013 11:53:08 +0000 (13:53 +0200)]
Factor out and rename testFile function

The testFile function used in the DRBD parser test file can actually be
useful in any case where a parser has to be tested.

This patch moves it to the TestCommon file, and renames it to a more meaningful
testParser.

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

11 years agoFix erroneous docstring
Michele Tartara [Fri, 24 May 2013 08:40:19 +0000 (10:40 +0200)]
Fix erroneous docstring

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

11 years agoFix erroneously ordered files in Makefile.am
Michele Tartara [Thu, 23 May 2013 18:12:45 +0000 (20:12 +0200)]
Fix erroneously ordered files in Makefile.am

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

11 years agoAdd /proc/diskstats parser
Michele Tartara [Thu, 23 May 2013 17:53:19 +0000 (19:53 +0200)]
Add /proc/diskstats parser

Add a parser for interpreting the content of the /proc/diskstats file,
providing information about the state of the disks of the system.

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

11 years agoAdd design for diskstats data collector
Michele Tartara [Thu, 23 May 2013 16:18:41 +0000 (16:18 +0000)]
Add design for diskstats data collector

This patch adds the design for the lowest level storage collector,
gathering data about disk usage statistics.

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

11 years agoModify storage collector design
Michele Tartara [Thu, 23 May 2013 12:19:33 +0000 (12:19 +0000)]
Modify storage collector design

Specify better how the storage collectors will actually be implemented.

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

11 years agoUnit tests for spindles and exclusive storage in htools
Bernardo Dal Seno [Thu, 30 May 2013 15:22:59 +0000 (17:22 +0200)]
Unit tests for spindles and exclusive storage in htools

Everything should work the same when exclusive storage is active, as
spindles are not yet handled as a resource. A new test has been added for
the interactions between spindles and policies.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

11 years agoCheck real spindles in ipolicies
Bernardo Dal Seno [Fri, 24 May 2013 16:43:15 +0000 (18:43 +0200)]
Check real spindles in ipolicies

When exclusive storage is enabled, the spindles in instance disks are used
to check the instance policies (as outlined in design-partitioned.rst).

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

11 years agoCheck the full instance specs in htools
Bernardo Dal Seno [Wed, 29 May 2013 18:50:42 +0000 (20:50 +0200)]
Check the full instance specs in htools

Spindles and disk count are checked too. Existing functions have been
refactored, so common parts are not duplicated.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

11 years agoAdd spindles to instance disks in htools
Bernardo Dal Seno [Sun, 26 May 2013 20:14:02 +0000 (22:14 +0200)]
Add spindles to instance disks in htools

A new data type is introduced for disks to store both size and spindles.
When available, spindles are filled with input data. Except for loading and
storing, spindles are ignored.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

11 years agoExport instance disk spindles
Bernardo Dal Seno [Mon, 27 May 2013 13:51:06 +0000 (15:51 +0200)]
Export instance disk spindles

Instance disk spindles can be queried via LUXI and RAPI, and are exported
through the allocator interface. This is a prerequisite for htools to
handle spindles.

The length of a RAPI query including all the instance fields now has become
~4400 characters. For this reason the server buffer has been increased.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

11 years agoLoad exclusive_storage in htools
Bernardo Dal Seno [Sun, 26 May 2013 19:23:18 +0000 (21:23 +0200)]
Load exclusive_storage in htools

The node parameter is loaded into the data structures. No behavior is yet
modified.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

11 years agoNew function to load JSON arrays of optional values
Bernardo Dal Seno [Tue, 28 May 2013 18:58:12 +0000 (20:58 +0200)]
New function to load JSON arrays of optional values

This will be needed to load spindles in some htools backends. Unit tests
provided.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

11 years agoAdd unit test for text backend + fix bug
Bernardo Dal Seno [Mon, 27 May 2013 22:12:19 +0000 (00:12 +0200)]
Add unit test for text backend + fix bug

Test serialization and deserialization of instances. Fix check of secondary
node.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

11 years agoTest with non-redundant instances and several node-groups
Klaus Aehlig [Tue, 28 May 2013 13:42:22 +0000 (15:42 +0200)]
Test with non-redundant instances and several node-groups

The example cluster contains two node groups. The first contains three nodes,
with two non-redundant instances each. As each node has only capacity for three
instances, the nodes have to be rebooted individually. Additionally, there is
a separate node-group with additional of capacity, which, however, cannot be used,
as instances are supposed to be moved within a node-group only.

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

11 years agoRestrict instance moves in hroller to the same node group
Klaus Aehlig [Fri, 31 May 2013 08:39:34 +0000 (10:39 +0200)]
Restrict instance moves in hroller to the same node group

When scheduling rolling reboots, hroller looks for nodes to evacuate
the non-redundant instances to. This is done by greedily moving
instances to other nodes that can take them, policy wise and capacity
wise. There is, however, another restriction to be taken into account:
instances should only be moved within a node group. This is achieved
by this patch.

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

11 years agoMerge branch 'stable-2.8' into master
Bernardo Dal Seno [Fri, 31 May 2013 13:36:42 +0000 (15:36 +0200)]
Merge branch 'stable-2.8' into master

* stable-2.8:
  Document users-setup tool
  Adjusting permissions after confd start
  Ensure the queue socket has the right permissions
  Update IAllocator interface documentation
  Add NEWS entry for hail honoring networks
  Add tests for network-aware allocation
  Honor network connections in hail
  Parse NIC data from allocation request in hail
  Support group networks in Text backend
  Parse node group networks
  Update IAllocator interface documentation
  Export connected networks to IAllocator
  Re-activate previously active disks in watcher
  Make the disks_active flag queryable
  Consider disks_active in UpgradeConfig
  Add disks_active to configuration
  Fix release of instances in QA

Conflicts:
tools/cfgupgrade

tools/cfgupgrade was modified in stable-2.8 to remove a new parameter when
downgrading to 2.7, but this shouldn't go into the 2.9 version of
cfgupgrade.

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

11 years agoMove an item into the correct section of NEWS
Bernardo Dal Seno [Fri, 31 May 2013 11:42:50 +0000 (13:42 +0200)]
Move an item into the correct section of NEWS

The removal of '--no-lvm-storage' happened on the master/2.9 branch.

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

11 years agoMerge branch 'stable-2.7' into stable-2.8
Bernardo Dal Seno [Fri, 31 May 2013 10:10:00 +0000 (12:10 +0200)]
Merge branch 'stable-2.7' into stable-2.8

* stable-2.7:
  Document users-setup tool
  Adjusting permissions after confd start
  Ensure the queue socket has the right permissions
  Update IAllocator interface documentation

Conflicts:
doc/iallocator.rst

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

11 years agokvm: Use -uuid to set system UUID
Christos Stavrakakis [Thu, 30 May 2013 10:34:50 +0000 (13:34 +0300)]
kvm: Use -uuid to set system UUID

Use kvm '-uuid' option to set guest's system UUID to instance's UUID.

Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoDocument users-setup tool
Michele Tartara [Thu, 30 May 2013 20:42:25 +0000 (16:42 -0400)]
Document users-setup tool

The users-setup tool was added but had no documentation up to now. This commit
fixes this issue.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoSupport spindles in move-instance
Bernardo Dal Seno [Wed, 29 May 2013 16:29:27 +0000 (18:29 +0200)]
Support spindles in move-instance

The script was failing when exclusive storage was active (bug introduced in
7c848a6a).

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>

11 years agoAdjusting permissions after confd start
Helga Velroyen [Wed, 29 May 2013 09:40:35 +0000 (11:40 +0200)]
Adjusting permissions after confd start

This is a workaround for issue 477. Confd resets the
permissions of the query socket in a wrong way. This
patch fixes them after the start of confd.

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

11 years agoEnsure the queue socket has the right permissions
Guido Trotter [Wed, 29 May 2013 05:07:30 +0000 (14:07 +0900)]
Ensure the queue socket has the right permissions

RAPI needs to be able to perform queries as well.

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

11 years agoUpdate IAllocator interface documentation
Thomas Thrainer [Thu, 23 May 2013 15:43:41 +0000 (17:43 +0200)]
Update IAllocator interface documentation

Update the missing documentation for the tags fields of node groups.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
(partially cherry picked from commit 2daca99b5be21ea4667637721ee2c65a14444520)

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoAdd NEWS entry for hail honoring networks
Thomas Thrainer [Thu, 23 May 2013 07:46:42 +0000 (09:46 +0200)]
Add NEWS entry for hail honoring networks

The entry also mentions the required change in the IAllocator protocol.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoAdd tests for network-aware allocation
Thomas Thrainer [Thu, 16 May 2013 12:56:26 +0000 (14:56 +0200)]
Add tests for network-aware allocation

hail-alloc-invalid-network defines a cluster with two nodegroups and an
allocation request which does not fit on any of the groups. Group 1 has
invalid disk-templates while Group 2 is not connected to the right
networks.

hail-alloc-restricted-network defines a cluster wih two nodegroups.
Nodegroup Group 1 is only used as last_resort group, but is chosen by
hail as only this group is connected to the right networks.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoHonor network connections in hail
Thomas Thrainer [Thu, 16 May 2013 14:58:00 +0000 (16:58 +0200)]
Honor network connections in hail

Before trying to allocate nodes in node groups, node groups are now
filtered based on the networks they are connected to an the networks
which are required by the new instance.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoParse NIC data from allocation request in hail
Thomas Thrainer [Tue, 21 May 2013 06:08:04 +0000 (08:08 +0200)]
Parse NIC data from allocation request in hail

Add a NIC type and extend the Instance type by a list of NIC's. Parse
the NIC's in allocation requests and store them for now. Later patches
will make use of this field in order to ensure that the requested
instance is only placed in node groups wich are connected to those
networks.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoSupport group networks in Text backend
Thomas Thrainer [Fri, 24 May 2013 08:03:02 +0000 (10:03 +0200)]
Support group networks in Text backend

The Text backend now parses network UUID (comma separated) and
serializes them in the same form.
The test data is adapted to the new format.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoParse node group networks
Thomas Thrainer [Fri, 17 May 2013 11:39:07 +0000 (13:39 +0200)]
Parse node group networks

Extend the Group by the network ids it is connected to. Adapt
the IAlloc backend such that the networks are parsed correctly.
This also required the adaption of test data.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoUpdate IAllocator interface documentation
Thomas Thrainer [Thu, 23 May 2013 07:39:33 +0000 (09:39 +0200)]
Update IAllocator interface documentation

Document the newly added network field of node groups, and also update
the missing documentation for the other fields of node groups.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoExport connected networks to IAllocator
Thomas Thrainer [Thu, 16 May 2013 11:44:10 +0000 (13:44 +0200)]
Export connected networks to IAllocator

IAllocators should not put instances on nodes in nodegroups which are
not connected to the network the instance should be connected to.
Therefore, export the networks a node group is connected to to the
IAllocator, so it can account for this restriction.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoAdd generic daemon options support binding to interfaces
Klaus Aehlig [Mon, 27 May 2013 12:22:01 +0000 (14:22 +0200)]
Add generic daemon options support binding to interfaces

In some situations, it is desirable to bind one of our servers only to
a particular interface, like eth0, instead of an IP address. Therefore,
add an option -i to specify an interface; its address will then be bound
to.

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

11 years agoUpdate ganeti-rapi man page
Klaus Aehlig [Tue, 28 May 2013 12:32:15 +0000 (14:32 +0200)]
Update ganeti-rapi man page

ganeti-rapi supports a couple of options not yet mentioned in the
man page; mention them.

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

11 years agoComplete ganeti-noded synopsis line
Klaus Aehlig [Tue, 28 May 2013 12:03:40 +0000 (14:03 +0200)]
Complete ganeti-noded synopsis line

The synopsis section of the ganeti-noded man page, certain options
were only mentioned in the description. Add then to the synopsis
line as well.

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

11 years agoRe-activate previously active disks in watcher
Thomas Thrainer [Wed, 15 May 2013 11:58:06 +0000 (13:58 +0200)]
Re-activate previously active disks in watcher

The watcher process previously (incorrectly) examined the admin_state
field to figure out if the disks of an instance should be activated
after a node reboot. This is changed to use the disks_active field of
instances, which always holds the correct information (even if the
instance should not be started, but only its disks activated).

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

11 years agoMake the disks_active flag queryable
Thomas Thrainer [Wed, 15 May 2013 11:57:25 +0000 (13:57 +0200)]
Make the disks_active flag queryable

gnt-instance list now also supports the disks_active field.

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

11 years agoConsider disks_active in UpgradeConfig
Thomas Thrainer [Thu, 16 May 2013 09:13:24 +0000 (11:13 +0200)]
Consider disks_active in UpgradeConfig

The disks_active flag is updated when masterd reads the configuration.
Also, cfgupgrade now removes the disks_active flag during downgrades.

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

11 years agoAdd disks_active to configuration
Thomas Thrainer [Wed, 15 May 2013 11:55:30 +0000 (13:55 +0200)]
Add disks_active to configuration

This flag tracks if the disks of an instace are supposed to be active.
That's the case when an instance is running or when its disks got
activated explicitly (and in a couple of other cases).
It will be used by watcher to re-activate disks after a node reboot.

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

11 years agoReport missing spindles in the configuration
Bernardo Dal Seno [Thu, 23 May 2013 22:45:26 +0000 (00:45 +0200)]
Report missing spindles in the configuration

cfgupgrade and cluster-verify run a check for missing spindles in disk
configuration when exclusive storage is enabled. The check in cfgupgrade
may give false positives due to the complexity of getting the correct value
of exclusive_storage for each instance.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoAdapt striping to the requested number of spindles
Bernardo Dal Seno [Fri, 24 May 2013 13:30:19 +0000 (15:30 +0200)]
Adapt striping to the requested number of spindles

Otherwise LVM may use a smaller number of PVs (spindles) to accommodate for
the default stripes.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoSpindles are mandatory with exclusive storage
Bernardo Dal Seno [Thu, 23 May 2013 21:44:02 +0000 (23:44 +0200)]
Spindles are mandatory with exclusive storage

If they are not specified in the command line an error is reported. Also,
disk creation would fail without them.

QA has been updated.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agognt-cluster repair-disk-sizes repairs spindles too
Bernardo Dal Seno [Thu, 23 May 2013 00:03:13 +0000 (02:03 +0200)]
gnt-cluster repair-disk-sizes repairs spindles too

When exclusive storage is active, any wrong or missing spindles information
in disks gets updated too.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoNew RPC to get size and spindles of disks
Bernardo Dal Seno [Wed, 22 May 2013 23:21:19 +0000 (01:21 +0200)]
New RPC to get size and spindles of disks

This RPC replaces the existing one that only returned disk size.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoNew BlockDev methods to get spindles
Bernardo Dal Seno [Wed, 22 May 2013 23:19:24 +0000 (01:19 +0200)]
New BlockDev methods to get spindles

Two new methods are created to get the number of spindles, one alone, and
one together with size. For devices that don't support spindles, None is
returned.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoAttaching a logical volume builds a list of PVs
Bernardo Dal Seno [Tue, 21 May 2013 22:33:08 +0000 (00:33 +0200)]
Attaching a logical volume builds a list of PVs

When an LV gets attached, the list of the PVs used by the LV is built. This
will be used to count spindles for exclusive_storage, but it could also be
useful to optimize disk growing and snapshotting.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoRefactor code for attaching a logical volume
Bernardo Dal Seno [Tue, 21 May 2013 20:27:58 +0000 (22:27 +0200)]
Refactor code for attaching a logical volume

The parsing of "lvs" output is moved into private methods. The code is
slightly more readable and testable. The split in two methods is useful
for the following patches. Unit tests for the new functions are
provided.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoFix release of instances in QA
Bernardo Dal Seno [Fri, 24 May 2013 23:19:07 +0000 (01:19 +0200)]
Fix release of instances in QA

Also, fix some uses of keyword arguments for arguments with a default
value, as required by the style guide, and a typo.

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

11 years agoFix missing "raise" in QA
Bernardo Dal Seno [Fri, 24 May 2013 10:41:38 +0000 (12:41 +0200)]
Fix missing "raise" in QA

The bug was introduced in 345d395d.

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

11 years agoMerge branch 'stable-2.8'
Guido Trotter [Fri, 24 May 2013 11:26:50 +0000 (13:26 +0200)]
Merge branch 'stable-2.8'

* stable-2.8:
  Bump up version for 2.7.0~rc2 release
  Create overall design document for 2.8
  Add NEWS entry for SO_PEERCRED fix
  Workaround missing SO_PEERCRED
  Add debugging clause to _ExpandCheckDisks error
  Reduce pylint maximum file length to 4500
  Mention hail network incompatibility in manpages
  Remove obsolete Debian-related documentation
  Update NEWS for 2.7.0 rc2
  Improve installation documentation
  Add Harep man page
  Stash Xen config file after a failed startup
  Fix owner of the OS log dir

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

11 years agoMerge branch 'stable-2.7' into stable-2.8
Guido Trotter [Fri, 24 May 2013 11:19:28 +0000 (13:19 +0200)]
Merge branch 'stable-2.7' into stable-2.8

* stable-2.7:
  Bump up version for 2.7.0~rc2 release
  Add NEWS entry for SO_PEERCRED fix
  Workaround missing SO_PEERCRED
  Add debugging clause to _ExpandCheckDisks error
  Mention hail network incompatibility in manpages
  Remove obsolete Debian-related documentation
  Update NEWS for 2.7.0 rc2
  Improve installation documentation
  Fix owner of the OS log dir

Conflicts:
lib/cmdlib.py: port to cmdlib/instance_storage.py
lib/tools/ensure_dirs.py: trivial

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

11 years agoBump up version for 2.7.0~rc2 release v2.7.0rc2
Guido Trotter [Fri, 24 May 2013 09:21:26 +0000 (11:21 +0200)]
Bump up version for 2.7.0~rc2 release

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

11 years agoQA for spindles in creating disks
Bernardo Dal Seno [Wed, 15 May 2013 19:47:20 +0000 (21:47 +0200)]
QA for spindles in creating disks

"gnt-instance add" and "gnt-instance recreate-disks" are tested giving the
number of spindles, when supported. Also, QA for "gnt-instance
recreate-disks" now covers the case where disks are resized.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

11 years agoCreate overall design document for 2.8
Michele Tartara [Fri, 3 May 2013 09:11:33 +0000 (11:11 +0200)]
Create overall design document for 2.8

Also, cleanup the list of draft designs.

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

11 years agocfgupgrade: Remove spindles on downgrade
Bernardo Dal Seno [Wed, 15 May 2013 00:17:56 +0000 (02:17 +0200)]
cfgupgrade: Remove spindles on downgrade

Spindles didn't exist in 2.8 and should be removed to downgrade.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

11 years agognt-instance info prints information about spindles
Bernardo Dal Seno [Tue, 14 May 2013 16:51:54 +0000 (18:51 +0200)]
gnt-instance info prints information about spindles

For each disk, the number of requested spindles (if present) is shown.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

11 years agoSpindles are used in creating new disks
Bernardo Dal Seno [Tue, 14 May 2013 15:59:55 +0000 (17:59 +0200)]
Spindles are used in creating new disks

The requested number of spindles is used to allocate PVs when creating new
LVs.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

11 years agoDocument disk device Create() functions
Bernardo Dal Seno [Tue, 14 May 2013 15:25:36 +0000 (17:25 +0200)]
Document disk device Create() functions

Document all the arguments and return values of bdev.Create() and
bdev.BlockDev.Create().

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

11 years agoAdd spindles field to disk object
Bernardo Dal Seno [Tue, 7 May 2013 16:37:05 +0000 (18:37 +0200)]
Add spindles field to disk object

The field is filled with the value provided on the command line.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

11 years agoCheck that spindles are not given when they are not allowed
Bernardo Dal Seno [Tue, 7 May 2013 15:35:14 +0000 (17:35 +0200)]
Check that spindles are not given when they are not allowed

Masterd checks that specifications for new disks don't include spindles
when exclusive storage is disabled.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

11 years agoAdd "spindles" option to instance disk creation commands
Bernardo Dal Seno [Mon, 6 May 2013 10:51:26 +0000 (12:51 +0200)]
Add "spindles" option to instance disk creation commands

The option is parsed but ignored, for the moment.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

11 years agoFix style inconsistencies in gnt-instance man page
Bernardo Dal Seno [Mon, 6 May 2013 09:31:09 +0000 (11:31 +0200)]
Fix style inconsistencies in gnt-instance man page

Escaping and initial capitals were not uniform.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

11 years agocfgupgrade: Downgrade is a NO-OP
Bernardo Dal Seno [Tue, 30 Apr 2013 14:07:17 +0000 (16:07 +0200)]
cfgupgrade: Downgrade is a NO-OP

The configuration is still the same as in 2.8 (the reference stable version
for this branch), so downgrade shouldn't do anything.

Unit tests are also updated, with a new 2.8 configuration file. The
configuration file used for the upgrade+downgrade test was tailored to the
2.7 downgrade, and it's not needed any more.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

11 years agoAdd NEWS entry for SO_PEERCRED fix
Guido Trotter [Wed, 22 May 2013 14:55:37 +0000 (16:55 +0200)]
Add NEWS entry for SO_PEERCRED fix

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

11 years agoDesign doc for internal shutdown detection
Michele Tartara [Fri, 17 May 2013 09:42:47 +0000 (10:42 +0100)]
Design doc for internal shutdown detection

Ganeti is currently not able to detect a legit shutdown request performed by a
user from inside a Xen domain.

This patch provides a design document to implement a mechanism able to cope with
such events.

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

11 years agoDocument recent hroller changes in the NEWS file
Klaus Aehlig [Wed, 22 May 2013 12:19:17 +0000 (14:19 +0200)]
Document recent hroller changes in the NEWS file

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoDocument hroller options recently added
Klaus Aehlig [Wed, 22 May 2013 12:57:16 +0000 (14:57 +0200)]
Document hroller options recently added

hroller now also supports the options --skip-non-redundant and
--ignore-non-redundant, and this should be documented in the
man page as well.

While there, also use the same order in the options section
as in the synopsis, and in the synopsis group the algorithms
into
- those that modify the set of nodes to be scheduled, and
- those that modify the constraints to be taken into account.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoWorkaround missing SO_PEERCRED
Guido Trotter [Wed, 22 May 2013 12:57:51 +0000 (14:57 +0200)]
Workaround missing SO_PEERCRED

This bug happens in a few new distributions, so we workaround it by
defining the constant ourselves, if it's missing.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

11 years agoAdd debugging clause to _ExpandCheckDisks error
Guido Trotter [Wed, 22 May 2013 12:52:32 +0000 (14:52 +0200)]
Add debugging clause to _ExpandCheckDisks error

This has been reported by users, so we should have the extra debugging
available.

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

11 years agoReduce pylint maximum file length to 4500
Thomas Thrainer [Wed, 22 May 2013 13:47:05 +0000 (15:47 +0200)]
Reduce pylint maximum file length to 4500

The longest Python files we still have are around 4200 lines long. In
order to prevent future growth, limit the maximum file length (checked
by pylint) to 4500 lines.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoExtend hroller tests by options for non-redundant instances
Klaus Aehlig [Wed, 22 May 2013 10:49:17 +0000 (12:49 +0200)]
Extend hroller tests by options for non-redundant instances

The cluster now consists of 3 nodes, with drbd instances between
nodes 1 and 2, and 2 and 3. Additionally, nodes 1 and 3 each contain
a non-redundant instance, but node 2 cannot hold two additional
instances.

So,
- if we take non-redundant instances into account (the new default
  behavior), the nodes have to be rebooted individually,
- if we ignore non-redundant instances, nodes 1 and 3 can be rebooted
  simultaneously, and
- if we skip nodes with non-redundant instances, only a single node
  remains (of course, forming a single reboot group).

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoMention hail network incompatibility in manpages
Guido Trotter [Wed, 22 May 2013 10:54:49 +0000 (12:54 +0200)]
Mention hail network incompatibility in manpages

We can't fix this in the 2.7 version, so it should be documented.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

11 years agoRemove obsolete Debian-related documentation
Thomas Thrainer [Wed, 22 May 2013 09:23:59 +0000 (11:23 +0200)]
Remove obsolete Debian-related documentation

This part of the documentation refers to Grub instead of Grub2, but
Grub2 has been the standard boot loader since Squeeze. As this part only
(wrongly) repeats the preceeding documentation, it's removed completely.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoUpdate NEWS for 2.7.0 rc2
Guido Trotter [Tue, 21 May 2013 08:00:43 +0000 (10:00 +0200)]
Update NEWS for 2.7.0 rc2

Move "local" entries at the bottom, and leave global 2.7 entries at the
top, as for the other releases.

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

11 years agoTest for hroller taking non-redundant instances into account
Klaus Aehlig [Tue, 14 May 2013 09:45:22 +0000 (11:45 +0200)]
Test for hroller taking non-redundant instances into account

The example cluster consists of 6 nodes, each hosting 2 instances and
having capacity for 3. So, while the drbd-induced graph consists of
only insulated nodes, no more than two nodes can be rebooted at the
same time.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agohroller: option to ignore non-redundant instances
Klaus Aehlig [Thu, 16 May 2013 17:36:47 +0000 (19:36 +0200)]
hroller: option to ignore non-redundant instances

Add an option to hroller restoring the old behavior on not taking
any non-redundant instances into account when forming reboot
groups.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoMake hroller also plan for non-redundant instances
Klaus Aehlig [Tue, 14 May 2013 09:34:03 +0000 (11:34 +0200)]
Make hroller also plan for non-redundant instances

Non-redundant instances need to be moved to a different node
before maintenance of the node. Even though they can be moved to
any node, there must be enough capacity to host the instances of the
reboot group to be evacuated.

This is achieved by greedily moving the non-redundant instances
to other nodes, till we run out of capacity. In this way we
refine the groups obtained by coloring the drbd-induced graph.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agohroller: option to skip nodes with non-redundant instances
Klaus Aehlig [Thu, 16 May 2013 15:12:33 +0000 (17:12 +0200)]
hroller: option to skip nodes with non-redundant instances

So far, hroller ignores the fact, that non-redundant instances exist.
One option to deal is non-redundant instances is to not schedule those
nodes for reboot. This is supported by adding the option --skip-non-redundant.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoRemove trailing whitespace
Klaus Aehlig [Thu, 16 May 2013 10:48:55 +0000 (12:48 +0200)]
Remove trailing whitespace

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoImprove installation documentation
Thomas Thrainer [Tue, 21 May 2013 09:53:06 +0000 (11:53 +0200)]
Improve installation documentation

Based on user feedback the installation documentation is clarified and
extended.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
(cherry picked from commit 3913eaa72b8a48706ca4caa59dd022fa1a05805a)

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoImprove installation documentation
Thomas Thrainer [Tue, 21 May 2013 09:53:06 +0000 (11:53 +0200)]
Improve installation documentation

Based on user feedback the installation documentation is clarified and
extended.

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

11 years agoRPC 'node_info': <storage_type,key> instead of vg_names
Helga Velroyen [Mon, 6 May 2013 20:10:21 +0000 (22:10 +0200)]
RPC 'node_info': <storage_type,key> instead of vg_names

This replaces the field 'vg_names' in the RPC call of 'node info' by
'storage_units'. A storage unit is a tuple <storage_type,key>
and a generalization of a vg_name. The list of vg names is replaced by
a list of storage units. The modified RPC call will be used to report
storage space for more than just lvm volume groups. What the 'key' is
depends on the storage type. For storage type lvm-vg, the key is the
volume group name. To keep backward compatibility, all functions that
use the old vg_names, convert them to a list where every volume group
is mapped to a tuple [('lvm-vg',volume_group)] before making the call.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>

11 years agoAdd Harep man page
Michele Tartara [Fri, 17 May 2013 15:18:46 +0000 (15:18 +0000)]
Add Harep man page

Add the man page for the Ganeti auto-repair tool.

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

11 years agoStash Xen config file after a failed startup
Balazs Lecz [Thu, 16 May 2013 11:32:54 +0000 (12:32 +0100)]
Stash Xen config file after a failed startup

This is a fix for a minor bug.
Currently, a failed Xen VM start results in a stale config file left
behind on the filesystem.
This change introduces a new log directory, where the Xen VM config
file is moved after a failed startup.

Signed-off-by: Balazs Lecz <leczb@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoMerge branch 'stable-2.8' into master
Bernardo Dal Seno [Fri, 17 May 2013 13:18:13 +0000 (15:18 +0200)]
Merge branch 'stable-2.8' into master

* stable-2.8: (45 commits)
  Update NEWS with disk creation fixes
  Sort cmdlib-related entries in Makefile.am
  cmdlib: Cleanup public/private functions
  cmdlib: Extract instance query related functionality
  cmdlib: Extract instance operation functionality
  cmdlib: Extract migration related functionality
  cmdlib: Extract storage related functionality
  Reformat and define exports in cmdlib/__init__.py
  Extract miscellaneous logical units from cmdlib
  Extract os related logical units from cmdlib
  Extract query related logical units from cmdlib
  Extract backup related logical units from cmdlib
  Extract instance related logical units from cmdlib
  Extract node related logical units from cmdlib
  Extract group related logial units from cmdlib
  Extract cluster related logical units from cmdlib
  Extract test logical units from cmdlib
  Extract network related logical units from cmdlib
  Extract tags related logical units from cmdlib
  Extract base classes from cmdlib
  ...

Conflicts:
devel/build_chroot
lib/cmdlib.py

devel/build_chroot is straightforward: one side has added versions, the
other has added one library. lib/cmdlib.py has been split in many files in
stable-2.8, so I've semi-manually applied the changes from master.

This merge also fixes a problem with merge f2d87a5e5, which partially
reverted changes from 912737ba by mistake.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

11 years agoFix owner of the OS log dir
Balazs Lecz [Fri, 17 May 2013 10:23:24 +0000 (11:23 +0100)]
Fix owner of the OS log dir

The OS log dir is used by noded, not masterd.

Signed-off-by: Balazs Lecz <leczb@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

11 years agoMerge branch 'stable-2.7' into stable-2.8
Bernardo Dal Seno [Fri, 17 May 2013 11:12:01 +0000 (13:12 +0200)]
Merge branch 'stable-2.7' into stable-2.8

* stable-2.7:
  Update NEWS with disk creation fixes
  Don't fail to deactivate master IP if already down
  Add QA for recreating single instance disks
  Add QA for gnt-instance modify --disk
  Clean up when "gnt-instance modify" fails to create a disk
  recreate-disks honors the prealloc_wipe_disks flag
  Introduce wrapper for cmdlib._WipeDisks()
  Don't catch an exception that cannot be raised
  Wipe disks added through "gnt-instance modify"
  Support /var/run being a symlink in upload
  Final NEWS and configure.ac update for 2.7.0~rc1
  gnt-job list: deal with non-ascii encoding in jobs

Conflicts:
NEWS
lib/cmdlib.py
qa/ganeti-qa.py
qa/qa-sample.json

NEWS, qa/ganeti-qa.py and qa/qa-sample.py had trivial conflicts. But I've
updated QA changes to use the new interfaces. lib/cmdlib.py was renamed and
split, so I had to semi-manually apply the changes to the new files. I had
to change the names of some functions by removing or adding the initial
underscore and update the imported names.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

11 years agoUpdate NEWS with disk creation fixes
Bernardo Dal Seno [Fri, 17 May 2013 00:40:21 +0000 (02:40 +0200)]
Update NEWS with disk creation fixes

Also document a couple more fixes.

Signed-off-by: Bernardo Dal Seno <bdalseno@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>