Add RPC calls for pause/resume sync of devices
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add backend method for pause/resume sync of devices
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Make it possible to pause/resume sync of mirrored dev
Fix some doc issues introduced in recent commits
The hooks is due to me not checking the recent patch from David, andthe cli.py change is due to the utils.py split.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
More fixes to hooks documentation
Signed-off-by: David Knowles <dknowles@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add QA tests for OpAssignGroupNodes
Signed-off-by: Adeodato Simo <dato@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Fix docstring for "cmd" in qa_utils.GetSSHCommand
Docstring indicated "cmd" should be a list, when it's expected thatit'll be a string.
Also, converted docstring to current epydoc-style list of functionarguments.
Signed-off-by: Adeodato Simo <dato@google.com>...
Add OpAssignGroupNodes and LUAssignGroupNodes
This operation allows to assign nodes to a group, verifying whetherthe change would leave any mirrored instance split between differentnode groups.
Add unit tests for CheckAssignmentForSplitInstances
Add `gnt-group assign-nodes` in the CLI
Cluster verify warns if there are split instances
Emit a warning for each instance with a mirrored disk template that hasits primary and secondary nodes living in different node groups.
Expose OpAssignGroupNodes over RAPI and RAPI client
Validate RAPI resource paths
To stay consistent, RAPI resources should only use a restricted set ofcharacters. No uppercase, no “_”, etc. This is enforced by this patch.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
utils: Move logging-related code into separate file
utils: Rename _CloseFDNoErr to CloseFdNoError
This makes it a public function, which is necessary formoving code into separate files.
utils: Move hashing-related code into separate file
utils: Remove unused variables
utils: Split algorithms into separate file
utils: Split Retry & co. into separate file
utils: Move text-related functions into separate file
utils: Move Mlockall into separate file
The unittest file is renamed to match the other utils.* tests.
utils: Move to separate module
This is preparing for splitting the whole units module.
Add unit test for ganeti.rapi.client's ModifyGroup
This was forgotten in f18fab7.
Signed-off-by: Adeodato Simo <dato@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
mcpu: Automatically build the DISPATCH_TABLE
While reviewing dato's interdiff for the OpAssignGroupNodes, Irealised that we can do better. This patch replaces the hand-builtDISPATCH_TABLE with one built from the opcode.OP_MAPPING dict.
Signed-off-by: Iustin Pop <iustin@google.com>...
Generalize the OpCode-should-be-in-mcpu test
Currently, the unittest TestDispatchTable in mcpu unittest does ahard-coded approach to test whether an opcode should be included ornot in the mcpu.Processor dispatch table. This is not flexible, so wereplace it with two changes:...
Document the intended use of (vm|master)_capable
This patch adds the intended usage scenarios of these two flags.
Additionally it corrects the tag valid charset.
IAllocator: fix breakage for non-vm_capable nodes
Currently, the IAllocator doesn't know that non-vm_capable nodesshould not be queried for hypervisor/instance information.
This patch updates the node data computation to generate basic info,but not the runtime data for such nodes. Furthermore, the...
Fix syntax error with Python 2.4
Use new console information in hypervisor abstraction
This makes use of the new way of returning console information from themaster daemon. Unittests are included.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Introduce verbose opcode result for console
With this patch OpConnectConsole will no longer just return a commandwith arguments, but rather a detailed description about how to connectto an instance's console. Unittests for some parts are included. Another...
luxi.Client: Add function to close connection
Merge branch 'devel-2.3'
Conflicts: lib/cmdlib.py: Trivial...
Remove unused import from client.gnt_instance
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Adeodato Simo <dato@google.com>
Updating hooks documentation with missing environment variables
gnt-instance console: Improve error reporting
If the SSH command fails, this will give a more detailed errormessage than before.
Increase timeout for connection on remote import
The source cluster has to shut down an instance before it can beexported. Doing so can take a while, but the default connection timeoutis only 60 seconds. Adding the shutdown timeout on the receiving cluster...
import-export: Improve timeout error reporting
When the source cluster takes too long to create a snapshot, thedestination would time out. Unfortunately no good error message waswritten unless debug logging was enabled, not even to the log file. Thiswill be improved with this patch....
List recorded powered state in gnt-node info
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Support query of node field 'powered'
This field is based on OOB support and is only available if there's oobsupport for that node.
qa_group.py: reimplement query tests with qa_utils
Now that group queries use query2 infrastructure, update the QA tests touse the generic functions in qa_utils.py.
ganeti.query_unittest.py: add tests for group queries
Convert “gnt-group list” to query2
cmdlib.py: convert LUQueryGroups to query2
cmdlib.py: move _GetQueryImplementation to end of file
_GetQueryImplementation() uses _QUERY_IMPL, which list all query typeimplementations. By moving it to the end of the file, we ensure all suchclasses are defined by the time we list them.
query.py: add definitions for node group queries
constants.py: define QR_GROUP resource
ganeti.query_unittest.py: test lock fields too
Additionally, change TestQueryFields.testSomeFields() to handle lists offields shorter than 20 elements.
lvmstrap: also test sysfs holders
If a device has entries in its holder directory(/sys/block/$name/holders), it means that some kernel system "uses" that device, and hence should not be considered available.
This patch adds a new 'in-use' check based on this sysfs test, and...
lvmstrap: add support for non-partitioned md disks
This patch, originally written by Marc Schmitt <mschmitt@google.com>,adds support for MD devices (used in a non-partitioned mode). Iabstracted all the original startswith('md') checks into separatefunctions, and also moved the supported disk types to a list....
RPC: mark jobqueue functions as URGENT
Recently, we've seen more and more cases of a specific breakagepattern in Ganeti: master candidates which are semi-alive (as in, theyrespond to ping, they can complete a TCP/SSL handshake, but otherwisethe root filesystem is broken) cause lots of confusion within masterd....
cfgupgrade: Remove unused “program” variable
QA: Remove 'oob_program=default' on gnt-cluster modify
On cluster level there's no 'default' because it's the highest cascadinglevel. Due to this 'default' is a valid value and doesn't mean to removethe value from the dict like it does on the other levels. To overcome...
Convert “gnt-debug locks” to query2
Locks can now be queried using “Query(what="lock", …)” over LUXI.
cfgupgrade: Check master name, clarify question
- Check hostname and abort if it doesn't match contents of “ssconf_master_node”, can be overridden using “--ignore-hostname” parameter.- Clarify confirmation question and don't mention instances anymore....
Makefile: Merge build-time reST copying
No need to copy this snippet around, “make” can work harder for us.
Move doc/upgrade.rst to UPGRADE, copy at build-time
This will allow distributions to install the file as text documentation.
Import upgrade notes into documentation
This patch formats the upgrade notes currently in the wiki1 as reSTand adds them to the documentation.
[1] http://code.google.com/p/ganeti/wiki/UpgradeNotes
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
Fix OpSetInstanceParams.disk_template check
When moving the opcode parameters I moved two or three checks from anopcode's CheckArguments function to the type checks. This was one ofthem and unfortunately I didn't notice the parameter can be None.
RAPI: Add resource to grow instance disk
Reword "one of hmgt" as "one of h/m/g/t" for clarity
QA: Adding new cluster verify cases
out of band verification in gnt-cluster verify
This adds the verify tests for out of band management
Adding additional VerifyNode checks to backend
This adds checks for out of band support. The helpers have to exist andthey have to be executable.
baserlib: Add function for filling opcodes
This function makes use of the opcode parameters which now livedirectly in the opcode. A number of RAPI resources can now be simplified.
RAPI: Add resource to modify cluster
Improve opcode summary tests
Test full summary instead of just format.
Migrate code verifying opcode parameters to base class
This allows the function to be used in other places as well.An optional parameter is added to control whether defaultvalues should be set. Unittests are added, providing fullcoverage.
Improve tests for OP_ID
… by detecting duplicates.
cmdlib: Remove opcode parameters
Remove the parameter definitions and use those from the opcode classesinstead. Small style changes are also made (empty lines, wrapping).
opcodes: Add opcode parameter definitions
This is the first step for migrating them from cmdlib. A metaclass isused to define “__slots__” upon class creation time (not instantiation).
query2: Add new field status “offline”
This allows “gnt-node list” to show the difference between modes markedoffline and nodes with e.g. RPC errors (“(nodata)”). node1 is themaster, node2's node daemon crashed and node3 is marked offline:
$ gnt-node list -o name,offline,dtotal,dfree...
QA: Fix out-of-band tests
- Handle situations with no non-master node- Expand node name to make test work when configuration just has short names (e.g. “node1” instead of “node1.example.com”)
Add unittests for ht module
ht.TInt: Exclude boolean values
See inline comment.
Cleanup bootstrap.SetupNodeDaemon
- Code formatting- Use ShellQuote for one argument- Remove variables no longer used after commit 9294514d
Conflicts: man/gnt-instance.sgml: Trivial merge in gnt-instance.rst...
Fix build errors with ganeti-listrunner
- Remove non-ASCII character from manpage- Reformat docstring for epydoc in script
These caused build breakage on some but not all distributions.
Fix typo in gnt-instance manpage
s/os-name/os-type/. This was reported in issue 133.
cli: Change “<…>” in query output to “(…)”
This should reduce the amount of damage in case of accidential copy &paste.
Initial import of listrunner
This tool was used and worked on internally for quite a long time. Wedecided to include it in Ganeti.
Known issues:- Code doesn't match rest of Ganeti (e.g. using “print” all over the place, hardcoded calls to sys.exit deep in functions)...
jqueue: Fix cancelling while in waitlock in queue
Since the recent change to leave jobs in the “waitlock” status (commit5fd6b6947), cancelling a job while it's back in the queue would break.This patch handles these cases and adds a unittest.
LUInstanceRename: log result of name resolving
While the LU does return the final name, it's useful to log the actualDNS resolving process (input and output) in order to help with thediagnose of failures.
The patch also fixes the docstring of the Exec() function....
Fix QA for “list-fields” commands
The list of fields is not only sorted, but sorted in a nice way.
Remove utils.FormatTimestampWithTZ
Long story short: time.strftime("%Z", time.localtime()) doesn't work,even though it's documented to be equivalent to time.strftime("%Z").
$ TZ=America/Sao_Paulo python -c 'import time; printtime.strftime("%Z"), time.strftime("%Z", time.localtime())'...
Ensure temp files from RunCmd tests are removed
Allow customisation of the disk index separator
As per issue 124, some Xen versions (or packaging) don't deal nicelywith the colon being part of a disk name. Therefore we add aconfigure-time option for customising this.
Note: setting the separator to interesting values like / is not...
utils: Timezone fixes and tests
- Update docstrings to explicitely mention Epoch- Fix timezone bug in FormatTimestampWithTZ, where it would use GMT/UTC when it should use the local timezone- Add unittests for time formatting functions
query: Add wrapper for creating response object
It'll be used for querying locks.
Move QueryFields to query module
Also replace “sorted” with “utils.NiceSort” now that it supports a keyfunction.
cli: Extend message for LUXI timeouts
Point out that jobs already submitted continue to run.
Fix timeout handling in LUXI client
If the socket can't be read in time, it raises “socket.timeout”, forwhich there is special handling code. Unfortunately the exception blockwas in the wrong order and “socket.error” caught it before.
Conflicts: NEWS: Trivial
Merge branch 'stable-2.3' into devel-2.3
Add QA scripts to checked Python code
pylint is not yet included as the code needs some work for that.
ganeti-qa: Wrap lines longer than 80 chars
Prepare 2.3.1 release
Adapt QA for change in behaviour
As we can't test this on master anymore (if we flag the node offline wewould change master role on master) we use the first non master node wefind in the configuration
gnt-node modify: Adding --node-powered=yes|no
LUSetNodeParams: Add support for powered state