Rephrase a misleading pydoc for netutils.TcpPing
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Stephen Shirley <diamond@google.com>
Fix build error when using docutils 0.4
Docutils 0.4 doesn't provide the “Directive” class and Sphinx suppliesits 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>
Remove force_master support from LUOobCommand
As per discussion on the man-page1 update, this functionality should beremoved and replaced by just give the command to run if the user insistsof power cycle/power off the master and refuse to operate.
[1] http://groups.google.com/group/ganeti-devel/browse_thread/thread/95d4879a747cc295...
Add pylint disables to Sphinx extension
errors: Add list of possible failure types
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 toidentify these.
With such lists of values it's also easy to miss some when...
Sphinx extension: Don't use “from … import …”
Import with full name instead to reduce potential conflicts.
RAPI: Remove “__version__” for instance creation
If left in data, FillOpCode will complain. This fixes the QA breakageafter commit 526a662af.
RAPI: Use FillOpCode for adding node group
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
RAPI: Use FillOpCode for renaming groups
Make OpGroupRename consistent with OpInstanceRename
OpInstanceRename uses “instance_name” (like almost all other OpInstance*opcodes), not “old_name”, to specify the original name. OpGroupRename ismade consistent by renaming “old_name” to “group_name”....
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
RAPI: Use FillOpCode for modifying node group
RAPI: Use FillOpCode for renaming instances
baserlib.FillOpCode: Allow parameter rename
Some RAPI parameters don't match the name of the underlyingopcode. With this patch they can be renamed while fillingthe opcode.
RAPI: Use FillOpCode for replacing disks
Add sphinx extension
For now this just registers a single new directive, “opcode_params”,which can be used to generate opcode parameter documentation.
Add opcode parameter descriptions
These will be used in automatically generated parts of the RAPIdocumentation. Not all opcodes are documented so far, but each addedopcode's parameters need to be fully documented (verified by anassertion).
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
opcodes: Prepare addition of parameter descriptions
For now they're all set to None, but a following patch will set descriptions.
ht: Add descriptive text representations
This patch adds text descriptions to all T* checks. Converting to astring (e.g. str(ht.TNone)) will produce a user-readable text. Thiswill be used for Opcode parameter documentation.
gnt-instance reinstall: display OS changes
Currently, when reinstalling an instance, especially when selecting anOS interactively, is hard to be sure one has chosen the correct OS.
This patch adds displaying the selected OS. I'm not entirely happy, asit's not very good English (e.g. keeping the same OS should be "but...
Allow passing timeout for oob helper in gnt_node.py
This allow to pass in --oob-timeout to define the timeout before theout-of-band helper is beeing aborted.
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
RAPI: Use FillOpCode for modifying instance
RAPI: Use FillOpCode for migrating instance
RAPI: Use FillOpCode for exporting instance
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>
Fix execution order in LUOobCommand causing wrongly setup node list
In commit bfceedbe a check was added to put the master at the end orskip it completely. While this functionality works, it was done at thewrong point because node_names was already processed to a node list...
Refactor _ConfirmOperation from gnt_instance.py to cli.py
This will allow us to use this functionality also in other cli-toolslike gnt-node power where we've to operate on multiple nodes.
Do not repeatedly call GetClusterInfo() in inner loop
Signed-off-by: Adeodato Simo <dato@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Fix docstring for NodeImage.sbp attribute
This was stating "secondary nodes" were the keys of the dictionary, whenthey are primary nodes. Also, further clarify only the node's secondaryinstances are included.
Signed-off-by: Adeodato Simo <dato@google.com>...
Adding support for the new option flags in gnt-node power
Add two new opcode options to LUOobCommand
This patch adds ignore_status to ignore the offline flag of nodesand also adds a force_master option to force operations on master nodeif they will make the master unavailable (for some time).
Signed-off-by: René Nussbaumer <rn@google.com>...
Adding gnt-node health
Refactor formatting of query results so we can reuse it
Merge branch 'devel-2.3' into devel-2.4
cluster verify: add hvparams verification
Currently, the validity of the hypervisor parameters is only checkedat init/modification time, and not in the cluster verify. This is bad,as it can lead to inconsistent state that is only detected when thenext modification (which can be unrelated) is made, leading to...
RAPI client: Wrap /2/redistribute-config resource
RAPI client: De-/activating instance disks
Watcher: Fix endless repair tries for broken secondary
In cases where secondary was offline and not evacuated watcher triedto activate-disks in an endless manner, but this is useless, as thesecondary is offline and therefore not responding to this approach....
Verify disks: increase parallelism and other fixes
The recent work on multi-VG support has converted LUClusterVerifyDisksinto doing serialised calls to each node, as each node can havedifferent VGs. This is suboptimal, especially for big clusters, where...
gnt-cluster verify-disks: fix VG name
Recent multi-VG work already exports the missing LV names as vg/lv,not simply lv. So the query and addition of the VG name in gnt-clusterverify-disks is redundant, and even wrong for non-default-VGinstances.
Signed-off-by: Iustin Pop <iustin@google.com>...
Deactivate disks: allow skipping hypervisor checks
In some cases (e.g. the hypervisor not running at all), we might wantto force disk deactivation, skipping the hypervisor checks. I believethis is not a good thing to do all the time, so this patch adds the...
Wait for master to become available on initialization
This is analogue to the existing check for a responsive node daemon.
Start all daemons on cluster initialization
At least ganeti-confd was not started. It got started a few minuteslater by ganeti-watcher. Also move one pylint disable to the effectiveline.
Improve option descriptions
Also replace hardcoded “xenvg” with constant.
Remove two unused variables
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Show hidden/blacklisted OSes in cluster info
Since we can blacklist/hide non-existing OSes (for preseeding), wecannot query easily the OSes themselves for this status. Hence weexport the entire lists in cluster info (which should be cheaper thangnt-os diagnose)....
Fix LUOSDiagnose and non-vm_capable nodes
This skips non-vm_capable nodes in the OS diagnose search, since suchOSes will not be used anyway on those nodes.
Rephrasing two error messages for auto promotion
Using auto_promote or auto-promote can lead to confusion on using theuser facing interfaces. While auto-promote is fine for CLI it's not forRAPI and vice-versa. This patch should eliminate this confusion....
storage: Check that mapper is either used or None
This is a followup patch to the one moving GetAllocatable out tomodule level.
Fix bug in “gnt-node list-storage”
LVM PV storage units would always show as allocatable, even when theyweren't. For some reason I have not been able to determine, the functionparsing the attributes (“_GetAllocatable”) was not even called and thelist opcode simply returned the attribute string as the value (e.g....
Fix payload check for out-of-band health
This logic error was not detected before as health has not beenimplemented on the cli and therefore no QA code existed for that.
Fix premature abort of LUOobCommand due to result.Raise
This is a bug I recognized while doing tests on gnt-node health. A leftover result.Raise line causes premature abort of LUOobCommand on thefirst node failing the RPC call. This is not expected behaviour for...
ht: Add TMaybeDict check
This replaces a number of equal “ht.TOr(ht.TDict, ht.TNone)” checks.
Modify LUOobCommand to support multiple nodes
This will change the result of this LU to a query like result. A list oftuples with information about the state of the data.
It also includes the modification to the commands calling this opcode.
Merge branch 'devel-2.4'
Rename QRFS_* to RS_*
This patch renames QRFS_* to RS_* fields so they can be used in otherplaces (i.e. LUs) without confusion, as this was initially meant forquery operations.
Another fix for LUClusterVerifyDisks
The LVM queries should only be done for vm_capable nodes. In order todo this, we also add a new ConfigWriter method to abstract that query.
Fix disk adoption breakage
Disk adoption is currently broken by 84d7e26b, which added multiple LVMvolume group support. This patch fixes the calls to rpc.call_vg_list,which are multi-node calls but were handled as single-node calls in84d7e26b.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>...
Improve import/export timeout settings
With this patch, the exporting node will retry to connect a few times.The receiving node will make use of the master's increased timeout (seeprevious patch).
Increase remote import/export timeout
It's been shown that 60 seconds may not be enough to establish aconnection.
Improve documentation for QRFS_UNAVAIL
IMHO this should have been named QRFS_NA or QRFS_UNSUPPORTED, butUNAVAIL is good enough.
query: Add alias support in _PrepareFieldList
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Instance query: replace duplicates with aliases
Fix disk count check in LUSetInstanceParams
LUSetInstanceParams checked instance.nics (and not instance.disks)against constants.MAX_DISKS.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>Reviewed-by: Michael Hanselmann <hansmi@google.com>
query: use the actual types for BE/HV parameters
This patch exposes the VTYPE kind of BE/HV parameters, instead ofreturning QFT_OTHER. The current situation makes a query like:
gnt-instance list -o name,be/memory,oper_ram
very strange looking.
query: return UNAVAIL for "wrong" HV parameters
If a HV parameter is required that does not apply for an instance,currently the code returns None. This is bad, as it means we cannotswitch to the actual HV parameter types and validate correctly thisfield....
query: change (debug-mode) field validation errors
Currently, the single assert just checks that the entire row isconsistent (true/false), and dumps the row and field definitions as anaccompanying message. This makes it very hard to understand what failed....
Rename a few instance field titles
The conversion to querylib introduced unique field titles, which howeverdid an inconsistent rename of the instance vcpus/memory fields.
This patch makes both BE_MEMORY and VCPUS be named with prefix “Config”(which before was “Configured”), and drops the “Runtime” (note no...
query: Change internal result computation
While looking at the query library, I realized that while we have fivefield statuses, making this a 5-dimensional space, four of them areshrunk to a single possible value (None). Hence it should be possible toconvert this into a single value space plus extra 4 special constants....
Import QRFS_* and QFT_* in query.py
Currently, the QRFT/QFT constants are used with the module (e.g.constants.QRFS_NORMAL) in the query library. Given that there are 176uses of these constants in a module that has roughly ~1200 lines intotal (including whitespace), it makes sense to import these directly to...
KVM: Add auxiliary functions to handle tap devices
Add two new functions, _OpenTap and _ProbeTapVnetHdr, tohypervisors.hv_kvm.
_ProbeTapVnetHdr checks if the host kernel supports the virtio net header(IFF_VNET_HDR) feature. This feature allows KVM to ask the the host kernel to...
Ship default kvm-ifup script
In order to retain backwards compatibility, we ship the shell script previouslygenerated by _WriteNetScript as a stand-alone script under PKGLIBDIR.
Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>Signed-off-by: Guido Trotter <ultrotter@google.com>...
KVM: Perform network configuration in Ganeti
This patch introduces network configuration for KVM in Ganeti.
There are three problems with having KVM perform network configuration via ifupscripts: a) Ganeti never gets to know the tap interface that is associated with an...
KVM: don't fail removing non-existing nic path
This shouldn't normally happen, but if it does no need to fail.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Rename OpGetTags and LUGetTags
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Rename OpSearchTags and LUSearchTags
Rename OpAddTags and LUAddTags
Rename OpTestJobqueue and LUTestJobqueue
Check consistency of the class names and OP_ID
As the class names should be now consistent with the OP_IDs, we add acheck for wrongly-defined OP_IDs.
However, the future removal of the hand-coded OP_IDs will render thisobsolete, so this check is introduced just to make sure that the...
Remove hard-coded OP_ID definitions
The removal requires adding a few pylint ignores, as it cannot know thatOP_ID will be defined at runtime.
Also switch the asserts to check for non-declaration.
Rename OpStartupInstance and LUStartupInstance
Rename OpAddNode and LUAddNode
Rename OpNodeEvacuationStrategy and LUNodeEvacuationStrategy
Rename OpMigrateNode and LUMigrateNode
Rename OpModifyNodeStorage and LUModifyNodeStorage
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
Rename OpPowercycleNode and LUPowercycleNode
Rename OpQueryNodes and LUQueryNodes
Rename OpQueryNodeVolumes and LUQueryNodeVolumes
Rename OpQueryNodeStorage and LUQueryNodeStorage
Rename OpRemoveNode and LURemoveNode
Rename OpSetNodeParams and LUSetNodeParams
Rename OpDiagnoseOS and LUDiagnoseOS
Rename OpDelTags and LUDelTags
Rename OpReinstallInstance and LUReinstallInstance
Rename OpRemoveInstance and LURemoveInstance
Rename OpRenameInstance and LURenameInstance
Rename OpReplaceDisks and LUReplaceDisks
Rename OpSetInstanceParams and LUSetInstanceParams
Rename OpShutdownInstance and LUShutdownInstance