ganeti-local
13 years agoquery: change (debug-mode) field validation errors
Iustin Pop [Sun, 16 Jan 2011 16:22:37 +0000 (17:22 +0100)]
query: change (debug-mode) field validation errors

Currently, the single assert just checks that the entire row is
consistent (true/false), and dumps the row and field definitions as an
accompanying message. This makes it very hard to understand what failed.

This patch changes this validation to show descriptive messages, which
makes it much faster in diagnosing invalid result.

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

13 years agoRename a few instance field titles
Iustin Pop [Sun, 16 Jan 2011 15:23:45 +0000 (16:23 +0100)]
Rename a few instance field titles

The conversion to querylib introduced unique field titles, which however
did an inconsistent rename of the instance vcpus/memory fields.

This patch makes both BE_MEMORY and _VCPUS be named with prefix “Config”
(which before was “Configured_”), and drops the “Runtime” (note no
underscore) prefix on the oper_ ones.

Rationale: for numeric fields, the width of the title defines the width
of the columns, as the numbers are usually small. Hence these columns
(more likely used than the BE ones) would be very wide, leading to a
not-so-nice display. I happened upon this when my terminals didn't
manage to fit a gnt-instance list anymore.

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

13 years agoquery: Change internal result computation
Iustin Pop [Sun, 16 Jan 2011 15:02:25 +0000 (16:02 +0100)]
query: Change internal result computation

While looking at the query library, I realized that while we have five
field statuses, making this a 5-dimensional space, four of them are
shrunk to a single possible value (None). Hence it should be possible to
convert this into a single value space plus extra 4 special constants.

This patch implements this, making (IMHO) the return value of normal
functions much simpler: you simply return the desired value, instead of
(QRFS_NORMAL, value); for the special results, you simply return
_FS_UNAVAIL, instead of (QRFS_UNAVAIL, None). This I believe does
simplify the code.

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

13 years agoImport QRFS_* and QFT_* in query.py
Iustin Pop [Sun, 16 Jan 2011 14:17:40 +0000 (15:17 +0100)]
Import QRFS_* and QFT_* in query.py

Currently, the QRFT/QFT constants are used with the module (e.g.
constants.QRFS_NORMAL) in the query library. Given that there are 176
uses of these constants in a module that has roughly ~1200 lines in
total (including whitespace), it makes sense to import these directly to
improve readability.

This patch does this and (IMHO) it does indeed make the code more to the
point; the entire query library is about queries, so using these
constants directly doesn't cause any misunderstandings.

Note: the epydoc links are not changed, since we want the generated docs
to point to the right place.

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

13 years agoBuild epydoc's module list from Makefile
Michael Hanselmann [Tue, 18 Jan 2011 12:43:52 +0000 (13:43 +0100)]
Build epydoc's module list from Makefile

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

13 years agoKVM: don't fail removing non-existing nic path
Guido Trotter [Mon, 17 Jan 2011 15:50:03 +0000 (15:50 +0000)]
KVM: don't fail removing non-existing nic path

This shouldn't normally happen, but if it does no need to fail.

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

13 years agoKVM: Perform network configuration in Ganeti
Apollon Oikonomopoulos [Mon, 17 Jan 2011 18:42:51 +0000 (20:42 +0200)]
KVM: Perform network configuration in Ganeti

This patch introduces network configuration for KVM in Ganeti.

There are three problems with having KVM perform network configuration via ifup
scripts:
  a) Ganeti never gets to know the tap interface that is associated with an
     instance's NIC
  b) Migration of routed instances will cause network problems because the
     incoming KVM side configures the network as soon as it is spawned and not
     as soon as the migration finishes. This means that all routing
     configuration will be present in both, primary and secondary, nodes at the
     same time, possibly causing network disruption during the migration.
  c) We never get to know if the network configuration succeeded or not.

This patch moves network configuration from KVM to Ganeti, using KVM's ability
to receive already open tap devices as file descriptors.

_WriteNetScript is removed from hv_kvm.py, together with its unit tests.

Minor modifications are made to _ExecKVMRuntime to handle tap device
initialization. NIC <-> tap associations are stored under a new directory,
_ROOT_DIR/nic in a file-per-nic fashion.

The end-user semantics remain the same: The user can override the network
configuration by providing _KVM_NET_SCRIPT. If this is not present or
executable, the default constants.KVM_IFUP script is run.

Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoShip default kvm-ifup script
Apollon Oikonomopoulos [Mon, 17 Jan 2011 10:50:05 +0000 (12:50 +0200)]
Ship default kvm-ifup script

In order to retain backwards compatibility, we ship the shell script previously
generated by _WriteNetScript as a stand-alone script under PKGLIBDIR.

Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoKVM: Add auxiliary functions to handle tap devices
Apollon Oikonomopoulos [Mon, 17 Jan 2011 18:41:34 +0000 (20:41 +0200)]
KVM: Add auxiliary functions to handle tap devices

Add two new functions, _OpenTap and _ProbeTapVnetHdr, to
hypervisors.hv_kvm.

_ProbeTapVnetHdr checks if the host kernel supports the virtio net header
(IFF_VNET_HDR) feature. This feature allows KVM to ask the the host kernel to
perform checksumming and segmentation offload of the data passing through a
guest's virtio NIC, using a special header[1] prepended to data sent through
the tap interface. A qemu-kvm version later than 0.12 is required for this
feature to work.

_OpenTap opens a new tap device suitable for use with qemu-kvm's "-net
tap,fd=n" option. It also enables vnet_hdr support if requested and safe to do
so.

[1] struct virtio_net_hdr in include/linux/virtio_net.h

Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoepydoc: specify files in tools/
Guido Trotter [Tue, 18 Jan 2011 11:54:56 +0000 (11:54 +0000)]
epydoc: specify files in tools/

This way we can add there non-python scripts

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

13 years agoRemove hard-coded OP_ID definitions
Iustin Pop [Sat, 15 Jan 2011 14:32:54 +0000 (15:32 +0100)]
Remove hard-coded OP_ID definitions

The removal requires adding a few pylint ignores, as it cannot know that
OP_ID will be defined at runtime.

Also switch the asserts to check for non-declaration.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoCheck consistency of the class names and OP_ID
Iustin Pop [Sat, 15 Jan 2011 14:25:24 +0000 (15:25 +0100)]
Check consistency of the class names and OP_ID

As the class names should be now consistent with the OP_IDs, we add a
check for wrongly-defined OP_IDs.

However, the future removal of the hand-coded OP_IDs will render this
obsolete, so this check is introduced just to make sure that the
previous renaming patches did the right job, and it will then be
removed.

The consistency checks require renaming the test opcodes, which were
using arbitrary names, depending on test author. They are now all
standardized on OpTest (local scope).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpTestJobqueue and LUTestJobqueue
Iustin Pop [Sat, 15 Jan 2011 12:07:20 +0000 (13:07 +0100)]
Rename OpTestJobqueue and LUTestJobqueue

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

13 years agoRename OpAddTags and LUAddTags
Iustin Pop [Sat, 15 Jan 2011 12:06:57 +0000 (13:06 +0100)]
Rename OpAddTags and LUAddTags

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

13 years agoRename OpSearchTags and LUSearchTags
Iustin Pop [Sat, 15 Jan 2011 12:06:57 +0000 (13:06 +0100)]
Rename OpSearchTags and LUSearchTags

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

13 years agoRename OpGetTags and LUGetTags
Iustin Pop [Sat, 15 Jan 2011 12:06:57 +0000 (13:06 +0100)]
Rename OpGetTags and LUGetTags

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

13 years agoRename OpDelTags and LUDelTags
Iustin Pop [Sat, 15 Jan 2011 12:06:57 +0000 (13:06 +0100)]
Rename OpDelTags and LUDelTags

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

13 years agoRename OpDiagnoseOS and LUDiagnoseOS
Iustin Pop [Sat, 15 Jan 2011 12:06:57 +0000 (13:06 +0100)]
Rename OpDiagnoseOS and LUDiagnoseOS

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

13 years agoRename OpSetNodeParams and LUSetNodeParams
Iustin Pop [Sat, 15 Jan 2011 12:06:57 +0000 (13:06 +0100)]
Rename OpSetNodeParams and LUSetNodeParams

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

13 years agoRename OpRemoveNode and LURemoveNode
Iustin Pop [Sat, 15 Jan 2011 12:06:57 +0000 (13:06 +0100)]
Rename OpRemoveNode and LURemoveNode

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

13 years agoRename OpQueryNodeStorage and LUQueryNodeStorage
Iustin Pop [Sat, 15 Jan 2011 12:06:56 +0000 (13:06 +0100)]
Rename OpQueryNodeStorage and LUQueryNodeStorage

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

13 years agoRename OpQueryNodeVolumes and LUQueryNodeVolumes
Iustin Pop [Sat, 15 Jan 2011 12:06:56 +0000 (13:06 +0100)]
Rename OpQueryNodeVolumes and LUQueryNodeVolumes

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

13 years agoRename OpQueryNodes and LUQueryNodes
Iustin Pop [Sat, 15 Jan 2011 12:06:51 +0000 (13:06 +0100)]
Rename OpQueryNodes and LUQueryNodes

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

13 years agoRename OpPowercycleNode and LUPowercycleNode
Iustin Pop [Sat, 15 Jan 2011 12:06:18 +0000 (13:06 +0100)]
Rename OpPowercycleNode and LUPowercycleNode

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

13 years agoRename OpModifyNodeStorage and LUModifyNodeStorage
Iustin Pop [Sat, 15 Jan 2011 12:06:17 +0000 (13:06 +0100)]
Rename OpModifyNodeStorage and LUModifyNodeStorage

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

13 years agoRename OpMigrateNode and LUMigrateNode
Iustin Pop [Sat, 15 Jan 2011 12:06:17 +0000 (13:06 +0100)]
Rename OpMigrateNode and LUMigrateNode

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpNodeEvacuationStrategy and LUNodeEvacuationStrategy
Iustin Pop [Sat, 15 Jan 2011 12:06:17 +0000 (13:06 +0100)]
Rename OpNodeEvacuationStrategy and LUNodeEvacuationStrategy

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

13 years agoRename OpAddNode and LUAddNode
Iustin Pop [Sat, 15 Jan 2011 12:05:50 +0000 (13:05 +0100)]
Rename OpAddNode and LUAddNode

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpStartupInstance and LUStartupInstance
Iustin Pop [Sat, 15 Jan 2011 12:05:50 +0000 (13:05 +0100)]
Rename OpStartupInstance and LUStartupInstance

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

13 years agoRename OpShutdownInstance and LUShutdownInstance
Iustin Pop [Sat, 15 Jan 2011 12:05:50 +0000 (13:05 +0100)]
Rename OpShutdownInstance and LUShutdownInstance

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

13 years agoRename OpSetInstanceParams and LUSetInstanceParams
Iustin Pop [Sat, 15 Jan 2011 12:05:50 +0000 (13:05 +0100)]
Rename OpSetInstanceParams and LUSetInstanceParams

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

13 years agoRename OpReplaceDisks and LUReplaceDisks
Iustin Pop [Sat, 15 Jan 2011 12:05:49 +0000 (13:05 +0100)]
Rename OpReplaceDisks and LUReplaceDisks

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpRenameInstance and LURenameInstance
Iustin Pop [Sat, 15 Jan 2011 11:57:46 +0000 (12:57 +0100)]
Rename OpRenameInstance and LURenameInstance

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpRemoveInstance and LURemoveInstance
Iustin Pop [Sat, 15 Jan 2011 11:57:46 +0000 (12:57 +0100)]
Rename OpRemoveInstance and LURemoveInstance

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

13 years agoRename OpReinstallInstance and LUReinstallInstance
Iustin Pop [Sat, 15 Jan 2011 11:57:46 +0000 (12:57 +0100)]
Rename OpReinstallInstance and LUReinstallInstance

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

13 years agoRename OpRecreateInstanceDisks and LURecreateInstanceDisks
Iustin Pop [Sat, 15 Jan 2011 11:57:46 +0000 (12:57 +0100)]
Rename OpRecreateInstanceDisks and LURecreateInstanceDisks

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

13 years agoRename OpRebootInstance and LURebootInstance
Iustin Pop [Sat, 15 Jan 2011 11:57:45 +0000 (12:57 +0100)]
Rename OpRebootInstance and LURebootInstance

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpQueryInstanceData and LUQueryInstanceData
Iustin Pop [Sat, 15 Jan 2011 11:57:45 +0000 (12:57 +0100)]
Rename OpQueryInstanceData and LUQueryInstanceData

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpQueryInstances and LUQueryInstances
Iustin Pop [Sat, 15 Jan 2011 11:57:45 +0000 (12:57 +0100)]
Rename OpQueryInstances and LUQueryInstances

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpMoveInstance and LUMoveInstance
Iustin Pop [Sat, 15 Jan 2011 11:57:04 +0000 (12:57 +0100)]
Rename OpMoveInstance and LUMoveInstance

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpMigrateInstance and LUMigrateInstance
Iustin Pop [Sat, 15 Jan 2011 11:57:04 +0000 (12:57 +0100)]
Rename OpMigrateInstance and LUMigrateInstance

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpGrowDisk and LUGrowDisk
Iustin Pop [Sat, 15 Jan 2011 11:57:04 +0000 (12:57 +0100)]
Rename OpGrowDisk and LUGrowDisk

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpFailoverInstance and LUFailoverInstance
Iustin Pop [Sat, 15 Jan 2011 11:56:18 +0000 (12:56 +0100)]
Rename OpFailoverInstance and LUFailoverInstance

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpDeactivateInstanceDisks and LUDeactivateInstanceDisks
Iustin Pop [Sat, 15 Jan 2011 11:56:18 +0000 (12:56 +0100)]
Rename OpDeactivateInstanceDisks and LUDeactivateInstanceDisks

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpCreateInstance and LUCreateInstance
Iustin Pop [Sat, 15 Jan 2011 11:56:18 +0000 (12:56 +0100)]
Rename OpCreateInstance and LUCreateInstance

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpConnectConsole and LUConnectConsole
Iustin Pop [Sat, 15 Jan 2011 11:56:18 +0000 (12:56 +0100)]
Rename OpConnectConsole and LUConnectConsole

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpActivateInstanceDisks and LUActivateInstanceDisks
Iustin Pop [Sat, 15 Jan 2011 11:56:10 +0000 (12:56 +0100)]
Rename OpActivateInstanceDisks and LUActivateInstanceDisks

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpSetGroupParams and LUSetGroupParams
Iustin Pop [Sat, 15 Jan 2011 11:56:10 +0000 (12:56 +0100)]
Rename OpSetGroupParams and LUSetGroupParams

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpRenameGroup and LURenameGroup
Iustin Pop [Sat, 15 Jan 2011 11:56:10 +0000 (12:56 +0100)]
Rename OpRenameGroup and LURenameGroup

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpRemoveGroup and LURemoveGroup
Iustin Pop [Sat, 15 Jan 2011 11:56:09 +0000 (12:56 +0100)]
Rename OpRemoveGroup and LURemoveGroup

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpQueryGroups and LUQueryGroups
Iustin Pop [Sat, 15 Jan 2011 11:56:09 +0000 (12:56 +0100)]
Rename OpQueryGroups and LUQueryGroups

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpAssignGroupNodes and LUAssignGroupNodes
Iustin Pop [Sat, 15 Jan 2011 11:56:06 +0000 (12:56 +0100)]
Rename OpAssignGroupNodes and LUAssignGroupNodes

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpAddGroup and LUAddGroup
Iustin Pop [Sat, 15 Jan 2011 11:56:05 +0000 (12:56 +0100)]
Rename OpAddGroup and LUAddGroup

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpVerifyDisks and LUVerifyDisks
Iustin Pop [Sat, 15 Jan 2011 11:56:05 +0000 (12:56 +0100)]
Rename OpVerifyDisks and LUVerifyDisks

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpVerifyCluster and LUVerifyCluster
Iustin Pop [Sat, 15 Jan 2011 11:56:01 +0000 (12:56 +0100)]
Rename OpVerifyCluster and LUVerifyCluster

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpSetClusterParams and LUSetClusterParams
Iustin Pop [Sat, 15 Jan 2011 11:56:01 +0000 (12:56 +0100)]
Rename OpSetClusterParams and LUSetClusterParams

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpRepairDiskSizes and LURepairDiskSizes
Iustin Pop [Sat, 15 Jan 2011 11:56:00 +0000 (12:56 +0100)]
Rename OpRepairDiskSizes and LURepairDiskSizes

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpRenameCluster and LURenameCluster
Iustin Pop [Sat, 15 Jan 2011 11:55:56 +0000 (12:55 +0100)]
Rename OpRenameCluster and LURenameCluster

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpRedistributeConfig and LURedistributeConfig
Iustin Pop [Sat, 15 Jan 2011 11:55:56 +0000 (12:55 +0100)]
Rename OpRedistributeConfig and LURedistributeConfig

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpQueryClusterInfo and LUQueryClusterInfo
Iustin Pop [Sat, 15 Jan 2011 11:55:52 +0000 (12:55 +0100)]
Rename OpQueryClusterInfo and LUQueryClusterInfo

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpPostInitCluster and LUPostInitCluster
Iustin Pop [Sat, 15 Jan 2011 11:55:42 +0000 (12:55 +0100)]
Rename OpPostInitCluster and LUPostInitCluster

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpDestroyCluster and LUDestroyCluster
Iustin Pop [Sat, 15 Jan 2011 11:55:42 +0000 (12:55 +0100)]
Rename OpDestroyCluster and LUDestroyCluster

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpQueryConfigValues and LUQueryConfigValues
Iustin Pop [Sat, 15 Jan 2011 11:55:42 +0000 (12:55 +0100)]
Rename OpQueryConfigValues and LUQueryConfigValues

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpRemoveExport and LURemoveExport
Iustin Pop [Sat, 15 Jan 2011 11:55:37 +0000 (12:55 +0100)]
Rename OpRemoveExport and LURemoveExport

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpQueryExports and LUQueryExports
Iustin Pop [Sat, 15 Jan 2011 11:55:37 +0000 (12:55 +0100)]
Rename OpQueryExports and LUQueryExports

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpPrepareExport and LUPrepareExport
Iustin Pop [Sat, 15 Jan 2011 11:55:30 +0000 (12:55 +0100)]
Rename OpPrepareExport and LUPrepareExport

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoRename OpExportInstance and LUExportInstance
Iustin Pop [Sat, 15 Jan 2011 11:55:30 +0000 (12:55 +0100)]
Rename OpExportInstance and LUExportInstance

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoFix the OP_ID of OpAssignGroupNodes
Iustin Pop [Sat, 15 Jan 2011 10:34:32 +0000 (11:34 +0100)]
Fix the OP_ID of OpAssignGroupNodes

Commit 96276ae added the above opcode, but forgot to update the OP_ID
per our previous mailing list discussions. This patch makes the OP_ID
be consistent with the other IDs (OP_$object_$action).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoFix bug introduced by f5677ab
Iustin Pop [Sat, 15 Jan 2011 13:11:56 +0000 (14:11 +0100)]
Fix bug introduced by f5677ab

Commit f5677ab added the _VerifyOob functionality, but there are two
issues with this function:

- a real bug, as objects.Node doesn't have a 'master' attribute
- a design bug, as we need to verify the OOB programs not only on
  current masters, but on all nodes that can become masters via the
  auto-promote functionality; otherwise, an automated cluster operation
  could cause the cluster to become inconsistent (error in verify)

The Node.master bug didn't appear in QA because it is triggered only
with non-master-candidate nodes, and our QA doesn't test this
combination (and neither other node flags combination).

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

13 years agoMerge branch 'devel-2.3' into devel-2.4
Guido Trotter [Fri, 14 Jan 2011 16:15:32 +0000 (16:15 +0000)]
Merge branch 'devel-2.3' into devel-2.4

* devel-2.3:
  Allow burnin with hidden OSes

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

13 years agoAllow burnin with hidden OSes
Guido Trotter [Fri, 14 Jan 2011 13:56:41 +0000 (13:56 +0000)]
Allow burnin with hidden OSes

burnin is a cluster/testing feature, so it makes sense that a hidden OS
can be used for it.

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

13 years agoBump version for Ganeti 2.4.0~beta1 v2.4.0beta1
Michael Hanselmann [Fri, 14 Jan 2011 11:11:45 +0000 (12:11 +0100)]
Bump version for Ganeti 2.4.0~beta1

Update the version in all necessary places. Update NEWS with release
date.

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

13 years agoUpdate NEWS for Ganeti 2.4
Michael Hanselmann [Fri, 14 Jan 2011 09:58:04 +0000 (10:58 +0100)]
Update NEWS for Ganeti 2.4

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

13 years agoUpdate RPC protocol version for Ganeti 2.4
Michael Hanselmann [Fri, 14 Jan 2011 10:51:04 +0000 (11:51 +0100)]
Update RPC protocol version for Ganeti 2.4

As it's quite easy to forget updating the protocol version (and was
actually forgotten for Ganeti 2.3), it is now derived from the
configuration version (which is equivalent with the Ganeti version). The
protocol version for Ganeti 2.4 will be 2040000.

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

13 years agoSet +x on tools/ganeti-listrunner
Michael Hanselmann [Fri, 14 Jan 2011 09:30:24 +0000 (10:30 +0100)]
Set +x on tools/ganeti-listrunner

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoMerge branch 'devel-2.3'
René Nussbaumer [Fri, 14 Jan 2011 09:32:37 +0000 (10:32 +0100)]
Merge branch 'devel-2.3'

Conflicts:
doc/design-2.3.rst
  This was a minor conflict with some rewording of a phrase

lib/client/gnt_instance.py
  Removed _FormatParameterDict function as it was moved to cli.py in
  master branch

Reviewed-by: Michael Hanselmann <hansmi@google.com>

13 years agoquery: Update docstrings
Michael Hanselmann [Wed, 12 Jan 2011 11:54:12 +0000 (12:54 +0100)]
query: Update docstrings

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoFix growing of DRBD disks
Iustin Pop [Thu, 13 Jan 2011 15:51:57 +0000 (16:51 +0100)]
Fix growing of DRBD disks

Patch 03941a26 made disk growth VG-aware, but the code has a bug: it
only works for LD_LV disks, and not LD_DRBD. To fix it, we add a
generic function to compute the per-VG growth requirements, and switch
to using that instead of manual build.

Furthermore, since the function _CheckNodesFreeDiskPerVG always takes
its input from this new function or _ComputeDiskSizePerVG, we change
the latter to always return a dict (possibly empty), instead of either
a dict or None. This makes the types more consistent.

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

13 years agoList node parameters in gnt-group list
René Nussbaumer [Wed, 12 Jan 2011 09:50:17 +0000 (10:50 +0100)]
List node parameters in gnt-group list

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: Adeodato Simo <dato@google.com>

13 years agoList node parameters (if any) in gnt-node info
René Nussbaumer [Wed, 12 Jan 2011 09:28:13 +0000 (10:28 +0100)]
List node parameters (if any) in gnt-node info

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

13 years agoList node parameters in gnt-cluster info output
René Nussbaumer [Wed, 12 Jan 2011 09:16:02 +0000 (10:16 +0100)]
List node parameters in gnt-cluster info output

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoFix typos in RAPI docstrings, add unittest
Michael Hanselmann [Wed, 12 Jan 2011 12:54:02 +0000 (13:54 +0100)]
Fix typos in RAPI docstrings, add unittest

This patch fixes a number of typos and standardizes RAPI resource
docstrings. A unittest is added.

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

13 years agoMove FormatParameterDict from gnt_instance.py to cli.py
René Nussbaumer [Wed, 12 Jan 2011 12:57:58 +0000 (13:57 +0100)]
Move FormatParameterDict from gnt_instance.py to cli.py

This function is useful for other cli-tools who need to display
a dict based parameter field.

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Adeodato Simo <dato@google.com>

13 years agognt-group modify: ndparams not correctly updated
René Nussbaumer [Wed, 12 Jan 2011 14:49:27 +0000 (15:49 +0100)]
gnt-group modify: ndparams not correctly updated

ndparams should delete keys which are reset to default

Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Adeodato Simo <dato@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoAdd Ganeti 2.4 design document
Michael Hanselmann [Wed, 12 Jan 2011 11:08:59 +0000 (12:08 +0100)]
Add Ganeti 2.4 design document

It contains links to the two implemented designs. The detailed documents
are removed from the visible table of contents to not show up on their
own.

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

13 years agolast_resort groups prioritized by iallocator plugin
Stephen Shirley [Wed, 12 Jan 2011 10:46:09 +0000 (11:46 +0100)]
last_resort groups prioritized by iallocator plugin

Also change language slightly for preferred groups to look better now
that it's repeated.

Signed-off-by: Stephen Shirley <diamond@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

13 years agoRemove --master-netdev default value
Guido Trotter [Wed, 12 Jan 2011 11:33:39 +0000 (11:33 +0000)]
Remove --master-netdev default value

Since the --master-netdev option is now used both at cluster init and at
cluster modify time, it cannot have a default value of DEFAULT_BRIDGE
(xen-br0) anymore. As such at cluster init we make the initialization
explicit if another value hasn't been passed. This fixes gnt-cluster
modify changing the master_netdev to xen-br0 if called without that
argument.

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

13 years agoRun pylint over QA code too
Iustin Pop [Wed, 12 Jan 2011 08:59:29 +0000 (09:59 +0100)]
Run pylint over QA code too

Right now, the QA code is not covered by pylint, and this shows at
least one low-impact bug.

This patch does the necessary changes to make QA pylint-clean, and the
changes the makefile to run pylint for it.

Notable changes:

- qa_utils.GenericQueryTest: randfields was not used at all, and my
  belief is that it was indented to be used in order not to modify the
  input list; so I replaced randfields with fields, so we only shuffle
  the our local copy
- qa_node.TestOutOfBand was using it's own copy of AcquireNode(), so I
  replaced it with the existing version
- qa_os: was using 'dir' in a couple of places, replaced with dirname

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

13 years agoQA: use a persistent SSH connection to the master
Iustin Pop [Tue, 11 Jan 2011 14:56:17 +0000 (15:56 +0100)]
QA: use a persistent SSH connection to the master

The recent additions to QA (many more tests) make QA slow if the
machine on which the QA runs is not very close to the tested nodes —
or in general, when the SSH handhaske is costly.

We discussed before about using a persistent connection, and here is
the patch that implements it. On a very small QA (very very small), it
cuts down a lot of time (almost half), so it should be useful even for
a full QA.

I've also thought about changing from external ssh to paramiko, but I
estimated that it would be more work to correctly interleave the IO
from the remote process than just running a background SSH.

Also note that yes, the global dict is ugly, but I don't know of
another simple way to implement this.

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

13 years agoQA: Fix duplicated OOB tests
Iustin Pop [Tue, 11 Jan 2011 17:50:15 +0000 (18:50 +0100)]
QA: Fix duplicated OOB tests

Patch f55312bd added the OOB tests to TestClusterVerify, which is not
actually a test for cluster verify, but a runner for cluster verify
that is called multiple times, for each instance type, etc. This led
to running the OOB commands multiple times, which is painful
especially as this is a slow test.

The patch moves this to a separate test, that is run only once.

Furthermore, the way that data files are copied around is very
inefficient: touch + mv + chmod + mv + rm for each node (5 times
number of nodes), whereas it could be simply: touch on master, chmod
on master, cluster copyfile, chmod on master, cluster copyfile,
cluster command rm, i.e. only 5 fixed ssh calls to the master. The
code is changed as such, for increased speed.

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

13 years agoAdd ability to retain specified fds open in RunCmd
Apollon Oikonomopoulos [Mon, 10 Jan 2011 16:05:26 +0000 (18:05 +0200)]
Add ability to retain specified fds open in RunCmd

Passing tap devices to KVM as file descriptors requires that the respective
file decriptors remain open during utils.RunCmd execution. To this direction,
we add a “noclose_fds” keyword argument to utils.RunCmd, accepting a list of
file descriptors to keep open. The actual fd handling is implemented in
_RunCmdPipe and _RunCmdFile using subprocess.Popen's “preexec_fn”[1],
since subprocess.Popen provides no other way to selectively handle fds.

A small modification is also made to test/ganeti.utils_unittest.py to comply
with _RunCmdPipe's new API and a new unit test is added to test the selective
fd retention functionality.

[1] “If preexec_fn is set to a callable object, this object will be called in
     the child process just before the child is executed. (Unix only)”
    Subprocess documentation

Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

13 years agoAdd tests for objects.Instance
Michael Hanselmann [Tue, 11 Jan 2011 15:30:21 +0000 (16:30 +0100)]
Add tests for objects.Instance

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

13 years agoobjects: Fix off-by-one in error message
Michael Hanselmann [Tue, 11 Jan 2011 15:29:51 +0000 (16:29 +0100)]
objects: Fix off-by-one in error message

For an instance with a single disk the message should be “… disks 0 to
0”, not “… 0 to 1”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

13 years agoutils: Cleanup and sort wildcard imports
Michael Hanselmann [Tue, 11 Jan 2011 14:49:26 +0000 (15:49 +0100)]
utils: Cleanup and sort wildcard imports

Also convert the per-line pylint instructions to one per-module
instruction.

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

13 years agoutils: Drop RemovePidFile
Michael Hanselmann [Tue, 11 Jan 2011 11:34:19 +0000 (12:34 +0100)]
utils: Drop RemovePidFile

It's equivalent to a simple RemoveFile now.

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

13 years agoutils: Move NewUUID to utils.io
Michael Hanselmann [Tue, 11 Jan 2011 11:39:28 +0000 (12:39 +0100)]
utils: Move NewUUID to utils.io

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

13 years agoutils: Move more text-related code
Michael Hanselmann [Tue, 11 Jan 2011 11:39:01 +0000 (12:39 +0100)]
utils: Move more text-related code

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

13 years agoutils: Move process-related code into separate file
Michael Hanselmann [Tue, 11 Jan 2011 12:10:54 +0000 (13:10 +0100)]
utils: Move process-related code into separate file

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

13 years agoutils: Move ResetTempfileModule to wrappers module
Michael Hanselmann [Tue, 11 Jan 2011 11:12:46 +0000 (12:12 +0100)]
utils: Move ResetTempfileModule to wrappers module

It's not exactly a wrapper, but this seemed like the best place.

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

13 years agoutils: Move RunningTimeout to utils.algo
Michael Hanselmann [Tue, 11 Jan 2011 11:07:24 +0000 (12:07 +0100)]
utils: Move RunningTimeout to utils.algo

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