Iustin Pop [Thu, 17 Mar 2011 15:47:06 +0000 (16:47 +0100)]
Merge remote branch 'htools/master'
* htools/master: (605 commits)
Update NEWS file for version 0.3.1
Update copyright years in the man pages
Remove obsolete env vars from the manpages
Fix dist archive generation
luxi backend: show attribute names in errors
Update exit code information in the hbal man page
Fix broken hscolour.css symlink in tarball
Update NEWS file for the 0.3.0 release
Remove an obsolete TODO
Update live-test.sh w.r.t. simulation mode changes
Prevent allocation on unallocable node groups
Fix bug in simulation backend
Precompute allocation nodes
Change the AllocNodes type and functions
Extract node pair generation from tryAlloc
tryAlloc: restrict valid node pairs to same-group
Cluster.hs: add a new type alias
Rapi: read and use the vm_capable node flag
IAllocator: read and use the vm_capable node flag
IAllocator: replace fake policy with real one
...
Note: done via the following sequence of commands:
git checkout master && git pull
git remote add htools git://git.ganeti.org/htools.git
git remote update
git merge -s recursive -X subtree=htools htools/master
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 17 Mar 2011 10:06:20 +0000 (11:06 +0100)]
Add temporary dir/file for htools import
In order for “git merge -s recursive -X subtree=htools” to do its
magic, an (mostly empty) directory must exist in the target tree name
‘htools’. Hence we add a temp file to it before the merge, and remove
it after that.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Thu, 17 Mar 2011 10:52:23 +0000 (11:52 +0100)]
Fix hook node list when adding node
This broke QA (and everyone trying to add a node) by complaining about
different node lists.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 16 Mar 2011 17:35:18 +0000 (18:35 +0100)]
hooks: Provide variables with post-opcode values
When a hook is called, it is provided with a number of variables
describing the status of the instance/node/etc. before the operation.
Some opcodes provide extra variables to see modified values from hooks,
but that's not a generic solution.
This patch modifies the code calling hooks to generate the environment
once before and once after an opcode has been executed. Doing so should
be safe—I did not find any LU.BuildHooksEnv modifying LU instance
attributes. The values collected after running the opcode are prefixed
with “GANETI_POST_”, as opposed to “GANETI_” for pre-execution
variables. The latter are still provided for backwards compatibility.
Environment variable examples:
gnt-instance start $instance:
GANETI_INSTANCE_STATUS=down
GANETI_POST_INSTANCE_STATUS=up
gnt-instance modify -B memory=512 $instance:
GANETI_INSTANCE_BE_memory=768
GANETI_POST_INSTANCE_BE_memory=512
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 16 Mar 2011 12:59:32 +0000 (13:59 +0100)]
HooksMaster: Add more assertions for variable names
Also replace explicit loop with dict.update.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 15 Mar 2011 16:59:15 +0000 (17:59 +0100)]
mcpu: Tidy HooksMaster a bit
- Dictionary indentation
- Add empty lines for readability
- Simplify conditional code
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 15 Mar 2011 16:25:49 +0000 (17:25 +0100)]
cmdlib: Factorize running post-pase hook
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 11 Mar 2011 13:26:24 +0000 (14:26 +0100)]
QA: Add tests for queries via RAPI
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Tue, 15 Mar 2011 13:08:13 +0000 (14:08 +0100)]
qlang: Remove unused import
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Fri, 11 Mar 2011 13:25:24 +0000 (14:25 +0100)]
RAPI: Add support for querying resources
- Access is only permitted for authenticated clients (queries can return
sensitive data)
- Filters can be specified when sending a PUT request
- Updates RAPI client, documentation and tests
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Tue, 8 Mar 2011 13:14:11 +0000 (14:14 +0100)]
Add support for query resources in RAPI URIs
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Fri, 11 Mar 2011 13:26:06 +0000 (14:26 +0100)]
masterd: Simplify code for field queries
Instead of going via cmdlib and using special cases for different
resources, the list of fields is used directly.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Fri, 11 Mar 2011 13:26:17 +0000 (14:26 +0100)]
constants: Rename QR_OP_*, add QR_VIA_RAPI
Commit
28b71a76 added a list of resources which can be queried using
LUXI. Unfortunately the variable was named “QR_OP_LUXI”, which can be
confusing. This patch renames “QR_OP_QUERY” to “QR_VIA_OP”, “QR_OP_LUXI”
to “QR_VIA_LUXI” and adds a new variable, currently equal to
“QR_VIA_LUXI”, for remote API queries (mostly for documentation).
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Fri, 11 Mar 2011 14:57:37 +0000 (15:57 +0100)]
qlang: Remove unused ReadSimpleFilter
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
René Nussbaumer [Tue, 15 Mar 2011 08:23:23 +0000 (09:23 +0100)]
TLReplaceDisks: Add check if disks are activated
Previously we failed later with a rather useless error message. This
patch fixes this and tells the user to activate-disks if replace-disks
is in the need of activated disks rather than abort with a cryptic error
message.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 8 Mar 2011 10:43:42 +0000 (11:43 +0100)]
LUOsDiagnose: Move legacy behaviour into filter
The behaviour of LUOsDiagnose needs special treatment. Commit
d22dfef7
changed it to not return hidden, blacklisted or invalid OSes if the
respective field is not requested. This behaviour needs to be preserved
for users of the old opcode, but since it provides an implicit
filtering, it should not be done for LUQuery (the generic way to query
for resources) and is therefore moved from the underlying implementation
to LUOsDiagnose. Users of the new opcode should pass an explicit filter.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 7 Mar 2011 13:48:46 +0000 (14:48 +0100)]
Convert OsDiagnose to query
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 11 Mar 2011 16:08:49 +0000 (17:08 +0100)]
qlang: Add some more documentation for filters
It's not perfect, but at least some more.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 11 Mar 2011 13:54:50 +0000 (14:54 +0100)]
query: Add conversion wrapper
Allows converting the value of a column before returning it. Useful for
sorting while still using one of the other generic functions for
retrieving the value.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Fri, 11 Mar 2011 16:56:23 +0000 (17:56 +0100)]
Fix epydoc warning about unknown reference
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 11 Mar 2011 16:29:41 +0000 (17:29 +0100)]
config: Wrap MatchNameComponent, reduce lock duration
- Remove duplication by merging two MatchNameComponent into a wrapper
- Reduce lock duration by getting list of names under lock and then
matching names without the lock
- Also, ExpandNodeName's docstring is fixed.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 8 Mar 2011 13:13:50 +0000 (14:13 +0100)]
opcodes: Document OpQueryFields' parameters
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Fri, 11 Mar 2011 10:12:36 +0000 (11:12 +0100)]
Update NEWS file for version 0.3.1
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Balazs Lecz <leczb@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Fri, 11 Mar 2011 10:07:35 +0000 (11:07 +0100)]
Update copyright years in the man pages
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Balazs Lecz <leczb@google.com>
Iustin Pop [Fri, 11 Mar 2011 10:05:40 +0000 (11:05 +0100)]
Remove obsolete env vars from the manpages
Commit
16c2369c removed support for using environment variables for
selecting the text backend (since now it's just one option), but
didn't update the man pages.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Balazs Lecz <leczb@google.com>
Iustin Pop [Wed, 9 Mar 2011 16:23:10 +0000 (17:23 +0100)]
Instance failover: fix bug for INT_MIRROR cases
Patches
db366d9a and
aac4511a added support for EXT_MIRROR instances,
but inadvertently introduced a bug: for INT_MIRROR cases, we don't
need (actually we can't support) neither an iallocator nor a target
node.
To fix this, we move the iallocator/node checks in CheckPrereq (or
respectively in the tasklet CheckPrereq), where we have access to the
instance configuration, and additionally we check for and prevent
passing either of these two for INT_MIRROR instances.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
René Nussbaumer [Wed, 9 Mar 2011 09:50:57 +0000 (10:50 +0100)]
gnt-cluster epo: Adding --power-delay flag
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Wed, 9 Mar 2011 09:47:35 +0000 (10:47 +0100)]
gnt-node power: Adding --power-delay flag
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Wed, 9 Mar 2011 09:44:16 +0000 (10:44 +0100)]
cli.py: Adding POWER_DELAY_OPT
The command line option --power-delay sets the time waited between power
ons.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Tue, 8 Mar 2011 10:56:57 +0000 (11:56 +0100)]
OpOobCommand: Adding power on delay
This delays the invocation of the power on of the next node. So if you
power on a bunch of nodes it will not blow the fuse.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
René Nussbaumer [Tue, 8 Mar 2011 10:56:25 +0000 (11:56 +0100)]
OpOobCommand: Document all fields
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
René Nussbaumer [Tue, 8 Mar 2011 10:34:15 +0000 (11:34 +0100)]
gnt-cluster epo: Adding --shutdown-timeout
This adds the --shutdown-timeout flag to gnt-cluster epo to specify the
shutdown timeout for instance shutdown.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Apollon Oikonomopoulos [Mon, 28 Feb 2011 11:51:16 +0000 (13:51 +0200)]
Rename DTS_NET_MIRROR to DTS_INT_MIRROR
DTS_INT_MIRROR better contrasts DTS_EXT_MIRROR.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
[iustin@google.com: updated patch for changed context]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Apollon Oikonomopoulos [Mon, 28 Feb 2011 11:51:15 +0000 (13:51 +0200)]
Shared file support for tools/burnin
Make burnin work with -t sharedfile and update burnin's help.
Shared block storage support is *not* included, as currently there is no way to
provision shared block storage from within Ganeti.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Apollon Oikonomopoulos [Mon, 28 Feb 2011 11:51:14 +0000 (13:51 +0200)]
KVM: use cache=none for shared disk templates
Disable host cache for externally mirrored disks to avoid cache incoherency.
Without this, migrations between the same two nodes may end up in disk
corruption.
This is a runtime override of cluster defaults, mostly a workaround.
Unfortunately, we cannot use cmdlib._CheckHVParams, as we want to check the
hypervisor parameters *in conjunction* with the disk template, which is part of
the instance definition.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Apollon Oikonomopoulos [Mon, 28 Feb 2011 11:51:13 +0000 (13:51 +0200)]
Shared storage instance failover
Modify LUFailoverInstance to enable shared storage instances to failover.
Shared storage instance failover requires either a target node or an
iallocator to determine the target node. If none is given, the cluster default
iallocator is used.
The hook environment variables {OLD,NEW}_SECONDARY will be blank for shared
storage instances.
Locking behaviour is the same as for instance migration.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
[iustin@google.com: revert the DTS_NET_MIRROR specific changes]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Apollon Oikonomopoulos [Mon, 28 Feb 2011 11:51:12 +0000 (13:51 +0200)]
Shared storage node migration
Modify LUNodeMigrate to provide node migration for nodes with instances using
shared storage. gnt-node migrate has to be passed an iallocator for migration
of shared storage instances to be performed. When using a shared storage
backend, all cluster nodes are locked.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Apollon Oikonomopoulos [Mon, 28 Feb 2011 11:51:11 +0000 (13:51 +0200)]
Shared storage instance migration
Modify LUMigrateInstance and TLMigrateInstance to allow instance migrations for
instances with DTS_EXT_MIRROR disk templates.
Migrations of shared storage instances require either a target node, or an
iallocator to determine the target node. If none is given, the cluster default
iallocator is used.
Locking behaviour: If the iallocator is used, then initially all nodes are
locked and subsequently only the locks on the source node and the target node
selected by the iallocator are retained.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
[iustin@google.com: small changes in cmdlib.py]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Apollon Oikonomopoulos [Mon, 28 Feb 2011 11:51:10 +0000 (13:51 +0200)]
CLI changes to facilitate shared storage migration/failover
Add DST_NODE_OPT to cli.py to use for directly specifying the target node
during migration/failover.
gnt-instance failover/migrate also get passed an iallocator option.
gnt-node failover/migrate get only a target_node option.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Apollon Oikonomopoulos [Mon, 28 Feb 2011 11:51:09 +0000 (13:51 +0200)]
Migration and failover: add iallocator and target_node slots
Add iallocator and target_node slots to OpMigrateInstance and
OpFailoverInstance to facilitate shared-storage-backed instance mobility. Add
iallocator slot to OpMigrateNode (no explicit target_node in this case).
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Apollon Oikonomopoulos [Mon, 28 Feb 2011 11:51:08 +0000 (13:51 +0200)]
IAllocator changes to work with shared storage
Make cmdlib.IAllocator shared-storage-aware. IAllocator requires secondary
nodes only on DTS_NET_MIRROR disk templates and requires no secondaries for
DTS_EXT_MIRROR templates.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Apollon Oikonomopoulos [Fri, 4 Mar 2011 14:35:23 +0000 (16:35 +0200)]
Shared block storage support
This patch introduces basic shared block storage support.
It introduces a new storage backend, bdev.PersistentBlockDevice, to
use as a backend for shared block storage. The new bdev requires a new
BLOCKDEV_DRIVER_MANUAL constant with the value "manual" and uses it as
the first part of the block device unique_id.
A new disk template, DT_BLOCK is introduced as well and added to
DTS_EXT_MIRROR and DTS_MAY_ADOPT. Also added DTS_MUST_ADOPT constant
and use it to check for the presence of the adopt keyword during LU
invocation. We enforce the /dev/disk limitation upon adoption, but we
allow block devices to reside anywhere under /dev.
This is very basic support and includes no storage manipulation (provisioning,
resizing, renaming) which will have to be implemented through a "driver"
framework.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
[iustin@google.com: slight changes to bdev.py]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Apollon Oikonomopoulos [Fri, 4 Mar 2011 14:28:58 +0000 (16:28 +0200)]
Add bdev_sizes RPC call
The bdev_sizes multi-node RPC call returns the sizes of the requested
block devices on the desired nodes. Its intended use is to verify the
existence of a block device on a given node for shared block storage
support.
Block device paths are expected to lie under constants.BLOCKDEV_DIR
("/dev/disk" by default), where persistent symlinks for block devices
are assumed to exist.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
[iustin@google.com: small changes in backend.py]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 7 Mar 2011 19:01:08 +0000 (20:01 +0100)]
QA: Improve tests for gnt-os
- Test OS lists via command line and RAPI
- Test “gnt-os diagnose” and “gnt-os info”
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 7 Mar 2011 18:59:24 +0000 (19:59 +0100)]
QA: Add utility to ensure item is not in sequence
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 7 Mar 2011 16:46:33 +0000 (17:46 +0100)]
QA: Rename OS state test for clarification
Also add an additional check to ensure the OS does not exist.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 7 Mar 2011 16:45:57 +0000 (17:45 +0100)]
QA: Use constants instead of hardcoded numbers
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Wed, 23 Feb 2011 13:45:45 +0000 (14:45 +0100)]
Log log-file reopening
This makes the log files get an record notifying of the reopen, so as
to force creation of the log files soon after rotation.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Mon, 7 Mar 2011 13:33:48 +0000 (14:33 +0100)]
Merge branch 'stable-2.4'
* stable-2.4:
Release 2.4.0
Small improvement to the ganeti man page
Fix LUClusterRepairDiskSizes and rpc result usage
Fix RPC mismatch in blockdev_getsize[s]
RAPI: fix evacuate node resource
Fix typo in kvm-ifup script
NEWS: Replace smartquotes, start lines with uppercase
Fix LU processor's GetECId
Update NEWS and release 2.4.0 rc3
Fix potential data-loss bug in disk wipe routines
1-char comment typo fix
Expand some acronyms, add to glossary
Conflicts:
NEWS (trivial)
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Wed, 2 Mar 2011 17:34:42 +0000 (18:34 +0100)]
query: Add operator for truth
The “?” operator is the equivalent of “if var” in Python.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Mon, 7 Mar 2011 11:00:51 +0000 (12:00 +0100)]
Release 2.4.0
NEWS update and version bump.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Mon, 7 Mar 2011 09:50:27 +0000 (10:50 +0100)]
Merge branch 'devel-2.3' into devel-2.4
* devel-2.3:
Fix LUClusterRepairDiskSizes and rpc result usage
Fix RPC mismatch in blockdev_getsize[s]
RAPI: fix evacuate node resource
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Thu, 3 Mar 2011 10:16:39 +0000 (11:16 +0100)]
Small improvement to the ganeti man page
Also specifies the comma-escaping feature.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Fri, 4 Mar 2011 11:36:15 +0000 (12:36 +0100)]
Merge branch 'devel-2.2' into devel-2.3
* devel-2.2:
Fix LUClusterRepairDiskSizes and rpc result usage
Fix RPC mismatch in blockdev_getsize[s]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Tue, 15 Feb 2011 13:39:44 +0000 (14:39 +0100)]
Fix LUClusterRepairDiskSizes and rpc result usage
This LU was introduced before the RPC result conversion from .data to
.payload, and it has managed to keep the old-style usage (how? it's
the only LU that does so). Fix by changing to payload, and add some
extra logging for easier diagnose.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Stephen Shirley <diamond@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
(cherry picked from commit
043beb38f4e10b75d0820c361c668c441c7a6980)
Iustin Pop [Tue, 15 Feb 2011 13:29:08 +0000 (14:29 +0100)]
Fix RPC mismatch in blockdev_getsize[s]
Commit
92fd2250 added consistency checks in the RPC layer, which broke
the call_blockdev_getsizes RPC call (declared with 's' at the end in
rpc.py, without 's' in the node daemon).
The immediate fix is to correct the rpc function name, the long term
one will be to remove this duplication.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Stephen Shirley <diamond@google.com>
(cherry picked from commit
ccfbbd2d1546b4f57d5bfeb115573967f7fb558b)
Iustin Pop [Fri, 4 Mar 2011 10:04:10 +0000 (11:04 +0100)]
RAPI: fix evacuate node resource
PollJob returns the whole op_results, hence a list of opcode results.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
René Nussbaumer [Fri, 4 Mar 2011 09:38:38 +0000 (10:38 +0100)]
gnt-instance rename: Update the man-page
In commit
31fe5102a a additional check was added. This patch rephrases
the man page accordingly to address this change.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Thu, 3 Mar 2011 09:18:08 +0000 (10:18 +0100)]
LUInstanceRename: Fail if renamed hostname mismatch
There's a problem if you run gnt-instance rename with a non FQDN and the
renamed LU tries to resolve the hostname to make it FQDN. It could be
that this resolved hostname was just a CNAME to another name which leads
to wrongly renamed instances name.
Given a name of "foobar" is a CNAME to "moohost" now if you gonna rewrite an
instance named "foobar1" to "foobar" it will pickup the host "moohost".
This is not obvious behaviour. If we detect this case we abort with a
prereq error. The user then however can continue with a FQDN and
--no-name-check if he intends to force the operation.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 2 Mar 2011 21:36:01 +0000 (13:36 -0800)]
Merge remote branch 'stable-2.4' into devel-2.4
* origin/stable-2.4:
Fix typo in kvm-ifup script
NEWS: Replace smartquotes, start lines with uppercase
Update NEWS and release 2.4.0 rc3
Fix potential data-loss bug in disk wipe routines
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Wed, 16 Feb 2011 13:54:46 +0000 (13:54 +0000)]
Remove bridge field from rapi daemon
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 16 Feb 2011 13:54:33 +0000 (13:54 +0000)]
Remove bridge field from rapi client
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 16 Feb 2011 13:53:33 +0000 (13:53 +0000)]
Fix test rapi request
This was wrong even before, as it contained both a bridge and a link,
which are incompatible when passed together. Fix by passing only the
link field.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Wed, 16 Feb 2011 12:19:04 +0000 (12:19 +0000)]
Remove deprecated 'bridge' nic parameter
This has been a synonym for "link" since a few major versions.
Add a NEWS entry so we won't forget to mention it at release time.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Wed, 16 Feb 2011 12:09:11 +0000 (12:09 +0000)]
Unhardcode constants from instance batch create
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Guido Trotter [Wed, 16 Feb 2011 12:02:28 +0000 (12:02 +0000)]
Add comments about INIC, IDISK and NIC constants
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Tue, 1 Mar 2011 17:25:04 +0000 (18:25 +0100)]
query: Fix bug when names are specified
If the client/caller would specify names through the use of a filter,
the result would be sorted. This is a regression over earlier Ganeti
versions and verified in QA. This patch adds an optional parameter to
control the sorting and provides unittests.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Tue, 1 Mar 2011 17:32:40 +0000 (18:32 +0100)]
Fix typo in kvm-ifup script
Reported-by: Bas Tichelaar <bas@30loops.net>
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Apollon Oikonomopoulos [Mon, 28 Feb 2011 11:51:05 +0000 (13:51 +0200)]
Add DTS_MIRRORED frozenset
Use DTS_MIRRORED to indicate mirrored disk templates that allow
migrations/failover.
DTS_MIRRORED is the union of DTS_EXT_MIRROR and DTS_NET_MIRROR.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Apollon Oikonomopoulos [Mon, 28 Feb 2011 11:51:04 +0000 (13:51 +0200)]
Shared file storage initialization code
Add shared file storage handling during cluster initialization.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Apollon Oikonomopoulos [Mon, 28 Feb 2011 11:51:03 +0000 (13:51 +0200)]
Core shared file storage support
This patch introduces core file storage support, consisting of the following:
A configure-time switch for enabling/disabling shared file storage
support and controlling the shared file storage location:
--with-shared-file-storage-dir=. Shared file storage configuration is then
available as _autoconf.ENABLE_SHARED_FILE_STORAGE and
_autoconf.SHARED_FILE_STORAGE_DIR and there is a cluster-wide ssconf
key named "shared_file_storage_dir" for changing the file location.
A new disk template named "sharedfile" (DT_SHARED_FILE), using
ganeti.bdev.FileStorage.
Auxiliary functions in lib/config.py to handle shared file storage.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
[iustin@google.com: small style fixes]
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Apollon Oikonomopoulos [Mon, 28 Feb 2011 11:51:02 +0000 (13:51 +0200)]
Add shared file storage design doc
Add doc/design-shared-storage.rst to document the proposed changes and update
Makefile.am respectively.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 28 Feb 2011 11:23:08 +0000 (12:23 +0100)]
cmdlib: Allow use of more complex filters
This patch finally enables the use of complex filters through opcodes
and LUXI.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Mon, 28 Feb 2011 11:22:50 +0000 (12:22 +0100)]
query: Add support for filters
This patch adds a “compiler” for query filters, converting them to a
callable function used while preparing the query result. In addition, a
hints call allows some analysis to be done on the query (e.g. referenced
names), making data collection more efficient.
The depth of filters is limited to avoid exceeding the runtime's maximum
recursion depth.
More operators and other improvements can be implemented using this
base. Extensive unittests are provided.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Fri, 25 Feb 2011 14:27:32 +0000 (15:27 +0100)]
Add query field flags
Some fields (e.g. “name”) should be treated specially when comparing for
equality. Hypervisor names should use normal rules, but for node names,
“node2” should be equivalent with “node2.example.com”.
To make these differences, a new field for flags is added to the query
fields. It is not added to ”objects.QueryFieldDefinition” (the first
item) as it would be exported to clients, something not desired for
these internal rules. Instead, an additional field is added.
Other special rules, e.g. “a list of strings” for an instance's
secondary nodes, can be implemented as flags, too.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Fri, 25 Feb 2011 11:42:30 +0000 (12:42 +0100)]
qlang: Add new operators
These are only used programmatically, not exposed to the user.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Mon, 28 Feb 2011 15:26:00 +0000 (16:26 +0100)]
NEWS: Replace smartquotes, start lines with uppercase
- Sphinx converts ASCII quotes ("") to smartquotes (“”) automatically
- Sentences or list items start with an uppercase letter
- Changed description of non-verbose “gnt-* list” output slightly
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 28 Feb 2011 17:01:43 +0000 (18:01 +0100)]
Fix LU processor's GetECId
The exception was never actually raised.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Adeodato Simo <dato@google.com>
Michael Hanselmann [Mon, 28 Feb 2011 15:15:09 +0000 (16:15 +0100)]
gnt-cluster master-failover: Undrain queue
- Move functions for drain status (tracked via file) from jqueue to jstore
- Undrain queue on master failover if necessary
- Add QA test
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Mon, 28 Feb 2011 14:12:14 +0000 (15:12 +0100)]
Update NEWS and release 2.4.0 rc3
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Mon, 28 Feb 2011 13:30:45 +0000 (14:30 +0100)]
Merge branch 'devel-2.4' into stable-2.4
* devel-2.4:
1-char comment typo fix
Expand some acronyms, add to glossary
query_unittest: Fix argument to set()
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Mon, 28 Feb 2011 10:06:14 +0000 (11:06 +0100)]
Fix potential data-loss bug in disk wipe routines
For the 2.4 release, we only add the missing RPC calls. However, this
needs to be fixed properly, by preventing usage of mis-configured
disks.
Also add a bit more logging so that it's directly clear on which node
the wipe is being done.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
René Nussbaumer [Fri, 25 Feb 2011 13:42:19 +0000 (14:42 +0100)]
Query: Add additional test to node.powered for OOB handling
This patch covers the testing of _GetNodePower of query.py not only for
unavailable but also for OOB support and returning the right
node.powered.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Stephen Shirley [Fri, 25 Feb 2011 15:02:14 +0000 (16:02 +0100)]
1-char comment typo fix
Signed-off-by: Stephen Shirley <diamond@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Fri, 25 Feb 2011 13:13:16 +0000 (14:13 +0100)]
gnt-* list-fields: Show field description
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
René Nussbaumer [Thu, 24 Feb 2011 13:32:21 +0000 (14:32 +0100)]
gnt-instance reboot start instance if not yet started
This patch starts the instance when gnt-instance reboot is invoked on a
instance already stopped.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
René Nussbaumer [Tue, 15 Feb 2011 10:16:19 +0000 (11:16 +0100)]
Update the DD of OOB with gnt-cluster epo
This command came up in a local discussion about how much logic we
should put into gnt-node power off. We decided to go with a separate
convenience command which takes care of all the steps through the
procedures to turn down the cluster into a state suitable for a shutdown
of the underlying machine.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 24 Feb 2011 18:20:13 +0000 (19:20 +0100)]
utils: Export NiceSortKey function
The ability to split a string into a list of strings and integers can be
handy elsewhere and is necessary for sorting query results by names.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Stephen Shirley [Thu, 24 Feb 2011 15:19:07 +0000 (16:19 +0100)]
Expand some acronyms, add to glossary
Signed-off-by: Stephen Shirley <diamond@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
René Nussbaumer [Thu, 24 Feb 2011 13:51:13 +0000 (14:51 +0100)]
Fix test output splattering
Instead of hardcode to ToStdout in the helper class, we should use
a user provided feedback function. In unittests this is a noop.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Thu, 24 Feb 2011 11:58:52 +0000 (12:58 +0100)]
Generate query fields in man pages
This patch replaces the hand-written lists of fields, sometimes
incomplete, wrong or inconsistent, with generated ones. What's not very
nice yet is the representation for numbered lists (“nic.ip/0: IP address
of 1st network interface”, “nic.ip/1: IP address of 2nd network
interface”, etc.), but some kind of grouping can be done later.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Wed, 23 Feb 2011 17:05:22 +0000 (18:05 +0100)]
Add script to generate query fields documentation
- All lines matching "@QUERY_FIELDS_${resource}@" in the input will be
replaced with a definition list describing the fields for $resource
- The core code is kept in the Sphinx extension, so that it could be
used from there, too
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Wed, 23 Feb 2011 13:58:47 +0000 (14:58 +0100)]
Add query field descriptions
- Make “doc” parameter to MakeField non-optional
- Add descriptions for all fields
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Tue, 22 Feb 2011 14:18:48 +0000 (15:18 +0100)]
query: Add support for field description
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Tue, 22 Feb 2011 17:58:38 +0000 (18:58 +0100)]
Add function to format ordinals
See [1] for the rules.
[1] http://en.wikipedia.org/wiki/Names_of_numbers_in_English#Ordinal_numbers
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
René Nussbaumer [Wed, 16 Feb 2011 10:05:56 +0000 (11:05 +0100)]
Introducing gnt-cluster epo
This is a convenience command to do an automated EPO in the possible limits of
Ganeti.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
René Nussbaumer [Wed, 16 Feb 2011 12:09:00 +0000 (13:09 +0100)]
Move OOB_TIMEOUT_OPT to cli.py
OOB commands where we need to be able to specify the timeout are
enhancing over the border of just gnt-node so we move it into cli.py
for easy reuse in other cli parts.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Wed, 23 Feb 2011 16:13:38 +0000 (17:13 +0100)]
epydoc.conf: Avoid newlines, rebuild if necessary
Using $(strip …) ensures there won't be any newlines in the value.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 23 Feb 2011 17:04:48 +0000 (18:04 +0100)]
Add constants for node roles
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 23 Feb 2011 13:39:08 +0000 (14:39 +0100)]
Add constants for instance status
They've been hardcoded for too long.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>