class LUClusterVerifyGroup(LogicalUnit, _VerifyErrors):
Verifies the status of a node group.
Class |
|
A class representing the logical and physical status of a node. |
Method |
|
Build hooks env. |
Method |
|
Build hooks nodes. |
Method |
|
Check prerequisites for this LU. |
Method |
|
Declare LU locking needs for a level |
Method |
|
Verify integrity of the node group, performing various test on nodes. |
Method |
|
Expand names for this LU. |
Method |
|
Analyze the post-hooks' result |
Constant | HPATH |
Undocumented |
Constant | REQ |
Undocumented |
Instance Variable | all |
Undocumented |
Instance Variable | all |
Undocumented |
Instance Variable | all |
Undocumented |
Instance Variable | bad |
Undocumented |
Instance Variable | extra |
Undocumented |
Instance Variable | group |
Undocumented |
Instance Variable | group |
Undocumented |
Instance Variable | master |
Undocumented |
Instance Variable | my |
Undocumented |
Instance Variable | my |
Undocumented |
Instance Variable | my |
Undocumented |
Instance Variable | my |
Undocumented |
Instance Variable | needed |
Undocumented |
Instance Variable | share |
Undocumented |
Class Method | _ |
Choose which nodes should talk to which other nodes. |
Static Method | _ |
Gives the DRBD information in a map for a node. |
Static Method | _ |
Create endless iterators for all potential SSH check hosts. |
Static Method | _ |
Undocumented |
Method | _ |
Helper function for _VerifyClientCertificates. |
Method | _ |
Gets per-disk status information for all instances. |
Method | _ |
Prepare the input data for the SSH setup verification. |
Method | _ |
Verifies and computes a node information map |
Method | _ |
Verifies and updates the node instance list. |
Method | _ |
Builds the node OS structures. |
Method | _ |
Verifies and updates the node volume data. |
Method | _ |
Check the node LVM results and update info for cross-node checks. |
Method | _ |
Verifies paths in pathutils.FILE_STORAGE_PATHS_FILE . |
Method | _ |
Verifies the consistency of the client certificates. |
Method | _ |
Verify that all instances have different exclusion tags. |
Method | _ |
Verifies file checksums collected from all nodes. |
Method | _ |
Verifies (file) storage paths. |
Method | _ |
Verifies (file) storage paths. |
Method | _ |
Check cross-node DRBD version consistency. |
Method | _ |
Check cross-node consistency in LVM. |
Method | _ |
Verify an instance. |
Method | _ |
Perform some basic validation on data returned from a node. |
Method | _ |
Check the node bridges. |
Method | _ |
Verifies and the node DRBD status. |
Method | _ |
Verify the drbd helper. |
Method | _ |
Check the node network connectivity results. |
Method | _ |
Verifies the node OS list. |
Method | _ |
Check the node time. |
Method | _ |
Check the results of user scripts presence and executability on the node |
Method | _ |
Verify N+1 Memory Resilience. |
Method | _ |
Verifies out of band functionality of a node. |
Method | _ |
Verify if there are any unknown volumes in the cluster. |
Method | _ |
Verifies (file) storage paths. |
Method | _ |
Evaluates the verification results of the SSH setup and clutter test. |
Method | _ |
Verifies (file) storage paths. |
Constant | _HOOKS |
Undocumented |
Instance Variable | _cert |
Undocumented |
Instance Variable | _exclusive |
Undocumented |
Instance Variable | _feedback |
Undocumented |
Inherited from LogicalUnit
:
Method | __init__ |
Constructor for LogicalUnit. |
Method |
|
Raise AssertionError if the LU holds some locks of the given level. |
Method |
|
Check syntactic validity for the opcode arguments. |
Method | owned |
Return the list of locks owned by the LU at a given level. |
Method |
|
Extend list of nodes to run the post LU hook. |
Method |
|
Prepare the LU to run again. |
Method | release |
Return a request to release the specified locks of the given level. |
Method |
|
Undocumented |
Constant | HTYPE |
Undocumented |
Instance Variable | add |
Undocumented |
Instance Variable | cfg |
Undocumented |
Instance Variable | dont |
Undocumented |
Instance Variable | dry |
the value (if any) that will be returned to the caller in dry-run mode (signalled by opcode dry_run parameter) |
Instance Variable |
|
Undocumented |
Instance Variable |
|
Undocumented |
Instance Variable |
|
Undocumented |
Instance Variable |
|
Undocumented |
Instance Variable | op |
Undocumented |
Instance Variable | opportunistic |
Undocumented |
Instance Variable | opportunistic |
Undocumented |
Instance Variable | proc |
Undocumented |
Instance Variable | recalculate |
Undocumented |
Instance Variable | rpc |
Undocumented |
Instance Variable | tasklets |
Undocumented |
Instance Variable | wconfd |
Undocumented |
Instance Variable | wconfdcontext |
Undocumented |
Instance Variable | wconfdlocks |
Undocumented |
Method | _ |
Helper function to expand and lock an instance. |
Method | _ |
Helper function to declare instances' nodes for locking. |
Inherited from _VerifyErrors
(via LogicalUnit
):
Method | _ |
Log an error message if the passed condition is True. |
Method | _ |
Log an error message if the passed condition is True. |
Method | _ |
Log a single error message. |
Method | _ |
Format multiple error messages. |
Build hooks env.
Cluster-Verify hooks just ran in the post phase and their failure makes the output be logged in the verify output and the verification to fail.
Check prerequisites for this LU.
This method should check that the prerequisites for the execution of this LU are fulfilled. It can do internode communication, but it should be idempotent - no cluster or system changes are allowed.
The method should raise errors.OpPrereqError in case something is not fulfilled. Its return value is ignored.
This method should also update all the parameters of the opcode to their canonical form if it hasn't been done by ExpandNames before.
Declare LU locking needs for a level
While most LUs can just declare their locking needs at ExpandNames time, sometimes there's the need to calculate some locks after having acquired the ones before. This function is called just before acquiring locks at a particular level, but after acquiring the ones at lower levels, and permits such calculations. It can be used to modify self.needed_locks, and by default it does nothing.
This function is only called if you have something already set in self.needed_locks for the level.
Parameters | |
level:member of ganeti.locking.LEVELS | Locking level which is going to be locked |
ganeti.cmdlib.base.LogicalUnit.Exec
Verify integrity of the node group, performing various test on nodes.
Expand names for this LU.
This method is called before starting to execute the opcode, and it should update all the parameters of the opcode to their canonical form (e.g. a short node name must be fully expanded after this method has successfully completed). This way locking, hooks, logging, etc. can work correctly.
LUs which implement this method must also populate the self.needed_locks member, as a dict with lock levels as keys, and a list of needed lock names as values. Rules:
- use an empty dict if you don't need any lock
- if you don't need any lock at a particular level omit that level (note that in this case DeclareLocks won't be called at all for that level)
- if you need locks at a level, but you can't calculate it in this function, initialise that level with an empty list and do further processing in
LogicalUnit.DeclareLocks
(see that function's docstring) - don't put anything for the BGL level
- if you want all locks at a level use
locking.ALL_SET
as a value
If you need to share locks (rather than acquire them exclusively) at one level you can modify self.share_locks, setting a true value (usually 1) for that level. By default locks are not shared.
This function can also define a list of tasklets, which then will be executed in order instead of the usual LU-level CheckPrereq and Exec functions, if those are not defined by the LU.
Examples:
# Acquire all nodes and one instance self.needed_locks = { locking.LEVEL_NODE: locking.ALL_SET, locking.LEVEL_INSTANCE: ['instance1.example.com'], } # Acquire just two nodes self.needed_locks = { locking.LEVEL_NODE: ['node1-uuid', 'node2-uuid'], } # Acquire no locks self.needed_locks = {} # No, you can't leave it to the default value None
Analyze the post-hooks' result
This method analyses the hook result, handles it, and sends some nicely-formatted feedback back to the user.
Parameters | |
phase | one of constants.HOOKS_PHASE_POST or constants.HOOKS_PHASE_PRE ; it denotes the hooks phase |
hooks | the results of the multi-node hooks rpc call |
feedback | function used send feedback back to the caller |
lu | previous Exec result |
Returns | |
the new Exec result, based on the previous result and hook results |
Choose which nodes should talk to which other nodes.
We will make nodes contact all nodes in their group, and one node from every other group.
Returns | |
tuple of (string, dict of strings to list of strings, string) | a tuple containing the list of all online nodes, a dictionary mapping node names to additional nodes of other node groups to which connectivity should be tested, and a list of all online master candidates |
Unknown Field: warning | |
This algorithm has a known issue if one node group is much smaller than others (e.g. just one node). In such a case all other nodes will talk to the single node. |
Gives the DRBD information in a map for a node.
Parameters | |
ninfo:objects.Node | the node to check |
instanceinfo | the dict of instances |
disks | the dict of disks |
drbd | the DRBD map as returned by ganeti.config.ConfigWriter.ComputeDRBDMap |
error_ErrorIf | The error reporting function |
Returns | |
dict from minor number to (disk_uuid, instance_uuid, active) |
def _VerifyOtherNotes(feedback_fn, i_non_redundant, i_non_a_balanced, i_offline, n_offline, n_drained): ¶
Undocumented
Gets per-disk status information for all instances.
Parameters | |
node | Node UUIDs |
nodeobjects.Node ) | Node objects |
instanceinfo:dict of (UUID, objects.Instance ) | Instance objects |
Returns | |
{instance: {node: [(succes, payload)]}} | a dictionary of per-instance dictionaries with nodes as keys and disk information as values; the disk information is a list of tuples (success, payload) |
Verifies and computes a node information map
Parameters | |
ninfo:objects.Node | the node to check |
nresult | the remote results for the node |
nimg | the node image object |
vg | the configured VG name |
Verifies and updates the node instance list.
If the listing was successful, then updates this node's instance list. Otherwise, it marks the RPC call as failed for the instance list key.
Parameters | |
ninfo:objects.Node | the node to check |
nresult | the remote results for the node |
nimg | the node image object |
Builds the node OS structures.
Parameters | |
ninfo:objects.Node | the node to check |
nresult | the remote results for the node |
nimg | the node image object |
Verifies and updates the node volume data.
This function will update a NodeImage
's internal structures with data from the remote call.
Parameters | |
ninfo:objects.Node | the node to check |
nresult | the remote results for the node |
nimg | the node image object |
vg | the configured VG name |
Check the node LVM results and update info for cross-node checks.
Parameters | |
ninfo:objects.Node | the node to check |
nresult | the remote results for the node |
vg | the configured VG name |
nimg:NodeImage | node image |
Verifies paths in pathutils.FILE_STORAGE_PATHS_FILE
.
Parameters | |
ninfo:objects.Node | the node to check |
nresult | the remote results for the node |
is | Whether node is the master node |
Verifies the consistency of the client certificates.
This includes several aspects:
- the individual validation of all nodes' certificates
- the consistency of the master candidate certificate map
- the consistency of the master candidate certificate map with the certificates that the master candidates are actually using.
Parameters | |
nodes | the list of nodes to consider in this verification |
all | the map of results of the verify_node call to all nodes |
Verify that all instances have different exclusion tags.
Parameters | |
nodename:string | the name of the node for which the check is done |
pinst:list of string | list of UUIDs of those instances having the given node as primary node |
ctags:list of string | tags of the cluster |
Verifies file checksums collected from all nodes.
Parameters | |
nodes | List of objects.Node objects |
master | UUID of master node |
all | RPC results |
filemap | Undocumented |
Check cross-node DRBD version consistency.
Parameters | |
node | infos about nodes as returned from the node_verify call. |
Check cross-node consistency in LVM.
Parameters | |
node | info about nodes, mapping from node to names to NodeImage objects |
vg | the configured VG name |
Verify an instance.
This function checks to see if the required block devices are available on the instance's node, and that the nodes are in the correct state.
Perform some basic validation on data returned from a node.
- check the result data structure is well formed and has all the mandatory fields
- check ganeti version
Parameters | |
ninfo:objects.Node | the node to check |
nresult | the results from the node |
Returns | |
boolean | whether overall this call was successful (and we can expect reasonable values in the respose) |
Check the node bridges.
Parameters | |
ninfo:objects.Node | the node to check |
nresult | the remote results for the node |
bridges | the expected list of bridges |
Verifies and the node DRBD status.
Parameters | |
ninfo:objects.Node | the node to check |
nresult | the remote results for the node |
instanceinfo | the dict of instances |
disks | the dict of disks |
drbd | the configured DRBD usermode helper |
drbd | the DRBD map as returned by ganeti.config.ConfigWriter.ComputeDRBDMap |
Check the node network connectivity results.
Parameters | |
ninfo:objects.Node | the node to check |
nresult | the remote results for the node |
Verifies the node OS list.
Parameters | |
ninfo:objects.Node | the node to check |
nimg | the node image object |
base | the 'template' node we match against (e.g. from the master) |
Check the node time.
Parameters | |
ninfo:objects.Node | the node to check |
nresult | the remote results for the node |
nvinfo | the start time of the RPC call |
nvinfo | the end time of the RPC call |
Check the results of user scripts presence and executability on the node
Parameters | |
ninfo:objects.Node | the node to check |
nresult | the remote results for the node |
Verify N+1 Memory Resilience.
Check that if one single node dies we can still start all the instances it was primary for.
Verifies out of band functionality of a node.
Parameters | |
ninfo:objects.Node | the node to check |
nresult | the remote results for the node |
Verify if there are any unknown volumes in the cluster.
The .os, .swap and backup volumes are ignored. All other volumes are reported as unknown.
Parameters | |
vg | the name of the Ganeti-administered volume group |
node | mapping of node UUIDs to expected LVs on each node |
node | mapping of node UUIDs to NodeImage objects |
reserved:ganeti.utils.FieldSet | a FieldSet of reserved volume names |
Evaluates the verification results of the SSH setup and clutter test.
Parameters | |
nodes | List of objects.Node objects |
all | RPC results |
Verifies (file) storage paths.
Parameters | |
ninfo:objects.Node | the node to check |
nresult | the remote results for the node |
file | file-based disk template, whose directory is supposed to be verified |
verify | key for the verification map of this file verification step |
error | error key to be added to the verification results in case something goes wrong in this verification step |