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.
Signed-off-by: Adeodato Simo <dato@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
ganeti.query_unittest.py: add tests for group queries
Signed-off-by: Adeodato Simo <dato@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
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.
Signed-off-by: Adeodato Simo <dato@google.com>...
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....
Merge branch 'devel-2.3'
cfgupgrade: Remove unused “program” variable
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
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.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
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
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
gnt-node modify: Adding --node-powered=yes|no
LUSetNodeParams: Add support for powered state
LUSetNodeParams/LUOobCommand respect offline/powered
This patch makes sure we cross verify the state the node isin with our view:
power off -> Node has to be set offlinemodify -O no -> Node has to be powered
Signed-off-by: René Nussbaumer <rn@google.com>...
gnt-node power: Mark also offline when powering off
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Conflicts: lib/cmdlib.py: Trivial qa/ganeti-qa.py: Trivial...
utils.NiceSort: Use sorted(), add keyfunc, unittests
This patch changes utils.NiceSort to use the built-in “sorted()” andgets rid of the intermediate list. Instead of wrapping the itemsourselves, a key function is used. The caller can specify another key...
QA: Run cluster-verify as part of all instance tests
“gnt-cluster verify” looks at some per-instance information as well, soit should be run for each instance type QA tests.
QA: Fix typo and add “not”
ShutdownInstanceDisks: accept offline secondaries
For secondary node that is offline, we should not consider that thedisk shutdown has failed, as it can never succeed under this clusterstate and (by virtue of the fact that the secondary node is offline)...
RpcResult: simplify some asserts
data ≫ code, eom.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
ensure-dirs: Speed up when using big queues
The “ensure-dirs” script as included in Ganeti 2.3 is very slow whenworking with big queues requiring a change of permissions on many or allfiles.
$ find /var/lib/ganeti/queue/ | wc -l52354
Before this change:...
LUAddNode: default ndparams to empty dict when not provided
QA: Add some basic OOB tests
QA: Allow upload of string data
Fix gnt-cluster verify with diskless instances
`gnt-cluster verify` was failing with KeyError if there was anydiskless instance in the cluster. This was because _CollectDiskInfo()was not including these instances in the returned dictionary, but theywere expected to be present in LUVerifyCluster.Exec()....
Fix N+1 error message
The error contained a typo and is slightly cumbersome. It changes from:
- ERROR: node a: not enough memory on to accommodate failovers should peer node b fail
to:
- ERROR: node a: not enough memory to accomodate instance failovers should node...
Rename (Op|LU)OutOfBand to (Op|LU)OobCommand
Conflicts: man/ganeti-cleaner.sgml: Removed man/ganeti-confd.sgml: Removed man/ganeti-masterd.sgml: Removed...
jqueue: Keep jobs in “waitlock” while returning to queue
Iustin Pop reported that a job's file is updated many times while itwaits for locks held by other thread(s). After an investigation it wasconcluded that the reason was a design decision for job priorities to...
Improve jqueue unittests
- Verify job file updates- Ensure queue lock is released while executing opcode
Adding gnt-node power * commands
Do the expanding of the node name in ExpandNames
client.gnt_node: Remove unnecessary lambda
Pylint complained that the “lambda may not be necessary”. Turns out itwas right.
QA: Extend unittests for query operations, add tests for list-fields
Update NEWS for new query infrastructure
Convert “gnt-instance list” to query2
Convert “gnt-node list” to query2
cli: Add infrastructure for query2
A new function for formatting the query results is added,``FormatTable``. This was determined to be easier and safer thanmodifying the existing ``GenerateTable`` function while keepingbackwards compatibility for code not yet converted. The new code makes...
Update manpages to display version 2.3
Signed-off-by: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
iallocator: Export node group allocation policy
Signed-off-by: Balazs Lecz <leczb@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Adding --node-powered command line flag
Set powered to True for added nodes
Set recorded powered state for OOB calls
Add new Node attribute powered
This is just a state of record field and does not necessaryreflect the reality.
Add ganeti-kvm-poweroff.initd to .gitignore
More QA tests for group operations
This adds QA tests for the SetGroupParams operation, both for CLI andRAPI. Additionally, it adds tests for add/rename/remove groups via RAPI,which had not been included in a previous patch series. Finally, it alsotests setting "alloc_policy" (and, for the CLI, "ndparams") at group...
Add some unit tests for ConfigWriter.AddNodeGroup()
Expose OpSetGroupParams in RAPI and RAPI client
This creates the /2/groups/<name>/modify resource; at the moment, only the"alloc_policy" attribute can be modified.
Add the "alloc_policy" attribute to node groups
This can be set at group creation time and via OpSetGroupParams. The defaultis "preferred", and existing node groups from previous Ganeti version willget the attribute set to this value.