Statistics
| Branch: | Tag: | Revision:

root / lib / cmdlib.py @ cd098c41

History | View | Annotate | Download (249.7 kB)

# Date Author Comment
cd098c41 06/15/2009 01:51 pm Guido Trotter

LUSetInstanceParams: nic parameters

Hooks are dealt with in a later patch in the series.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

0329617a 06/12/2009 10:43 am Guido Trotter

LUSetInstanceParams: abstract _GetUpdatedParams

There is some duplicated code between hv and be parameters to create the
updated parameters dict. This will need to be done also for nic
parameters, so we abstract this functionality in a function.

Signed-off-by: Guido Trotter <>...

2ee88aeb 06/12/2009 10:43 am Guido Trotter

LUSetInstanceParams: save cluster

Rather than querying for the cluster multiple times, save it.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

9dce4771 06/12/2009 10:42 am Guido Trotter

LUCreateInstance: NIC parameters

Instance creation is changed to support the new nic parameters.

Hooks are dealt with in a later patch in the series.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

035566e3 06/10/2009 12:57 pm Iustin Pop

Fix node add and RedistributeAncillaryFiles

Commit 28eddce5249f35c2c330a04da07b74950877dcf5 added the
RedistributeAncillaryFiles, but it calls it with a wrong parameter and thus
makes node add fail.

This one-liner fixes it.

Signed-off-by: Iustin Pop <>...

5af3da74 06/08/2009 07:58 pm Guido Trotter

Allow modifying of default nic parameters

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

1094acda 06/08/2009 07:58 pm Guido Trotter

Show nic parameters in cluster info

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

abe609b2 06/08/2009 07:58 pm Guido Trotter

Move FillDict at module level

This way it can be also used by scripts and other object types.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

4ef7f423 06/08/2009 07:58 pm Guido Trotter

Change BEGR_DEFAULT to PP_DEFAULT

This way the same constant can represent the default profile also for
nic, disk and OS parameters.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

9205a895 06/08/2009 07:44 pm Iustin Pop

Convert call_blockdev_removechildren to new result

This patch converts blockdev_removechildren to new result type and
slightly changes a message in addchildren to match this (paired)
function.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

2cc1da8b 06/08/2009 07:44 pm Iustin Pop

Convert call_blockdev_addchildren to new result

This patch converts the blockdev_addchildren rpc call to the new result
format.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

6b5e3f70 06/08/2009 07:43 pm Iustin Pop

Convert rpc call_blockdev_rename to (status, data)

This small patch converts the call_blockdev_rename to the new result
type.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

1b54fc6c 05/28/2009 03:18 pm Guido Trotter

Convert UploadFile (and its callers) to new rpc

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

b86a6bcd 05/28/2009 03:18 pm Guido Trotter

Add cluster-init --no-etc-hosts parameter

If --no-etc-hosts is passed in at cluster init time we set a new
parameter in the cluster's object to false, and avoid adding nodes to
the hosts file. The UpgradeConfig function is used to set the value to
True, when upgrading from an old configuration version....

f5118ade 05/27/2009 01:19 pm Iustin Pop

Add a node powercycle command

This (somewhat big) patch adds support for remotely rebooting the nodes
via whatever support the hypervisor has for such a concept.

For KVM/fake (and containers in the future) this just uses sysrq plus a
‘reboot’ call if the sysrq method failed. For Xen, it first tries the...

28eddce5 05/22/2009 01:01 pm Guido Trotter

_RedistributeAncillaryFiles function

This function is shared between AddNode and RedistributeConfig, and used
to redistribute additional files which are inherently part of the
cluster configuration.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

e1b8653f 05/22/2009 01:01 pm Guido Trotter

_RedistributeAncillaryFiles: add hypervisor files

Each hypervisor can declare additional files to be shipped to all nodes.

Signed-off-by: Guido Trotter <>
Reviewed-by: Iustin Pop <>

4d2a7c95 05/22/2009 01:01 pm Guido Trotter

Remove the HTS_COPY_VNC_PASSWORD constant/feature

Currently just for xen-hvm we copy the vnc password on node-add. This
will be changed for 2.1 with a more advanced gnt-cluster redist-conf
functionality which is going to be used by node-add as well.

Signed-off-by: Guido Trotter <>...

c1be3f59 05/20/2009 04:16 pm Guido Trotter

Merge branch 'master' into branch-2.1

622533d5 05/19/2009 04:43 pm Iustin Pop

Merge commit 'origin/next' into branch-2.1

  • commit 'origin/next': (25 commits)
    Move more hypervisor strings into constants
    Add -H/-B startup parameters to gnt-instance
    call_instance_start: add optional hv/be parameters
    Fix gnt-job list argument handling...
88ae4f85 05/19/2009 02:02 pm Iustin Pop

IAllocator: export total disk size for instances

This patch adds for current instance a ‘disk_space_total’ key, similar
to the key for the new instance in case of new allocations.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

d04aaa2f 05/19/2009 11:39 am Iustin Pop

Add -H/-B startup parameters to gnt-instance

This patch modifies the start instance script, opcode and logical unit
to support temporary startup parameters.

Different from 1.2, where only the kernel arguments were supporting
changes (and thus xen-pvm specific), this version supports changing all...

0eca8e0c 05/19/2009 11:39 am Iustin Pop

call_instance_start: add optional hv/be parameters

This patch modifies the rpc.call_instance_start - the master side - to
take optional hv/be parameters. The noded side is unchanged and
oblivious to the change.

This will allow implementation of single-user capability and such on...

b4874c9e 05/15/2009 11:45 am Guido Trotter

Instance reinstall: don't mix up errors

If the remote info rpc call fails we can't assume that the instance is
up.

Signed-off-by: Guido Trotter <>

f1926756 05/15/2009 11:42 am Guido Trotter

Don't check memory at startup if instance is up

Signed-off-by: Guido Trotter <>

b2482333 05/13/2009 03:58 pm Guido Trotter

LUSetClusterParams: improve volume group removal

Currently LUSetClusterParams will remove the volume group if the vg_name
field passed in is not true, but not None. Setting the target volume
group to False or the empty string, though, is a bad idea because it's...

7a56b411 05/13/2009 02:45 pm Guido Trotter

LUQueryClusterInfo: return a few more fields

Some fields can be set at cluster init, and perhaps even modifed with
SetClusterParams but there's no way to know them. With this patch we
export them in the cluster info query.

Signed-off-by: Guido Trotter <>...

ade0e8cd 05/12/2009 02:30 pm Guido Trotter

LUSetInstanceParam: don't assume memory is integer

LUSetInstanceParam currently assumes that the 'memory' value of a
call_instance_info result is an integer, while the rest of the code
explicitely converts it to int(). Converting it to int works around a...

bd45767b 05/07/2009 11:13 am Carlos Valiente

Remove some superfluous imports

This is for Python 2.6 compatibility.

Signed-off-by: Iustin Pop <>
Reviewed-by: Iustin Pop <>

e557bae9 05/06/2009 02:56 pm Guido Trotter

Inform the OS create script of reinstalls

Sometimes reinstalls are slightly different than new installs. For
example certain partitions may need to be preserved accross reinstalls.
In order to do that on a per-os basis we pass in the INSTANCE_REINSTALL
variable to inform the create script about when a reinstall is...

3994f455 05/05/2009 11:33 am Iustin Pop

Fix argument checking in LUSetClusterParams

This patch fixes two issues with LUSetClusterParams and argument
checking.

First, this LU used the wrong function name (CheckParameters instead of
CheckArguments), which means that no parameter checking was done at all;...

d64769a8 05/04/2009 04:09 pm Iustin Pop

Include node name in hypervisor validation errors

The current validation routine just says "failed", without specifying
the node name. This is very confusing, and we should log the node name
too.

Signed-off-by: Iustin Pop <>
Reviewed-by: Alexander Schreiber <>

a6ab004b 04/24/2009 05:36 pm Iustin Pop

LUDiagnoseOS: change locking and error handling

Since the “list OSes” call is exported via RAPI, this can be used pretty
easily to DOS the master daemon during long jobs.

The implementation of LUDiagnoseOS makes an RPC call to all nodes; we
lock nodes here in order to prevent node removal....

ea9ddc07 04/24/2009 11:43 am Iustin Pop

Fix verify-disks with broken volume groups

When a remote node returns invalid LVM data, we check it, but we don't
stop and continue with the rest of the checks (which require a valid
volume group). This raises an internal error and breaks verify disks.

This seems unchanged for a long while, I don't know why it surfaced just...

9a198532 04/24/2009 11:43 am Iustin Pop

Prevent errors when xenvg is broken cluster verify

When vg_name is not returned at all, we currently abort with an internal
error. This is because we don't catch KeyError.

This patch adds a custom message for this case, and also adds KeyError
to the list of catched exceptions, just for safety....

949bdabe 04/15/2009 02:11 pm Iustin Pop

A bunch of doc and other small fixes

This patch adds a couple of both externally and internally reported
issues:
- missing SGML tags (Issue 54), report and patch by superdupont
- wrong variable used in the init.d script, report and patch by
Karsten Keil <>...

c614e5fb 03/09/2009 05:12 pm Iustin Pop

Handle ghost instances in temp DRBD map

Currently cluster-verify doesn't handle the (admitedly invalid) case where we
have reservation for instances that were removed in the meantime.

This patch adds a check for this and prevents code errors in cluster-verify in...

82759cb1 03/09/2009 05:12 pm Iustin Pop

Fix error handling in replace-disks with new node

Currently the _CreateSingleBlockDev function only raises OpExecError and not
BlockDeviceError. This means that we don't release the instance's temporary
minors properly, and this creates problems later if the instance is removed...

35e994e9 03/02/2009 02:19 pm Iustin Pop

Export tags to cluster verify hooks

This patch export the cluster and node tags to the cluster verify hook
scripts. The tags are exported as a space-separated list, which allows
easy parsing from the shell (e.g. “for tag in $GANETI_CLUSTER_TAGS; do
...”) and therefore requires the previous “Don't allow spaces in tag...

77031881 03/02/2009 02:18 pm Iustin Pop

Update the iallocator documentation

This updates the iallocator documentation to 2.0, bumps up the
iallocator version (and moves a constants to lib/constants.py), and
fixes a style on install.rst.

Reviewed-by: ultrotter

cc9e1230 02/27/2009 07:08 pm Guido Trotter

LUVerifyCluster: Handle the "no volume group" case

If we're only file based and out volume group is set to "None" there's
no point in asking nodes for their volume groups, logical volumes, and
drbd devices, and checking those.

Reviewed-by: iustinp

5fcc718f 02/27/2009 03:06 pm Iustin Pop

Fix some epydoc style issues

99% of the epydoc return tags are "@return:", but each of the modified files
had one "@returns:" line. We fix this for consistency.

Reviewed-by: imsnah

2c2690c9 02/25/2009 01:23 pm Iustin Pop

Update some hooks settings

While reviewing the hooks document, I realised we are not correctly
exporting the instance properties.

This patch fixes:
- export the disk and disk template in all LUs, not only (hardcoded)
in the instance create
- removes the instance create INSTANCE_ prefix on some non-instance...

07813a9e 02/24/2009 05:25 pm Iustin Pop

Remove the extra_args parameter in instance start

This patch removes the extra_args parameter and instead switches the
instance to the HV_KERNEL_ARGS hypervisor option.

This is a big change, but it's a needed cleanup, this extra parameter on
all RPC calls is not generic and we also need to have a persistent value...

9854f5d0 02/24/2009 01:23 pm Iustin Pop

Make gnt-instance info work with offline nodes

This simply makes LUQueryInstanceData return the same information as for
a static query when one or both of the nodes are down.

Reviewed-by: imsnah

ae48ac32 02/16/2009 04:50 pm Iustin Pop

Fix some bugs in reboot

There are two issues fixed in this patch:
- first, the recent RPC changes caused loss of data in hard reboot
type; we weren't reporting any results from the stop/start instance
calls;
- second, in soft or hard reboots, we didn't initialized the disk...

f6eaed12 02/16/2009 02:17 pm Iustin Pop

Convert IOErrors for /proc/drbd into our errors

If /proc/drbd can't be opened, this raises an IOError, but all the
error-handling behaviour in backend treats only BlockDeviceErrors. This
creates a plain failure in cluster verify and in other RPC calls.

This patch simply converts EnvironmentErrors into BlockDeviceErrors, and...

d8dcf3c9 02/13/2009 03:49 pm Guido Trotter

SetInstanceParams: export nic changes to hooks

Currently we export the old instance "as is" and any nic changes get
lost, so hooks won't know of a different ip, bridge, or mac address.
This patch fixes it by putting the nics in the override dict, if any
changes are done....

5c44da6a 02/12/2009 07:35 pm Guido Trotter

LUSetInstanceParams: Fix nic handling

CheckArguments:
Use constants.VALUE_NONE rather than hardcoding the string "none"
If we're adding a nic fill the nic_dict with default values
Check if the mac is syntactically valid, if we have one
Don't allow the mac to be 'auto' when modifying a nic...

295728df 02/12/2009 07:35 pm Guido Trotter

Instance Creation: generate nics earlier

We want the real nic to be shown to the hooks and the allocators, so
we'll generate them in CheckPrereq. We also write a comment about the
race condition we generate. This race condition existed even before, so
moving this generation will just lenghen it a bit. A separate patch...

5b460366 02/12/2009 07:03 pm Iustin Pop

Some small fixes

This patch removes the admin_ram LUQueryInstances field (is broken
anyway) and fixes the VNC address checks in the Xen Hypervisor.

Reviewed-by: imsnah

8aec325c 02/12/2009 07:03 pm Iustin Pop

Fix LUQueryInstances fields.

The query fields are now regular expressions. We need to quote the dots,
otherwise invalid fields will be accepted but they will lose special
formatting in the cli scripts.

Reviewed-by: imsnah

1dff8e07 02/12/2009 09:34 am Iustin Pop

Fix RPC result handling in _AssembleInstanceDisks

For (status, data)-style RPC calls, the result data is in the ‘payload’
attribute. This was missed in the conversion patch, with the only side
effect that gnt-instance activate-disks didn't show a nice output...

1fae010f 02/12/2009 09:30 am Iustin Pop

Switch the instance_shutdown rpc to (status, data)

This patch changes the return type from this RPC call to include status
information and renames the backend method to match the RPC call name.

The patch is a little bigger than the reboot one, since this call is...

489fcbe9 02/12/2009 09:30 am Iustin Pop

Switch the instance_reboot rpc to (status, data)

This small patch changes the return type from this RPC call to include
status information and renames the backend method to match the RPC call
name.

Reviewed-by: ultrotter

43e99cff 02/11/2009 06:23 pm Guido Trotter

_GenerateDiskTemplate: correct file disk index

Currently when adding disks the base for the index is not taken into
account, and disk 0 is added twice.

Reviewed-by: iustinp

ccd905ac 02/11/2009 12:19 pm Guido Trotter

HTS_USE_VNC, rename and remove KVM

Currently we use the HTS_USE_VNC constant only to copy the vnc password
file. While KVM uses vnc it currently has no password support, nor we'll
be on time making one for 2.0, so renaming the constant to
HTS_COPY_VNC_PASSWORD and only putting Xen HVM in it. In the future...

82e12743 02/10/2009 06:05 pm Iustin Pop

Some fixes to node add and re-add

The patch changes the pre-checks in node-add and re-add:
- if the node is not already in the cluster, refuse to re-add
- when re-adding, reuse the secondary IP from the cluster
configuration
- when re-adding, reset the offline and drained flags, so that RPC...

a5728081 02/10/2009 05:06 pm Guido Trotter

Instance parameters: force typing

We want all the hv/be parameters to have a known type, rather than a
random mix of empty string, boolean values, and None, so we declare the
type of each variable and we enforce/convert it.

- Add some new constants for enforceable value types...

c9d443ea 02/10/2009 04:47 pm Iustin Pop

Implement modification of the drained flag

This patch adds LU and cli-level support for modification of the node
drained flag. It is similar to the offline changes.

Reviewed-by: imsnah

733a2b6a 02/10/2009 04:46 pm Iustin Pop

Prevent allocations on drained nodes

This patch adds checks for drained nodes in the logical units that
allocate or move instances around. We also update an error message (not
style-compliant).

Reviewed-by: imsnah

22f0f71d 02/10/2009 04:46 pm Iustin Pop

cluster verify: show correctly drained nodes

This patch changes slightly the output of gnt-cluster verify for drained
nodes, and also adds a note with the total number of drained nodes
(similar to the offline nodes note).

Reviewed-by: imsnah

0b2454b9 02/10/2009 04:45 pm Iustin Pop

Allow query of the drained node attribute

This patch exports the drained attribute:
- LUQueryNodes accepts now the drained field
- RAPI exports it for node objects
- gnt-node info shows it now (along newly-added master_candidate and
offline flags)...

af64c0ea 02/10/2009 04:45 pm Iustin Pop

Add a ‘drained’ attribute to node objects

This attribute will be used to prevent any allocation on the node (any
of replace-disks with new secondary this node, failover to the node,
migration to the node).

The patch adds the attribute and initializes it correctly in cluster...

e1bc0878 02/10/2009 04:44 pm Iustin Pop

Switch the blockdev_remove rpc to (status, data)

This converts the backend and cmdlib modules to a (status, data)
implementation of the blockdev_remove rpc call. bdev.py is not yet
converted, so we don't actually have error information.

We also fix a bug in _RemoveDisks by not reusing a variable....

cacfd1fd 02/10/2009 04:44 pm Iustin Pop

Switch the blockdev_shutdown rpc to (status, data)

This converts the backend and cmdlib modules to a (status, data)
implementation of the blockdev_shutdown rpc call. bdev.py is not yet
converted, so we don't actually have error information.

We also fix a bug in _ShutdownInstanceDisks by not reusing a variable....

53c14ef1 02/10/2009 04:43 pm Iustin Pop

Convert blockdev_assemble rpc to (status, data)

This converts the RPC call blockdev_assemble to the new-style result
format. Note that we won't usually have error information, but it's the
first step toward it.

Reviewed-by: ultrotter

12649e35 02/10/2009 01:59 pm Guido Trotter

LUSetInstanceParams: use the correct hvparams

In LUSetInstanceParam we used to save the dict without defaults for the
instance params as hv_inst, but to use the populated one for the
instance (hv_new). Fixing this leads to instances without all the
parameters set....

024e157f 02/09/2009 04:04 pm Iustin Pop

Add a new instance query flag ‘disk_usage’

This patch adds a new instance query flag called disk_usage that
retrieves the overall space used by an instance on each of its nodes.
This can be used when balancing the cluster or checking N+1 status.

The flag is also exported in RAPI. Note the flag is currently broken for...

821d1bd1 02/09/2009 04:03 pm Iustin Pop

Uniformize some function names in backend.py

Currently, the names of the functions in backend.py that are actually
RPC procedures and are called from ganeti-noded are not corresponding to
the RPC names. This makes it hard to actually see which functions are...

23829f6f 02/09/2009 04:03 pm Iustin Pop

rpc.call_blockdev_find: convert to (status, data)

This patch converts the call_blockdev_find - which searches for block
devices and returns their status - to the (status, data) format. We also
modify the backend function name to match the rpc call.

Reviewed-by: ultrotter

0105bad3 02/09/2009 12:41 pm Iustin Pop

Export the cpu nodes and sockets from Xen

This is a hand-picked forward patch of commit 1755 on the 1.2 branch
(hand-picked since the trees diverged too much since then):

The patch changed the xen hypervisor to compute the number of cpu
sockets/nodes and enables the command line and the RAPI to show this...
0959c824 02/09/2009 11:24 am Iustin Pop

cmdlib: simplify some rpc error handling cases

By using the RemoteFailMsg() or the payload field of RpcResult, we can
simplify a few functions in cmdlib.

Reviewed-by: ultrotter

4978db17 02/09/2009 11:24 am Iustin Pop

LUCreateInstance: only set running flag at the end

In lockless queries, it's better if we see the instance in ADMIN_down
rather than ERROR_down during the time it's installed. As such, we
change the LU to only mark the instance 'up' at the time we are ready to...

bc8e4a1a 02/04/2009 05:11 pm Iustin Pop

Enable lockless node queries

Similar to the instance list, this patch enables lockless node queris.
“gnt-node list” accepts now the “--sync” flag which enables locking, the
default is lockless.

Reviewed-by: imsnah

ec79568d 02/04/2009 12:30 pm Iustin Pop

Implement lockless query operations

This patch adds the framework for, and enables lockless OpQueryInstances. This
means that instances will be shown in ERROR_up or ERROR_down state, even though
this is not an error (but just an in-progress job).

The framework is implemented as follows:...

26f15862 02/03/2009 04:45 pm Iustin Pop

An attempt at fixing some encoding issues

This patch unifies the hardcoded re-encoding attempts into a single
function in utils.py. This function is used to take either an unicode or
str object and convert it to a ASCII-only str object which can be safely...

bafc1d90 02/03/2009 12:55 pm Iustin Pop

Small patch for handling errors in node add

This small path hopefully fixes the handling of ssh verify errors in
node add (note: untested).

Reviewed-by: ultrotter

a1b805fb 02/02/2009 01:23 pm Iustin Pop

Return error messages in node add ssh handling

When the rpc call node_add fails, we don't have any error message. This
patch changes the call to return (status, data) so that the user can see
the correct error message.

Reviewed-by: imsnah

7a735d6a 02/01/2009 11:48 am Guido Trotter

LUQueryClusterInfo: filter hvparams

We don't need to show hvparams for hypervisors which are not enabled on
the cluster.

Reviewed-by: iustinp

2928f08d 01/29/2009 05:51 pm Guido Trotter

LUAddNode: copy the vnc password file also for KVM

Before we used to copy the file if xen-hvm was enabled on the cluster,
no we'll do that if any enabled hypervisor is in the new HTS_USE_VNC
group.

Reviewed-by: iustinp

5431b2e4 01/29/2009 05:47 pm Guido Trotter

GetShellCommand: get hvparams and beparams

Sometimes the hypervisor will use the instance hv and/or be parameters
to determine the best shell command. This is not possible, though,
currently, as the instance hv/beparams are not filled, so we have to
pass the filled versions separately....

e9ce0a64 01/29/2009 05:09 pm Iustin Pop

Implement software release version checks too

Currently the LUVerifyCluster only reports the protocol version changes,
not software ones. This is useful to know/monitor, so we add this too as
a warning.

Reviewed-by: ultrotter

a7f5dc98 01/29/2009 05:08 pm Iustin Pop

LUQueryInstances: keep the given order of names

Currently LUQueryInstances keeps the ordering of instances only in some cases,
and in others it will reorder the list. This patch fixes this by more clearly
separating the various cases (names passed or not and locking or not locking),...

68c6f21c 01/28/2009 09:06 pm Iustin Pop

Fix gnt-cluster modify -H and offline nodes

Reviewed-by: ultrotter

6ec66eae 01/27/2009 05:41 pm Iustin Pop

Fix the mode attribute of newly-created disks

Currently, only the LUSetInstanceParams correctly sets up the mode
attribute via a manual operation. We remove this and instead do the
correct setting in the generic _GenerateDiskTemplate function, so that
we set the mode correctly for all disk creations....

9939547b 01/23/2009 03:33 pm Iustin Pop

Fix batcher for 2.0-style disks and nics

This patch fixes the gnt-instance batch-create command, and in doing so
also slightly changes two other functions:
- we change utils.ParseUnit so that it accepts integer values also
(both ParseUnit(5) and ParseUnit("5") return the same value)...

1325da74 01/23/2009 02:36 pm Iustin Pop

Make iallocator work with offline nodes

This patch changes the iallocator framework to work with and properly
export to plugins offline nodes. It does this by only exporting the
static configuration data for those nodes, and not attempting to parse
the runtime data....

3b559640 01/23/2009 02:36 pm Iustin Pop

Remove checking of DRBD metadata for validity

Currently the DRBD code checks that the metadata devices are valid
before creation, initial disk attachment and add children.

However, the process for checking validity requires a free DRBD minor,
and this conflict with parallel checking....

8901997e 01/23/2009 11:13 am Iustin Pop

A couple of small fixes to iallocator

This removes some constraints:
- only two disks supported, this is no longer true as the underlying
functions can now compute size for a variable number of disks
- error when the hypervisor was not being passed...

61cf6b5e 01/21/2009 04:15 pm Iustin Pop

Automatically release DRBD minors on success

This patch converts the DRBD minors reservation protocol from explicit
release to automatic release on the success paths. On the errors paths,
it's still needed to manual release.

The patch doesn't bring much by itself, but is needed for a future patch...

0d68c45d 01/21/2009 12:30 pm Iustin Pop

Change the instance status attribute to boolean

Due to historic reasons, the “should run or not” attribute of an
instance was denoted by its “status” attribute having a string value of
either ‘up’ or ‘down’. Checking this is in code was done via hardcoding...

6906a9d8 01/21/2009 11:54 am Guido Trotter

Add calls in the intra-node migration protocol

Currently the hypervisor is expected to do all the migration from the
source side. With this patch we also add the option of passing some
information to the target side, and starting some operation there.

As a bonus, a function to cleanup any started operation is included....

96841384 01/20/2009 06:26 pm Iustin Pop

Convert RenameInstance to (status, data)

This allows the rename failures to show the ouput of OS scripts.

Reviewed-by: ultrotter

32388e6d 01/20/2009 04:20 pm Iustin Pop

Fix adding of disks to an instance

The ConfigWriter.AllocateDRBDMinor requires the instance name, not the
instance object. The LUSetInstanceParms is passing wrongly the instance
object, which can cause breakage.

The patch also adds asserts to check for this mismatch in ConfigWriter....

6d2e83d5 01/20/2009 04:20 pm Iustin Pop

Make cluster-verify check the drbd minors space

This patch adds support for verification of drbd minors space in cluster
verify: minors which belong to running instances and should be online
but are not, and minors which do not belong to any instace but are in...

1492cca7 01/20/2009 12:12 pm Iustin Pop

Some small fixes in cmdlib

Reviewed-by: ultrotter

20e01edd 01/20/2009 12:11 pm Iustin Pop

Convert AddOSToInstance to (status, data)

This allows the install and reinstall instance to return (hopefully)
relevant log files from the OS create scripts.

Reviewed-by: ultrotter

dd279568 01/20/2009 12:11 pm Iustin Pop

Convert the start instance rpc to (status, data)

This will record the failure cause in starting up the instance in the
job log (and thus to the user).

Reviewed-by: ultrotter

7d81697f 01/19/2009 07:22 pm Iustin Pop

Fix handling of failures in create instance disks

Commit 2302 only modified _CreateBlockDevOnPrimary to the new style
result, but _CreateBlockDevOnSecondary was forgotten. After the merger
of the two functions, _CreateBlockDevOnSecondary was taken as template...