Inter-node RPC library.
Class |
|
RPC wrappers for bootstrapping. |
Class |
|
RPC wrappers for config . |
Class |
|
RPC wrappers for calls using only DNS. |
Class |
|
RPC wrappers for job queue. |
Class |
|
RPC Result class. |
Class |
|
RPC runner class. |
Function |
|
Annotates the disk objects with the disk parameters. |
Function |
|
Return the exclusive storage flag for all the given nodes. |
Function |
|
Initializes the module-global HTTP client manager. |
Function |
|
Formats the data returned by call_node_info. |
Function |
|
Return the lvm storage unit for all the given nodes. |
Function |
|
RPC-wrapper decorator. |
Function |
|
Stops the module-global HTTP client manager. |
Class | _ |
No class docstring; 0/2 instance variable, 2/2 methods, 1/1 static method documented |
Class | _ |
No class docstring; 0/3 instance variable, 2/2 methods, 2/2 static methods documented |
Class | _ |
No class docstring; 0/1 instance variable, 2/2 methods documented |
Function | _ |
Adds the exclusive storage flag to lvm units. |
Function | _ |
Extracts the spindle information from the space info and adds it to the result dictionary. |
Function | _ |
Extracts the storage space information of the disk template from the space info and adds it to the result dictionary. |
Function | _ |
Annotates just DRBD disks layouts. |
Function | _ |
Generic disk parameter annotation routine. |
Function | _ |
Checks if a node is online. |
Function | _ |
Compresses a string for transport over RPC. |
Function | _ |
Undocumented |
Function | _ |
Encodes information for renaming block devices. |
Function | _ |
Undocumented |
Function | _ |
Calculate node addresses using configuration. |
Function | _ |
Converts a list of objects to dictionaries. |
Function | _ |
Converts an object to a dictionary. |
Function | _ |
Loads a file and prepares it for an upload to nodes. |
Function | _ |
Encodes disks for finalizing export. |
Function | _ |
Return addresses for given node names. |
Constant | _ENCODERS |
Undocumented |
Constant | _OFFLINE |
Undocumented |
Constant | _RPC |
Undocumented |
Annotates the disk objects with the disk parameters.
Parameters | |
disks | The list of disks objects to annotate |
disk | The disk parameters for annotation |
Returns | |
A list of disk objects annotated |
Return the exclusive storage flag for all the given nodes.
Parameters | |
cfg:config.ConfigWriter | cluster configuration |
node | node UUIDs for which to read the flag |
Returns | |
dict | mapping from node uuids to exclusive storage flags |
Raises | |
errors.OpPrereqError | if any given node name has no corresponding node |
Initializes the module-global HTTP client manager.
Must be called before using any RPC function and while exactly one thread is running.
Formats the data returned by call_node_info.
Converts the data into a single dictionary. This is fine for most use cases, but some require information from more than one volume group or hypervisor.
Return the lvm storage unit for all the given nodes.
Main purpose of this function is to map the exclusive storage flag, which can be different for each node, to the default LVM storage unit.
Parameters | |
cfg:config.ConfigWriter | cluster configuration |
storage | list of 'raw' storage units, e.g. pairs of (storage_type, storage_key) |
node | node UUIDs for which to read the flag |
Returns | |
dict | mapping from node uuids to a list of storage units which include the exclusive storage flag for lvm storage |
Raises | |
errors.OpPrereqError | if any given node name has no corresponding node |
RPC-wrapper decorator.
When applied to a function, it runs it with the RPC system initialized, and it shutsdown the system afterwards. This means the function must be called without RPC being initialized.
Stops the module-global HTTP client manager.
Must be called before quitting the program and while exactly one thread is running.
Adds the exclusive storage flag to lvm units.
This function creates a copy of the storage_units lists, with the es_flag being added to all lvm storage units.
Parameters | |
storage | list of 'raw' storage units, consisting only of (storage_type, storage_key) |
es | exclusive storage flag |
Returns | |
list of tuples (string, string, list) | list of storage units (storage_type, storage_key, params) with the params containing the es_flag for lvm-vg storage units |
Extracts the spindle information from the space info and adds it to the result dictionary.
Parameters | |
result:dict of strings | dictionary holding the result of the legacy node info |
space | list, each row holding space information of one storage unit |
Returns | |
None | does not return anything, manipulates the result variable |
Extracts the storage space information of the disk template from the space info and adds it to the result dictionary.
See Also | |
_AddSpindlesToLegacyNodeInfo for parameter information. |
Checks if a node is online.
Parameters | |
node | Node UUID |
node:objects.Node or None | Node object |
accept | Undocumented |
Compresses a string for transport over RPC.
Small amounts of data are not compressed.
Parameters | |
_ | Undocumented |
data:str | Data |
Returns | |
tuple | Encoded data to send |
Calculate node addresses using configuration.
Note that strings in node_uuids are treated as node names if the UUID is not found in the configuration.
Return addresses for given node names.
Parameters | |
ssconf | Use the ssconf IPs |
node | List of node names |
_ | Undocumented |
ssc:class | SimpleStore class that is used to obtain node->ip mappings |
nslookup | function use to do NS lookup |
Returns | |
list of tuple; (string, string) | List of tuples containing node name and IP address |