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>
René Nussbaumer [Wed, 23 Feb 2011 13:29:00 +0000 (14:29 +0100)]
Merge remote branch 'devel-2.4'
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
René Nussbaumer [Wed, 23 Feb 2011 13:16:12 +0000 (14:16 +0100)]
query_unittest: Fix argument to set()
Commit
e431074f introduced an uncatched bug. This patch fixes this. The
set is expecting a list or iteratable to work on, so it splitted the
provided instance name into a set of characters. This caused the
exp_status never been set and therefore not catched in one assert rule
further below who checks that every status was tested.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Tue, 22 Feb 2011 18:02:28 +0000 (19:02 +0100)]
query: Use aliases for legacy instance NIC fields
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 23 Feb 2011 12:25:09 +0000 (13:25 +0100)]
Merge branch 'devel-2.4'
* devel-2.4:
Fix title of query field containing instance name
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 22 Feb 2011 17:00:56 +0000 (18:00 +0100)]
Add unittest for cli.FormatResultError
Also make the parameter for verbosity mandatory.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 22 Feb 2011 17:17:57 +0000 (18:17 +0100)]
Fix title of query field containing instance name
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 22 Feb 2011 17:14:22 +0000 (18:14 +0100)]
cmdlib: Fix pylint error
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 15 Feb 2011 18:52:25 +0000 (19:52 +0100)]
cmdlib: Use filters internally for queries
This is in preparation for implementing real query filters.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 22 Feb 2011 15:36:44 +0000 (16:36 +0100)]
Merge branch 'devel-2.4'
* devel-2.4: (60 commits)
Update news and bump version for 2.4.0 rc2
Fix pylint warnings
TestRapiInstanceRename use instance name
Change the list formatting to a 'special' chars
Add support for merging node groups
Add option to rename groups on conflict
Fix minor docstring typo
Add QA rapi test for instance reinstall
RAPI: remove required parameters for reinstall
Fix HV/OS parameter validation on non-vm nodes
NodeQuery: mark live fields as UNAVAIL for non-vm_capable nodes
NodeQuery: don't query non-vm_capable nodes
Fix LUClusterRepairDiskSizes and rpc result usage
Fix RPC mismatch in blockdev_getsize[s]
Remove superfluous redundant requirement
Don't remove master_candidate flag from merged nodes
Use a consistent ECID base
listrunner: convert from getopt to optparse
listrunner: fix agent usage
Revert "Disable the cluster-merge tool for the moment"
...
Conflicts:
NEWS: Trivial
lib/cli.py: Dropped _RSTATUS_TO_TEXT from master and used
RSS_DESCRIPTION from devel-2.4 instead, adjusted users accordingly
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 21 Feb 2011 15:51:42 +0000 (16:51 +0100)]
Add/rename label for LUXI in documentation
The HTTP server design doc will refer to the LUXI protocol,
so conflicts need to be avoided.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Mon, 21 Feb 2011 10:28:00 +0000 (11:28 +0100)]
Update news and bump version for 2.4.0 rc2
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Mon, 21 Feb 2011 09:36:10 +0000 (10:36 +0100)]
Merge branch 'devel-2.4' into stable-2.4
* devel-2.4: (23 commits)
Fix pylint warnings
Change the list formatting to a 'special' chars
Add support for merging node groups
Add option to rename groups on conflict
Fix minor docstring typo
Fix HV/OS parameter validation on non-vm nodes
NodeQuery: mark live fields as UNAVAIL for non-vm_capable nodes
NodeQuery: don't query non-vm_capable nodes
Remove superfluous redundant requirement
Don't remove master_candidate flag from merged nodes
Use a consistent ECID base
listrunner: convert from getopt to optparse
listrunner: fix agent usage
Revert "Disable the cluster-merge tool for the moment"
Fix cluster-merging by not stopping noded
Fix error msg for instances on offline nodes
Minor reordering to match param order
cluster verify and instance disks on offline nodes
Cluster verify and N+1 warnings for offline nodes
Handle gnt-instance shutdown --all for empty clusters
Use gnt-node add --force-join to add foreign nodes
Add --force-join option to gnt-node add
Fix iterating over node groups
Of the above commits present in the devel-2.4 branch, only the “Add
--force-join option to gnt-node add” is a potential issue, but this
has been QA-ed successfully. The other fixes are split in three
groups:
- non-core changes (cluster-merge, listrunner)
- trivial fixes (docstrings, etc.)
- bugs that we want fixed
As such, instead of cherry-picking only individual patches, I propose
that we unify stable and devel 2.4 and make a new RC out of the
result.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Stephen Shirley [Fri, 18 Feb 2011 15:25:59 +0000 (16:25 +0100)]
Fix pylint warnings
- 1 80-char line infraction
- 4 changes in how arguments are passed to logging functions
- 3 pylint disable-msg's because cluster-merge needs to access ganeti
config internals
Signed-off-by: Stephen Shirley <diamond@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Guido Trotter [Fri, 18 Feb 2011 12:52:58 +0000 (12:52 +0000)]
TestRapiInstanceRename use instance name
Currently the QA rename job wrongly passed the whole info dict to the
client.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Fri, 18 Feb 2011 12:51:03 +0000 (13:51 +0100)]
Change the list formatting to a 'special' chars
And also enable verbose display via the, well, verbose option. Man
page and tests are updated, and the formatting is moved from 4 if
statements to a data structure.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Stephen Shirley [Fri, 18 Feb 2011 12:59:46 +0000 (13:59 +0100)]
Add support for merging node groups
Signed-off-by: Stephen Shirley <diamond@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Stephen Shirley [Fri, 18 Feb 2011 12:30:37 +0000 (13:30 +0100)]
Add option to rename groups on conflict
Signed-off-by: Stephen Shirley <diamond@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Stephen Shirley [Thu, 17 Feb 2011 16:00:24 +0000 (17:00 +0100)]
Fix minor docstring typo
Signed-off-by: Stephen Shirley <diamond@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Fri, 18 Feb 2011 11:33:09 +0000 (11:33 +0000)]
Add QA rapi test for instance reinstall
This tests at least the basic case, unfortunately there is no way to
check all possibilities using the provided rapi client, as that will use
the new method unless the cluster doesn't support it.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Guido Trotter [Fri, 18 Feb 2011 11:20:01 +0000 (11:20 +0000)]
RAPI: remove required parameters for reinstall
Before
c744425f354f1bef2d0d7d306e2d00c494d67d2b instance reinstall
accepted the "os" and "nostartup" optional query parameters. With that
commit it was changed to allow "os" "start" and "osparams" via body
rather than encoded in the URL. Unfortunately that commit introduced a
bug, which required the "os" parameter to be passed for body requests,
and at least one of "os" or "nostartup" for query request.
This fix makes sure all parameters are optional again.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Thu, 17 Feb 2011 16:06:59 +0000 (17:06 +0100)]
Fix HV/OS parameter validation on non-vm nodes
Currently, there is at least one LU that does wrong validation of HV
parameters (against all nodes, LUClusterSetParams). It's possible to
fix this case, but I went and modified the base functions to filter
out non-vm_capable nodes so all callers are protected.
Note: the _CheckOSParams function is never called with all nodes list,
so modifying it shouldn't be needed. However, I think it's safe to do
so (and it shouldn't hurt as an instance's node shouldn't ever lack
the vm_capable bit).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 17 Feb 2011 13:42:57 +0000 (14:42 +0100)]
NodeQuery: mark live fields as UNAVAIL for non-vm_capable nodes
Since we don't have the data per design, UNAVAIL is appropriate here,
while NODATA is not.
The patch also adds a comment: if we extend the live fields list to
contain other data in the future, we need to reevaluate this solution.
This should fix issue 143. The listing now shows (node2==ofline,
node3==not vm_capable):
Node DTotal DFree MTotal MNode MFree Pinst Sinst
node1 698.6G 630.5G 32.0G 1.0G 30.0G 8 7
node2 (offline) (offline) (offline) (offline) (offline) 9 4
node3 (unavail) (unavail) (unavail) (unavail) (unavail) 0 0
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 17 Feb 2011 13:41:29 +0000 (14:41 +0100)]
NodeQuery: don't query non-vm_capable nodes
Because non-vm_capable nodes most likely don't have a hypervisor
configured and/or storage, so the call will fail anyway.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@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>
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>
René Nussbaumer [Thu, 17 Feb 2011 11:51:36 +0000 (12:51 +0100)]
Rephrase a misleading pydoc for netutils.TcpPing
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Stephen Shirley <diamond@google.com>
Stephen Shirley [Tue, 15 Feb 2011 16:40:54 +0000 (17:40 +0100)]
Remove superfluous redundant requirement
The condition is already covered by the previous requirement.
Signed-off-by: Stephen Shirley <diamond@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Stephen Shirley [Tue, 15 Feb 2011 14:29:03 +0000 (15:29 +0100)]
Don't remove master_candidate flag from merged nodes
Prevents lots of spurious warnings like:
2011-02-10 17:00:22,776: CRITICAL Configuration data is not consistent:
Not enough master candidates: actual 3, target 4
Signed-off-by: Stephen Shirley <diamond@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Stephen Shirley [Tue, 15 Feb 2011 14:06:03 +0000 (15:06 +0100)]
Use a consistent ECID base
ECID was being calculated completely differently in
__MergeNodeGroups() and _MergeConfig()
Signed-off-by: Stephen Shirley <diamond@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 16 Feb 2011 16:21:03 +0000 (17:21 +0100)]
listrunner: convert from getopt to optparse
The “-A” (use agent) was not documented, and instead of adding manual
listing, I converted it to optparse like the other CLI tools.
Note that I cleaned up a bit the usage and help texts.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Wed, 16 Feb 2011 12:32:29 +0000 (13:32 +0100)]
listrunner: fix agent usage
By delaying the agent key query until after the fork, we prevent the
problem of simultaneous access to the agent.
Tested that it works against 80 hosts in parallel without error; the
current version breaks already at 20 hosts.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Michael Hanselmann [Wed, 16 Feb 2011 11:50:35 +0000 (12:50 +0100)]
Fix build error when using docutils 0.4
Docutils 0.4 doesn't provide the “Directive” class and Sphinx supplies
its own version which doesn't have the “assert_has_content” method.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Thu, 3 Feb 2011 12:07:54 +0000 (13:07 +0100)]
Adding more details to gnt-node man-page
This adds some recently added flags to the man-page of gnt-node command.
It also describes their purpose and handling.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Thu, 3 Feb 2011 12:57:56 +0000 (13:57 +0100)]
Remove force_master support from LUOobCommand
As per discussion on the man-page[1] update, this functionality should be
removed and replaced by just give the command to run if the user insists
of power cycle/power off the master and refuse to operate.
[1] http://groups.google.com/group/ganeti-devel/browse_thread/thread/
95d4879a747cc295
This also removes the --all flag from gnt-node power because it was
buggy and would have added too much logic for special cases.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 15 Feb 2011 13:35:00 +0000 (14:35 +0100)]
Add pylint disables to Sphinx extension
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 15 Feb 2011 12:36:09 +0000 (13:36 +0100)]
RAPI documentation: Use constants and assertions
This doesn't cover everything yet, but it's a good demonstration on how
to use “pyeval” and “pyassert”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 15 Feb 2011 12:35:22 +0000 (13:35 +0100)]
errors: Add list of possible failure types
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 15 Feb 2011 12:34:43 +0000 (13:34 +0100)]
Sphinx extension: Allow evaluation of Python expressions
There are quite many hardcoded constants (e.g. “[…] one of ``file``,
``lvm-pv`` or ``lvm-vg`` […]). By using constants it'll be easier to
identify these.
With such lists of values it's also easy to miss some when
extending/changing something. By adding assertions inlined with reST,
these can also be detected.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 15 Feb 2011 12:30:36 +0000 (13:30 +0100)]
Sphinx extension: Don't use “from … import …”
Import with full name instead to reduce potential conflicts.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 15 Feb 2011 13:01:14 +0000 (14:01 +0100)]
RAPI: Remove “__version__” for instance creation
If left in data, FillOpCode will complain. This fixes the QA breakage
after commit
526a662af.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Mon, 14 Feb 2011 16:30:19 +0000 (17:30 +0100)]
RAPI: Use FillOpCode for adding node group
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Mon, 14 Feb 2011 15:38:15 +0000 (16:38 +0100)]
RAPI: Use FillOpCode for renaming groups
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Mon, 14 Feb 2011 15:35:13 +0000 (16:35 +0100)]
Make OpGroupRename consistent with OpInstanceRename
OpInstanceRename uses “instance_name” (like almost all other OpInstance*
opcodes), not “old_name”, to specify the original name. OpGroupRename is
made consistent by renaming “old_name” to “group_name”.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Mon, 14 Feb 2011 15:14:06 +0000 (16:14 +0100)]
RAPI: Clean up instance creation, use generated docs
- Use FillOpCode and unify parameter names between RAPI and opcode
- Generate parameter documentation
- Improve opcode parameter documentation
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Mon, 14 Feb 2011 13:10:18 +0000 (14:10 +0100)]
RAPI: Generate documentation for assigning nodes to groups
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Mon, 14 Feb 2011 13:09:57 +0000 (14:09 +0100)]
RAPI: Use FillOpCode for modifying node group
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Mon, 14 Feb 2011 12:41:57 +0000 (13:41 +0100)]
RAPI: Use FillOpCode for renaming instances
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Mon, 14 Feb 2011 16:20:33 +0000 (17:20 +0100)]
baserlib.FillOpCode: Allow parameter rename
Some RAPI parameters don't match the name of the underlying
opcode. With this patch they can be renamed while filling
the opcode.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Stephen Shirley [Thu, 10 Feb 2011 16:32:26 +0000 (17:32 +0100)]
Revert "Disable the cluster-merge tool for the moment"
This reverts commit
c0711f2cb989facd60430ab18c5b0e59a1f279ac.
Signed-off-by: Stephen Shirley <diamond@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Stephen Shirley [Thu, 10 Feb 2011 10:52:13 +0000 (11:52 +0100)]
Fix cluster-merging by not stopping noded
cli.RunWhileClusterStopped() stops noded on all of the nodes in the
original cluster. This prevents /etc/hosts updates on the master, and
config redistribution doesn't reach the other nodes in the original
cluster. As all we want to do is merge while the master is stopped,
simply stop it and start it again after.
Signed-off-by: Stephen Shirley <diamond@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Thu, 10 Feb 2011 13:55:08 +0000 (14:55 +0100)]
Fix bug in iallocator data structures build
Commit
a1cef11c fixed non-vm_capable nodes export, but broke
inadvertently offline nodes. The update of the dict only needs to
happen for online nodes, in the 'if' block.
Without this patch, offline nodes keep the data from the last node
that was not offline; end result is that all nodes are considered
online (unless the first node is offline, in which case an error will
be raised).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Iustin Pop [Tue, 8 Feb 2011 11:04:11 +0000 (12:04 +0100)]
Fix html docs builds
This fixes the doc builds broken by commit
b292b986, but is only an
ugly workaround due to our dependency chain.
opcodes.py imports (both directly and indirectly) constants.py, which
imports _autoconf.py. Hence one could say that all .py files have a
logical dependency on _autoconf.py, since you can't "import opcodes"
before _autoconf.py is built. So the sphinx rule should depend on
_autoconf.py as a prerequisite.
But we can't use a normal prerequisite, since that would cause the
html docs to be rebuilt whenever _autoconf.py gets rebuilt, i.e. even
on end-users machines after ./configure; this is bad, and it also
breaks distcheck (as the html files are not removed in distclean,
since we do want them distributed).
So we only add an order-only prerequisite, which does the right thing
(although our dependency chain is still ugly).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Adeodato Simo <dato@google.com>
Iustin Pop [Wed, 9 Feb 2011 09:04:39 +0000 (10:04 +0100)]
Fix error msg for instances on offline nodes
Currently, for both primary and secondary offline nodes, we give the
same message:
- ERROR: instance instance14: instance lives on offline node(s) node3
- ERROR: instance instance15: instance lives on offline node(s) node3
- ERROR: instance instance16: instance lives on offline node(s) node3
- ERROR: instance instance17: instance lives on offline node(s) node3
This is confusing, as an offline primary is in a different category
than a secondary. The patch changes the warnings to have different
error messages:
- ERROR: instance instance14: instance has offline secondary node(s) node3
- ERROR: instance instance15: instance has offline secondary node(s) node3
- ERROR: instance instance16: instance lives on offline node node3
- ERROR: instance instance17: instance lives on offline node node3
Thanks to Alexander Schreiber <als@google.com> for reporting this
issue.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Alexander Schreiber <als@google.com>
Stephen Shirley [Tue, 8 Feb 2011 16:42:18 +0000 (17:42 +0100)]
Minor reordering to match param order
Signed-off-by: Stephen Shirley <diamond@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Tue, 8 Feb 2011 16:07:13 +0000 (17:07 +0100)]
cluster verify and instance disks on offline nodes
Currently, cluster-verify says:
- ERROR: instance instance14: couldn't retrieve status for disk/0 on node3: node offline
- ERROR: instance instance14: instance lives on offline node(s) node3
- ERROR: instance instance15: couldn't retrieve status for disk/0 on node3: node offline
- ERROR: instance instance15: instance lives on offline node(s) node3
This is redundant as the “lives on offline node” message should be all we need to
understand the cluster situation.
The patch fixes this and also corrects a very old idiom.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Stephen Shirley <diamond@google.com>
Iustin Pop [Tue, 8 Feb 2011 15:56:23 +0000 (16:56 +0100)]
Cluster verify and N+1 warnings for offline nodes
Currently, cluster verify shows warnings N+1 warnings for offline
nodes having any redundant instances since the memory data that we
have for those nodes is zero, so any instance will trigger the
warning.
As the comment says, we already list secondary instances on offline
nodes, so that warning is enough, and we skip the N+1 one.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Stephen Shirley <diamond@google.com>
Stephen Shirley [Mon, 7 Feb 2011 15:35:34 +0000 (16:35 +0100)]
Handle gnt-instance shutdown --all for empty clusters
The current code gives:
Failure: prerequisites not met for this operation:
error type: wrong_input, error details:
Selection filter does not match any instances
Signed-off-by: Stephen Shirley <diamond@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 4 Feb 2011 16:39:47 +0000 (17:39 +0100)]
RAPI: Use FillOpCode for replacing disks
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 3 Feb 2011 17:50:02 +0000 (18:50 +0100)]
Generate parts of RAPI documentation from opcodes
This replaces hardcoded lists of parameters with automatically generated
ones, making maintenance easier.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 3 Feb 2011 17:46:19 +0000 (18:46 +0100)]
Add sphinx extension
For now this just registers a single new directive, “opcode_params”,
which can be used to generate opcode parameter documentation.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 4 Feb 2011 16:23:55 +0000 (17:23 +0100)]
Add opcode parameter descriptions
These will be used in automatically generated parts of the RAPI
documentation. Not all opcodes are documented so far, but each added
opcode's parameters need to be fully documented (verified by an
assertion).
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 4 Feb 2011 13:55:28 +0000 (14:55 +0100)]
opcodes: Prepare addition of parameter descriptions
For now they're all set to None, but a following patch will set descriptions.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 2 Feb 2011 15:41:34 +0000 (16:41 +0100)]
ht: Add descriptive text representations
This patch adds text descriptions to all T* checks. Converting to a
string (e.g. str(ht.TNone)) will produce a user-readable text. This
will be used for Opcode parameter documentation.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Fri, 4 Feb 2011 15:46:38 +0000 (16:46 +0100)]
gnt-instance reinstall: display OS changes
Currently, when reinstalling an instance, especially when selecting an
OS interactively, is hard to be sure one has chosen the correct OS.
This patch adds displaying the selected OS. I'm not entirely happy, as
it's not very good English (e.g. keeping the same OS should be "but
keep the same OS", and changing should be "and also change …") but I
didn't find a better handling of all the cases:
node1# gnt-instance reinstall -o lenny-image+default instance1
This will reinstall the instance 'instance1' (and change the OS to
'lenny-image+default') which removes all data. Continue?
y/[n]/?: n
node1# gnt-instance reinstall instance1
This will reinstall the instance 'instance1' (and keep the same OS)
which removes all data. Continue?
y/[n]/?: n
node1# gnt-instance reinstall instance1 instance2
The reinstall will operate on 2 instances.
Note: this will remove *all* data for the below instances! It will
keep the same OS.
Do you want to continue?
node1# gnt-instance reinstall -o lenny-image+default instance1
instance2
The reinstall will operate on 2 instances.
Note: this will remove *all* data for the below instances! It will
change the OS to 'lenny-image+default'.
Do you want to continue?
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
René Nussbaumer [Fri, 4 Feb 2011 13:48:00 +0000 (14:48 +0100)]
Allow passing timeout for oob helper in gnt_node.py
This allow to pass in --oob-timeout to define the timeout before the
out-of-band helper is beeing aborted.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Stephen Shirley [Tue, 1 Feb 2011 15:59:46 +0000 (16:59 +0100)]
Use gnt-node add --force-join to add foreign nodes
Signed-off-by: Stephen Shirley <diamond@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Stephen Shirley [Tue, 1 Feb 2011 15:59:45 +0000 (16:59 +0100)]
Add --force-join option to gnt-node add
This is needed so cluster-merge can add nodes from other clusters.
Signed-off-by: Stephen Shirley <diamond@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Stephen Shirley [Tue, 1 Feb 2011 16:14:18 +0000 (17:14 +0100)]
Fix iterating over node groups
Current line tries to unpack dict incorrectly
Signed-off-by: Stephen Shirley <diamond@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Fri, 4 Feb 2011 12:18:33 +0000 (13:18 +0100)]
RAPI: Use FillOpCode for modifying instance
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 2 Feb 2011 17:53:04 +0000 (18:53 +0100)]
RAPI: Use FillOpCode for migrating instance
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Wed, 2 Feb 2011 17:40:04 +0000 (18:40 +0100)]
RAPI: Use FillOpCode for exporting instance
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Iustin Pop [Fri, 4 Feb 2011 09:54:05 +0000 (10:54 +0100)]
Update NEWS file for the 2.4.0 rc1 release
Also bump up the version.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Iustin Pop [Fri, 4 Feb 2011 09:58:45 +0000 (10:58 +0100)]
Disable the cluster-merge tool for the moment
Hopefully this can be fixed before the final 2.4 release…
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Reviewed-by: Stephen Shirley <diamond@google.com>
Iustin Pop [Thu, 3 Feb 2011 15:19:52 +0000 (16:19 +0100)]
Bump up intra-cluster import connect timeout
Currently, the export timeout is 10 times 20 seconds, but the import
is only 30 seconds. I'm raising this to 60 seconds with two goals in
mind:
- when debugging manually, this allows for easier synchronisation of
the processes
- 60 equals to 3 full 20 second intervals, which I think is better
than just one an a half
This change shouldn't make a big difference either way (at most, it
will possibly delay the job in case of failures by half a minute).
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 3 Feb 2011 13:17:58 +0000 (14:17 +0100)]
Import-export: fix logging of daemon output
In case of failures, the recent daemon output is logged as %r on a
list of unicode strings, which results in the (ugly):
Thu Feb 3 05:13:34 2011 snapshot/0 failed to send data: Exited with status 1 (recent output: [u' DUMP: Date of this level 0 dump: Thu Feb 3 05:13:18 2011', u' DUMP: Dumping /dev/mapper/
6369a5f7-1e67-4d0d-a4f0-
956b3649c6d7.disk0_data.snap-1 (an unlisted file system) to standard output', u' DUMP: Label: none', u' DUMP: Writing 10 Kilobyte records', u' DUMP: mapping (Pass I) [regular files]', u' DUMP: mapping (Pass II) [directories]', u' DUMP: estimated 54301 blocks.', u' DUMP: Volume 1 started with block 1 at: Thu Feb 3 05:13:19 2011', u' DUMP: dumping (Pass III) [directories]', u' DUMP: dumping (Pass IV) [regular files]', u'socat: E SSL_write(): Connection reset by peer', u"dd: dd: writing `standard output': Broken pipe", u' DUMP: Broken pipe', u' DUMP: The ENTIRE dump is aborted.'])
This patch joins this list and makes it a non-unicode string, thus
resulting in the more readable (and ~10% shorter):
Thu Feb 3 05:16:04 2011 snapshot/0 failed to send data: Exited with status 1 (recent output: DUMP: Date of this level 0 dump: Thu Feb 3 05:15:58 2011\n DUMP: Dumping /dev/mapper/
6369a5f7-1e67-4d0d-a4f0-
956b3649c6d7.disk0_data.snap-1 (an unlisted file system) to standard output\n DUMP: Label: none\n DUMP: Writing 10 Kilobyte records\n DUMP: mapping (Pass I) [regular files]\n DUMP: mapping (Pass II) [directories]\n DUMP: estimated 54350 blocks.\n DUMP: Volume 1 started with block 1 at: Thu Feb 3 05:15:59 2011\n DUMP: dumping (Pass III) [directories]\nsocat: E SSL_write(): Connection reset by peer\ndd: dd: writing `standard output': Broken pipe\n DUMP: Broken pipe\n DUMP: The ENTIRE dump is aborted.)
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
Iustin Pop [Thu, 3 Feb 2011 10:02:20 +0000 (11:02 +0100)]
Fix handling of ^C in the CLI scripts
This adds a message and nice handling of ^C, especially useful for
``gnt-job watch``.
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
Michael Hanselmann [Thu, 3 Feb 2011 11:38:25 +0000 (12:38 +0100)]
Merge branch 'devel-2.3' into devel-2.4
* devel-2.3:
backend: Disable compression in export info file
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Thu, 3 Feb 2011 11:25:04 +0000 (12:25 +0100)]
backend: Disable compression in export info file
The new import/export infrastructure in Ganeti 2.2 and up handles
compression differently. It no longer writes compressed files to the
destination. Unfortunately changing this behaviour would be non-trivial,
so in the meantime setting “compression = none” will hopefully avoid
some confusion.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Tue, 1 Feb 2011 13:41:07 +0000 (14:41 +0100)]
Modify gnt-node power to support multiple nodes
This also has the sideeffect of presenting a table with the result
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Wed, 2 Feb 2011 10:31:26 +0000 (11:31 +0100)]
Make it possible to disable tty in qa_utils.GetCommandOutput
The tty can have strange side effect as it seems to replace \n with
\r\n. In case of simply catting a file and compare it's output this
will break. This patch adds the possibility to disable tty if needed.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
René Nussbaumer [Wed, 2 Feb 2011 10:23:23 +0000 (11:23 +0100)]
Fix execution order in LUOobCommand causing wrongly setup node list
In commit
bfceedbe a check was added to put the master at the end or
skip it completely. While this functionality works, it was done at the
wrong point because node_names was already processed to a node list
without this checks. The Exec method if the LU just used that node list.
To overcome this situation we correct the node_names before the node
list is generated.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Michael Hanselmann [Tue, 1 Feb 2011 15:31:15 +0000 (16:31 +0100)]
Reopen log files upon SIGHUP in daemons
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Mon, 31 Jan 2011 16:26:55 +0000 (17:26 +0100)]
utils.SetupLogging: Return function to reopen log file
This function can be used from a SIGHUP handler to reopen log files.
Initial, simple unittests are included.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Mon, 31 Jan 2011 16:03:18 +0000 (17:03 +0100)]
utils.SetupLogging: Make program a mandatory argument
It's passed in by most users (daemons, CLI scripts) and for the others
(burnin, watcher) it certainly doesn't hurt, especially when using
syslog.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Mon, 31 Jan 2011 15:46:21 +0000 (16:46 +0100)]
utils.log: Restrict I/O error handling coverage
The I/O error will occur while opening the file, not while adding
and configuring the handler.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Mon, 31 Jan 2011 15:43:28 +0000 (16:43 +0100)]
utils.log: Split formatter building into separate function
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Mon, 31 Jan 2011 13:58:26 +0000 (14:58 +0100)]
burner: Trivial code cleanup
- Use constant for exit value
- Configure logging from main function, not from class' “__init__”
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
Michael Hanselmann [Mon, 31 Jan 2011 13:54:38 +0000 (14:54 +0100)]
burnin: Reuse existing function for debug value
Instead of using its own, burnin can use cli.SetGenericOpcodeOpts.
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>
René Nussbaumer [Tue, 1 Feb 2011 10:38:34 +0000 (11:38 +0100)]
Refactor _ConfirmOperation from gnt_instance.py to cli.py
This will allow us to use this functionality also in other cli-tools
like gnt-node power where we've to operate on multiple nodes.
Signed-off-by: René Nussbaumer <rn@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>