Statistics
| Branch: | Tag: | Revision:

root / lib @ 8ef418bb

# Date Author Comment
8ef418bb 06/12/2013 10:18 am Helga Velroyen

Remove XEN_CMD from constants, adjust to PowercycleNode

This patch extend the RPC to powercycle a node by a
hvparams parameter. This parameter is used by the
xen hypervisor to determine which xen command to use.
The respective LU is adjusted as well.

Since this was the last operation depending on the...

398fd4f6 06/12/2013 10:18 am Helga Velroyen

hv_xen.py: make hvparams mandatory, remove fallbacks

This patch removes the fallback to the xen command from the
auto config and adds an exception instead. Also, the
hvparams parameter of the functions GetCommand, _RunXen and
_GetInstanceList are made mandatory....

0200a1af 06/12/2013 10:18 am Helga Velroyen

Use hvparams in GetAllInstancesInfo

This patch extends the GetAllInstancesInfo method of the
hypervisors by a hvparams parameter. This change propagates
up to the RPC call all_instances_info, which also needed
to be extended. All callers of this call were adjusted...

0bbec3af 06/12/2013 10:18 am Helga Velroyen

Use hvparams in GetInstanceInfo

This patch extends the GetInstanceInfo function of the
hypervisors by an hvparams parameters. This leads to
an extension of the instance_info RPC call and the
adjustmend of all classes using this call.

Signed-off-by: Helga Velroyen <>...

c6ae283b 06/12/2013 10:18 am Helga Velroyen

backend.py: remove fallback implementation of GetNodeInfo

This removes the fallback implementation of the backend's
GetNodeInfo function to the old implementation. By now,
all calling code is adjusted to the new hvparams parameter
and thus, the old implementation should not be necessary...

a295eb80 06/12/2013 10:18 am Helga Velroyen

Adjust all callers of RPC 'call_node_info'

This patch contains all adjustments necessary to code that
uses the 'call_node_info' call. The adjustment is necessary
because the call's signature changed from receiving a list
of hypervisor names to a list of tuples...

030ab01a 06/12/2013 10:18 am Helga Velroyen

Add hvparams to RPC call 'node_info'

This patch adds the hvparams parameter to the RPC call
'node_info'. It also adjusts the related code in noded.py
and Query/Node.hs

Signed-off-by: Helga Velroyen <>
Reviewed-by: Thomas Thrainer <>

439e1d3f 06/12/2013 10:18 am Helga Velroyen

backend.py: use hvparams in GetNodeInfo

This patch extends the GetNodeInfo function of the backend
module by a hvparams parameter. For now, it contains a
fallback solution for when the parameter is None. This
fallback will be removed in a later patch of this series....

fac489a5 06/12/2013 10:17 am Helga Velroyen

hypervisors: add hvparams to GetNodeInfo

This patch extends the GetNodeInfo function of the
hypervisors by a hvparams parameter. The parameter
is currently only used by the xen hypervisor to determine
which xen toolstack ('xm' or 'xl') to use.

Signed-off-by: Helga Velroyen <>...

2609da63 06/12/2013 10:17 am Helga Velroyen

hv_xen.py: renaming residual 'xm' occurrences

Some methods still refered to 'xm', which is inaccurate now
that xen can also be run with 'xl'. No functional changes
otherwise.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Thomas Thrainer <>

194f0764 06/12/2013 10:17 am Helga Velroyen

Watcher: Use hvparams when listing instances

This patch makes the watcher use the hvparams from ssconf
to retrieve the list of instances from the hypervisors.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Thomas Thrainer <>

def6577f 06/12/2013 10:17 am Helga Velroyen

Include hvparams in ssconf files

The watcher needs access to the cluster's hypervisor
parameters. This patch extends the ssconf infrastructure
by adding a hvparams file for each hypervisor. The format
of the hvparams file is a simple key=value format.

Signed-off-by: Helga Velroyen <>...

8351df2f 06/12/2013 10:17 am Helga Velroyen

Use hvparams in instance migration

This patch makes use of hvparams on instance migration to
determine the list of instance before the migration. This way, in
xen, the xl/xm choice is respected.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Thomas Thrainer <>

5b0dfcef 06/12/2013 10:17 am Helga Velroyen

Verify: node info and instance list

This patch enhances node verification by:
- Factoring out the verification of the node info
and the instance list to increase testability.
- Make both of them use the hvparams parameter.

Signed-off-by: Helga Velroyen <>...

75bf3149 06/12/2013 10:17 am Helga Velroyen

Verify: xen toolstack, hypervisor and hvparams

This patch extends the node verification by:
- Adding a check for the xen toolstack when the hypervisor
is verified.
- Factoring out the hypervisor verification in a
subfunction to increase testability.
- Factoring out the hvparams verification in a...

8ac806e6 06/12/2013 10:17 am Helga Velroyen

rpc / noded: add hvparams to instance_list call

The 'instance_list' call needs to be extended to accept
hvparams. This is one of the few RPCs where it is
necessary, because there is no instance given whose
hvparams could be reused.

Signed-off-by: Helga Velroyen <>...

3361ab37 06/12/2013 10:17 am Helga Velroyen

backend.py: use instance's hvparams whenever possible

The backend module's function 'ListInstances' is called
within the module several times. In many cases, it is
possible to reuse the instance's hvparams for the
'ListInstances' call and thus avoiding having to extend...

2bff1928 06/12/2013 10:17 am Helga Velroyen

backend.py: GetInstanceListForHypervisor

In same cases, the call 'GetInstanceList' is only done for
one hypervisor. In those cases, it is more convenient to
not provide the full collection of hypervisor parameters
for all hypervisors, but only the ones for this hypervisor....

fac83f8a 06/12/2013 10:17 am Helga Velroyen

backend.py: hvparams in 'GetInstanceList'

Propagating the use of hvparams further up the calling
hierarchy, this patch makes the backend module use the
hvparams in 'GetInstanceList'. Unit tests provided.

Signed-off-by: Helga Velroyen <>...

58e356a9 06/12/2013 10:17 am Helga Velroyen

hv_xen.py: _RunXen and GetInstanceList use hvparams

Propagating the use of hvparams further up in the calling
hierarchy, the functions '_RunXen' and 'GetInstanceList'
use the given hvparams. Unit tests provided. Calling function
'StopInstance' adjusted in this patch as well....

ff19ac20 06/12/2013 10:17 am Helga Velroyen

hv_xen.py: rename RunXmList to RunInstanceList

Since one can retrieve xen's instance list with both, 'xm'
or 'xl', the function name 'RunXmList' is no longer
appropriate. Renaming it to 'RunInstanceList'. No
functional changes otherwise.

Signed-off-by: Helga Velroyen <>...

36bebc53 06/12/2013 10:17 am Helga Velroyen

hv_xen.py: rename GetXmList to GetInstanceList

Since one can retrieve xen's instance list via both 'xm'
or 'xl', it is no longer appropriate to call the function
'GetXmList'. This patch renames it to 'GetInstanceList'.
Other than that, there are no functional changes....

51a95d00 06/12/2013 10:17 am Helga Velroyen

hv_xen._GetCommand: retrieve xen command from hvparams

This patch adds a (so far optional) hvparams parameter
to the '_GetCommand' function. This dictionary is used
to retrieve the xen command (xm or xl). It is optional
for now to make the refactoring possible without breaking...

740394bc 06/12/2013 10:16 am Helga Velroyen

Add xen command (xm, xl) to hv parameters

This patch adds the xen command (xm, xl) as hypervisor
parameter to the constants and adds validation to
the xen hypervisors.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Thomas Thrainer <>

fe5a2780 06/11/2013 01:55 pm Klaus Aehlig

Make SubmitOpCode expect options without print_jobid

As opposed to SubmitOrSend, the SubmitOpCode function is
called also by commands not supporting submit options. Hence
only inspect these options, if they are actually present.

Signed-off-by: Klaus Aehlig <>...

d6cd74dd 06/11/2013 10:27 am Klaus Aehlig

Add an option to print job id of submitted jobs on stdout

When submitting a job, the job id, prefixed by 'JobID: ', is output to
stderr. While this is easy to understand for humans, for scripting, it
is more convenient to have (additionally) the id on stdout (and only...

f5d13a77 06/11/2013 10:26 am Klaus Aehlig

Add new command gnt_job wait

This command tacitly waits for a job to finish. In that
way, job dependency can also be handled in shell scripts.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Helga Velroyen <>

06fb92cf 06/07/2013 04:10 pm Bernardo Dal Seno

Export node spindles

Node spindles (queried live) are exported through the LUXI, RAPI, and
iallocator interfaces.

Signed-off-by: Bernardo Dal Seno <>
Reviewed-by: Klaus Aehlig <>

a1860404 06/07/2013 04:10 pm Bernardo Dal Seno

node_info RPC reports info about free spindles

node_info RPC can be used to get information about free/total spindles.

Signed-off-by: Bernardo Dal Seno <>
Reviewed-by: Klaus Aehlig <>

c7dd65be 06/05/2013 02:28 pm Klaus Aehlig

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 <>
Reviewed-by: Helga Velroyen <>

95e7e85e 06/05/2013 02:27 pm Klaus Aehlig

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 <>
Reviewed-by: Helga Velroyen <>

3dca2415 06/03/2013 06:09 pm Michele Tartara

Add constant with the path of the diskstats

This will be used by the diskstats storage collector.

Signed-off-by: Michele Tartara <>
Reviewed-by: Klaus Aehlig <>

5a13489b 06/03/2013 04:15 pm Bernardo Dal Seno

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 <>
Reviewed-by: Klaus Aehlig <>

0e514de1 06/03/2013 04:15 pm Bernardo Dal Seno

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...

342a9b3b 05/31/2013 04:36 pm Bernardo Dal Seno

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...
e41d5a22 05/31/2013 01:45 pm Bernardo Dal Seno

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
...

8feeb253 05/31/2013 05:05 am Christos Stavrakakis

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 <>
Signed-off-by: Guido Trotter <>
Reviewed-by: Guido Trotter <>

8526052d 05/29/2013 01:32 pm Guido Trotter

Ensure the queue socket has the right permissions

RAPI needs to be able to perform queries as well.

Signed-off-by: Guido Trotter <>
Reviewed-by: Helga Velroyen <>

98ae702b 05/29/2013 10:52 am Thomas Thrainer

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....

802ed2aa 05/28/2013 06:05 pm Klaus Aehlig

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...

d962dbf9 05/28/2013 04:05 pm Thomas Thrainer

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...

ca83454f 05/28/2013 04:05 pm Thomas Thrainer

Make the disks_active flag queryable

gnt-instance list now also supports the disks_active field.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Helga Velroyen <>

a8e07057 05/28/2013 04:05 pm Thomas Thrainer

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 <>
Reviewed-by: Helga Velroyen <>

1d4a4b26 05/28/2013 04:05 pm Thomas Thrainer

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....

c69b147d 05/28/2013 12:46 pm Bernardo Dal Seno

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...

577edf04 05/28/2013 12:46 pm Bernardo Dal Seno

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 <>
Reviewed-by: Helga Velroyen <>

7c848a6a 05/28/2013 12:46 pm Bernardo Dal Seno

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 <>
Reviewed-by: Helga Velroyen <>

40d93e3b 05/28/2013 12:45 pm Bernardo Dal Seno

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 <>
Reviewed-by: Helga Velroyen <>

6ef8077e 05/28/2013 12:45 pm Bernardo Dal Seno

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 <>
Reviewed-by: Helga Velroyen <>

baa7f1d6 05/28/2013 12:45 pm Bernardo Dal Seno

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 <>
Reviewed-by: Helga Velroyen <>

b5d48e87 05/28/2013 12:45 pm Bernardo Dal Seno

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 <>...

688b5752 05/28/2013 12:45 pm Bernardo Dal Seno

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....

a9310b5b 05/24/2013 02:30 pm Guido Trotter

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...
328201a5 05/24/2013 02:26 pm Guido Trotter

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...
75a6c8be 05/23/2013 02:04 pm Bernardo Dal Seno

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 <>
Reviewed-by: Thomas Thrainer <>

24c06acb 05/23/2013 02:04 pm Bernardo Dal Seno

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 <>
Reviewed-by: Thomas Thrainer <>

5073fa0c 05/23/2013 02:03 pm Bernardo Dal Seno

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 <>
Reviewed-by: Thomas Thrainer <>

b54ecf12 05/23/2013 02:03 pm Bernardo Dal Seno

Add spindles field to disk object

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

Signed-off-by: Bernardo Dal Seno <>
Reviewed-by: Thomas Thrainer <>

3f3ea14c 05/23/2013 02:03 pm Bernardo Dal Seno

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 <>
Reviewed-by: Thomas Thrainer <>

c615590c 05/23/2013 02:03 pm Bernardo Dal Seno

Add "spindles" option to instance disk creation commands

The option is parsed but ignored, for the moment.

Signed-off-by: Bernardo Dal Seno <>
Reviewed-by: Thomas Thrainer <>

069a4bcf 05/22/2013 05:53 pm Guido Trotter

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 <>
Reviewed-by: Thomas Thrainer <>

ae549364 05/22/2013 05:53 pm Guido Trotter

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 <>
Reviewed-by: Michele Tartara <>

4b92e992 05/21/2013 03:13 pm Helga Velroyen

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...

48bba9de 05/17/2013 06:38 pm Balazs Lecz

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....

1bb99a33 05/17/2013 05:42 pm Bernardo Dal Seno

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...
6b3f0d7e 05/17/2013 04:25 pm Balazs Lecz

Fix owner of the OS log dir

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

Signed-off-by: Balazs Lecz <>
Reviewed-by: Guido Trotter <>

a365b47f 05/17/2013 03:04 pm Bernardo Dal Seno

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...
5eacbcae 05/17/2013 12:32 pm Thomas Thrainer

cmdlib: Cleanup public/private functions

All functions/classes which are used outside of their defining module
(with tests as an exception) no longer have a leading underscore.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Bernardo Dal Seno <>

8aa8f6b1 05/17/2013 12:32 pm Thomas Thrainer

cmdlib: Extract instance query related functionality

Split instance.py further by extracting instance querying related
logical units and functions to instance_query.py.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Bernardo Dal Seno <>

13f6af81 05/17/2013 12:32 pm Thomas Thrainer

cmdlib: Extract instance operation functionality

Split instance.py further by extracting instance operations
(start/stop/reboot/etc.) related logical units and functions to
instance_operation.py.

The extracted operations have in common that they affect the operating...

87e25be1 05/17/2013 12:32 pm Thomas Thrainer

cmdlib: Extract migration related functionality

Split instance.py further by extracting migration related logical units
and functions to instance_migration.py.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Bernardo Dal Seno <>

763ad5be 05/17/2013 12:32 pm Thomas Thrainer

cmdlib: Extract storage related functionality

Split instance.py further by extracting storage related logical units
and functions to instance_storage.py.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Bernardo Dal Seno <>

8701dfb0 05/17/2013 12:32 pm Thomas Thrainer

Reformat and define exports in cmdlib/__init__.py

cmdlib/__init__.py now simply defines the interface of the cmdlib module
by importing all classes which should be visible to clients.

Also don't ignore C0302 (Too many lines in module) any more.

Signed-off-by: Thomas Thrainer <>...

814386b7 05/17/2013 12:32 pm Thomas Thrainer

Extract miscellaneous logical units from cmdlib

All remaining classes in init.py are extracted to misc.py.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Bernardo Dal Seno <>

1be6b00e 05/17/2013 12:32 pm Thomas Thrainer

Extract os related logical units from cmdlib

All LUOs* classes are extracted to operating_system.py.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Bernardo Dal Seno <>

ec3cc4a8 05/17/2013 12:32 pm Thomas Thrainer

Extract query related logical units from cmdlib

All LUQuery* classes are extracted to query.py.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Bernardo Dal Seno <>

7ecd5e87 05/17/2013 12:32 pm Thomas Thrainer

Extract backup related logical units from cmdlib

All LUBackup* classes are extracted to backup.py.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Bernardo Dal Seno <>

22b7f6f8 05/17/2013 12:31 pm Thomas Thrainer

Extract instance related logical units from cmdlib

All LUInstance* classes are extracted to instance.py. Common functions
are moved to common.py if used by non-instance logical units as well.
Additionally, helper functions which are only used by LUBackup* and...

31b836b8 05/17/2013 12:31 pm Thomas Thrainer

Extract node related logical units from cmdlib

All LUNode* classes are extracted to node.py. Common functions are moved
to common.py if used by non-node logical units as well.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Bernardo Dal Seno <>

f380d53c 05/17/2013 12:31 pm Thomas Thrainer

Extract group related logial units from cmdlib

All LUGroup* classes are moved to group.py. Common functions are
extracted to common.py.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Bernardo Dal Seno <>

7352d33b 05/17/2013 12:31 pm Thomas Thrainer

Extract cluster related logical units from cmdlib

All LUCluster* classes are extracted to cluster.py. Shared functions are
extracted to common.py, helper functions only used by LUCluster* are
extracted to cluster.py.

Signed-off-by: Thomas Thrainer <>...

1d870e0d 05/17/2013 12:31 pm Thomas Thrainer

Extract test logical units from cmdlib

LUTest* are moved to test.py.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Bernardo Dal Seno <>

37dc17e3 05/17/2013 12:31 pm Thomas Thrainer

Extract network related logical units from cmdlib

LUNetwork* and associated helper functions are extracted to network.py.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Bernardo Dal Seno <>

fb3891d0 05/17/2013 12:31 pm Thomas Thrainer

Extract tags related logical units from cmdlib

LUTags* and their base class, TagsLU, are extracted to tags.py. An
additional shared function, _ShareAll, is extracted to common.py for
shared usage.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Bernardo Dal Seno <>

1a732a74 05/17/2013 12:31 pm Thomas Thrainer

Extract base classes from cmdlib

Base classes holding common functionality is extracted into base.py.
Utility functions used by both base classes and subclasses is moved to
common.py.

Signed-off-by: Thomas Thrainer <>
Reviewed-by: Bernardo Dal Seno <>

5d94c034 05/15/2013 03:02 pm Helga Velroyen

Use os.statvfs to determine free disk space

This simplifies my previous commit (820bade90) by using os.statvfs
instead of parsing the output of 'df'.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Bernardo Dal Seno <>

820bade9 05/14/2013 10:17 pm Helga Velroyen

Backend function for file storage space reporting

This adds functionality to retrieve disk space information
for file storage. It calls the 'df' tool and parses its
output to extract the total and free amount of disk space
on the disk where the given path is located....

9598b71f 05/14/2013 08:57 pm Michele Tartara

Remove extra newline

Also, properly set the date of the last modification.

Signed-off-by: Michele Tartara <>
Reviewed-by: Helga Velroyen <>

c300dbe4 05/14/2013 07:59 pm Michele Tartara

Add MonD to the watcher

The monitoring daemon should always be alive, therefore it's added to the
watcher.

Signed-off-by: Michele Tartara <>
Reviewed-by: Guido Trotter <>

66234263 05/14/2013 07:59 pm Michele Tartara

Start the monitoring and node daemons together

Add the monitoring daemon to the command starting the node daemon, given that
they both have to be started on all nodes.

Note that daemon-util only supports starting one daemon at the time, so the
actual command has to be composed as a sequence of two different daemon-util...

5bb9ecc0 05/14/2013 07:58 pm Michele Tartara

Add a constant stating whether monitoring is enabled

Signed-off-by: Michele Tartara <>
Reviewed-by: Guido Trotter <>

1f14b07e 05/14/2013 07:04 pm Bernardo Dal Seno

Clean up when "gnt-instance modify" fails to create a disk

cmdlib.LUInstanceSetParams now uses helper functions to create and wipe
disks, so that when the creation of a disk fails, any leftover device is
cleaned up. As a bonus, exceptions raised by _CreateBlockDev() are caught...

dfb0bc93 05/14/2013 07:04 pm Bernardo Dal Seno

recreate-disks honors the prealloc_wipe_disks flag

Now even recreate-disks wipes the newly-created disks, if the flag is set.

Signed-off-by: Bernardo Dal Seno <>
Reviewed-by: Helga Velroyen <>

b867e218 05/14/2013 07:03 pm Bernardo Dal Seno

Introduce wrapper for cmdlib._WipeDisks()

The wrapper handles errors by logging them and cleaning up freshly-created
disks.

Also, the correct disk is used in the error message when an error happens
in cmdlib._CreateDisks() and the resulting disk clean-up fails....

eb0aa4e5 05/14/2013 07:03 pm Bernardo Dal Seno

Don't catch an exception that cannot be raised

Since 9b221ea4, _CreateBlockDev() doesn't raise OpExecError any more. Yet
some code was left in place to catch it. By removing that code we have two
advantages:
1. Dead code is removed.
2. If for whatever reason _CreateBlockDev() raises OpExecError, the...

57bcb172 05/14/2013 07:02 pm Michael Hanselmann

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 <>...

8f096849 05/14/2013 04:46 pm Helga Velroyen

Move 'container.py' to storage directory

Moving 'container.py' to the storage directory.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Thomas Thrainer <>

cde49218 05/14/2013 04:46 pm Helga Velroyen

Rename dir 'block' to 'storage'

Renaming the 'block' directory to 'storage', because I plan to
place code there that is related to file storage and leaving
it named 'block' would be misleading.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Thomas Thrainer <>

c23bb217 05/14/2013 04:45 pm Helga Velroyen

Rename storage.py to container.py

Renaming 'storage.py' to 'container.py'. It will be moved into the new
'storage' directory, which will come in later patches to avoid clashes of
notation.

Signed-off-by: Helga Velroyen <>
Reviewed-by: Thomas Thrainer <>

1da489e2 05/13/2013 10:56 am Guido Trotter

Move cmdlib.py to cmdlib/__init__.py

cmdlib.py has grown really too much. Move it into its own package to
allow splitting it further.

Signed-off-by: Guido Trotter <>
Signed-off-by: Thomas Thrainer <>
Reviewed-by: Klaus Aehlig <>