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.
Signed-off-by: René Nussbaumer <rn@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
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
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: René Nussbaumer <rn@google.com>
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.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
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 OpMigrateInstance and LUMigrateInstance
Rename OpMoveInstance and LUMoveInstance
Rename OpQueryInstances and LUQueryInstances
Rename OpQueryInstanceData and LUQueryInstanceData
Rename OpRebootInstance and LURebootInstance
Rename OpRecreateInstanceDisks and LURecreateInstanceDisks
Rename OpReinstallInstance and LUReinstallInstance
Rename OpRemoveInstance and LURemoveInstance
Rename OpRenameInstance and LURenameInstance
Rename OpReplaceDisks and LUReplaceDisks
Rename OpSetInstanceParams and LUSetInstanceParams
Rename OpShutdownInstance and LUShutdownInstance
Rename OpVerifyDisks and LUVerifyDisks
Rename OpAddGroup and LUAddGroup
Rename OpAssignGroupNodes and LUAssignGroupNodes
Rename OpQueryGroups and LUQueryGroups
Rename OpRemoveGroup and LURemoveGroup
Rename OpRenameGroup and LURenameGroup
Rename OpSetGroupParams and LUSetGroupParams
Rename OpActivateInstanceDisks and LUActivateInstanceDisks
Rename OpConnectConsole and LUConnectConsole
Rename OpCreateInstance and LUCreateInstance
Rename OpDeactivateInstanceDisks and LUDeactivateInstanceDisks
Rename OpFailoverInstance and LUFailoverInstance
Rename OpGrowDisk and LUGrowDisk
Rename OpQueryClusterInfo and LUQueryClusterInfo
Rename OpRedistributeConfig and LURedistributeConfig
Rename OpRenameCluster and LURenameCluster
Rename OpRepairDiskSizes and LURepairDiskSizes
Rename OpSetClusterParams and LUSetClusterParams
Rename OpVerifyCluster and LUVerifyCluster