Cluster related commands
Function |
|
Activates the master IP. |
Function |
|
Copy a file from master to some nodes. |
Function |
|
Deactivates the master IP. |
Function |
|
Destroy the cluster. |
Function |
|
EPO operations. |
Function |
|
Initialize the cluster. |
Function |
|
Undocumented |
Function |
|
Failover the master node. |
Function |
|
Checks if the master is alive. |
Function |
|
Queue operations. |
Function |
|
Forces push of the cluster configuration. |
Function |
|
Rename the cluster. |
Function |
|
Renews cluster certificates, keys and secrets. |
Function |
|
Verify sizes of cluster disks. |
Function |
|
Run a command on some nodes. |
Function |
|
Searches the tags on all the cluster. |
Function |
|
Modify the cluster. |
Function |
|
Shows cluster information. |
Function |
|
Write name of master node to the standard output. |
Function |
|
Write version of ganeti software to the standard output. |
Function |
|
Shows the command that can be used to re-create the cluster. |
Function |
|
Upgrade a cluster to a new ganeti version. |
Function |
|
Verify integrity of cluster, performing various test on nodes. |
Function |
|
Verify integrity of cluster disks. |
Function |
|
Watcher operations. |
Constant | DATA |
Undocumented |
Constant | FORCE |
Undocumented |
Constant | FORCE |
Undocumented |
Constant | GROUPS |
Undocumented |
Constant | IGNORE |
Undocumented |
Constant | ON |
Undocumented |
Constant | RESUME |
Undocumented |
Constant | STRICT |
Undocumented |
Constant | TO |
Undocumented |
Variable | aliases |
Undocumented |
Variable | commands |
Undocumented |
Class | _ |
Helper class to make shared internal state sharing easier. |
Function | _ |
Recreates the 'ganeti_pub_key' file by polling all nodes. |
Function | _ |
Does the actual power off. |
Function | _ |
Does the actual power on. |
Function | _ |
Execute a list of functions, in reverse order. |
Function | _ |
Format Grouped parameters (be, nic, disk) by group. |
Function | _ |
Format Grouped parameters (be, nic, disk) by group. |
Function | _ |
Determine the list of custom compression tools. |
Function | _ |
Determine the version the configuration file currently has. |
Function | _ |
Undocumented |
Function | _ |
Determine the DRBD usermode helper. |
Function | _ |
Determine the list of enabled disk templates. |
Function | _ |
Determine the list of running jobs. |
Function | _ |
Determine the volume group name. |
Function | _ |
Initialize the DRBD usermode helper. |
Function | _ |
Initialize the list of enabled disk templates. |
Function | _ |
Initialize the volume group name. |
Function | _ |
Puts the instances in the list to desired state. |
Function | _ |
Start the instances conditional based on node_states. |
Function | _ |
Puts the node in the list to desired power state. |
Function | _ |
Reads and verifies an X509 certificate. |
Function | _ |
Read the file documenting the intent to upgrade the cluster. |
Function | _ |
Renews cluster certificates, keys and secrets. |
Function | _ |
Run a command and report its output, iff it failed. |
Function | _ |
Run action_cb when nodes become reachable. |
Function | _ |
Symlink the active version of ganeti to the given versionstring, and run the ensure-dirs script. |
Function | _ |
Undocumented |
Function | _ |
Switch to the new Ganeti version and change the configuration, in correct order. |
Function | _ |
Carry out the upgrade actions necessary after switching to the new Ganeti version and updating the configuration. |
Function | _ |
Carry out all the tasks necessary for an upgrade that happen before the configuration file, or Ganeti version, changes. |
Function | _ |
Verify that a given command succeeds on all online nodes. |
Function | _ |
Verify that a given command succeeds on all online nodes. |
Function | _ |
Verify that the given version of ganeti is installed on all online nodes. |
Function | _ |
Perform any additional downrade tasks that are version specific and need to be done just after the configuration downgrade. This function needs to be idempotent, so that it can be redone if the downgrade procedure gets interrupted after changing the configuration. |
Function | _ |
Write file documenting the intent to upgrade the cluster. |
Constant | _EPO |
Undocumented |
Constant | _EPO |
Undocumented |
Constant | _EPO |
Undocumented |
Copy a file from master to some nodes.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain only one element, the path of the file to be copied |
Returns | |
int | the desired exit code |
Destroy the cluster.
Parameters | |
opts | the command line options selected by the user |
args:list | should be an empty list |
Returns | |
int | the desired exit code |
EPO operations.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain only one element, the subcommand |
qcl | Undocumented |
_on | Undocumented |
_off | Undocumented |
_confirm | Undocumented |
_stdout | Undocumented |
_stderr | Undocumented |
Returns | |
int | the desired exit code |
Initialize the cluster.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain only one element, the desired cluster name |
Returns | |
int | the desired exit code |
Failover the master node.
This command, when run on a non-master node, will cause the current master to cease being master, and the non-master to become new master.
Parameters | |
opts | the command line options selected by the user |
args:list | should be an empty list |
Returns | |
int | the desired exit code |
Checks if the master is alive.
Parameters | |
opts | the command line options selected by the user |
args:list | should be an empty list |
Returns | |
int | the desired exit code |
Queue operations.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain only one element, the subcommand |
Returns | |
int | the desired exit code |
Forces push of the cluster configuration.
Parameters | |
opts | the command line options selected by the user |
args:list | empty list |
Returns | |
int | the desired exit code |
Rename the cluster.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain only one element, the new cluster name |
Returns | |
int | the desired exit code |
Verify sizes of cluster disks.
Parameters | |
opts | the command line options selected by the user |
args:list | optional list of instances to restrict check to |
Returns | |
int | the desired exit code |
Run a command on some nodes.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain the command to be run and its arguments |
Returns | |
int | the desired exit code |
Searches the tags on all the cluster.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain only one element, the tag pattern |
Returns | |
int | the desired exit code |
Modify the cluster.
Parameters | |
opts | the command line options selected by the user |
args:list | should be an empty list |
Returns | |
int | the desired exit code |
Shows cluster information.
Parameters | |
opts | the command line options selected by the user |
args:list | should be an empty list |
Returns | |
int | the desired exit code |
Write name of master node to the standard output.
Parameters | |
opts | the command line options selected by the user |
args:list | should be an empty list |
Returns | |
int | the desired exit code |
Write version of ganeti software to the standard output.
Parameters | |
opts | the command line options selected by the user |
args:list | should be an empty list |
Returns | |
int | the desired exit code |
Shows the command that can be used to re-create the cluster.
Currently it works only for ipolicy specs.
Upgrade a cluster to a new ganeti version.
Parameters | |
opts | the command line options selected by the user |
args:list | should be an empty list |
Returns | |
int | the desired exit code |
Verify integrity of cluster, performing various test on nodes.
Parameters | |
opts | the command line options selected by the user |
args:list | should be an empty list |
Returns | |
int | the desired exit code |
Verify integrity of cluster disks.
Parameters | |
opts | the command line options selected by the user |
args:list | should be an empty list |
Returns | |
int | the desired exit code |
Watcher operations.
Parameters | |
opts | the command line options selected by the user |
args:list | should contain only one element, the subcommand |
Returns | |
int | the desired exit code |
Undocumented
Value |
|
Undocumented
Value |
|
Undocumented
Value |
|
Undocumented
Value |
|
Undocumented
Value |
|
Undocumented
Value |
|
Undocumented
Value |
|
Undocumented
Value |
|
Undocumented
Value |
|
Recreates the 'ganeti_pub_key' file by polling all nodes.
Does the actual power off.
Parameters | |
opts | The command line options selected by the user |
node | The list of nodes to operate on (all need to support OOB) |
inst | A dict of inst -> nodes mapping |
Returns | |
The desired exit status |
Does the actual power on.
Parameters | |
opts | The command line options selected by the user |
full | All nodes to operate on (includes nodes not supporting OOB) |
node | The list of nodes to operate on (all need to support OOB) |
inst | A dict of inst -> nodes mapping |
Returns | |
The desired exit status |
Execute a list of functions, in reverse order.
Parameters | |
fns:list of functions. | the functions to be executed. |
Format Grouped parameters (be, nic, disk) by group.
Parameters | |
paramsdict:dict of dicts | response of QueryClusterInfo |
Returns | |
dict of dicts | parameter grouped by data collector |
Format Grouped parameters (be, nic, disk) by group.
Parameters | |
paramsdict:dict of dicts | {group: {param: value, ...}, ...} |
roman | Undocumented |
Returns | |
dict of dicts | copy of the input dictionaries with strings as values |
Determine the version the configuration file currently has.
Returns | |
tuple or None | (major, minor, revision) if the version can be determined, None otherwise |
Determine the volume group name.
Parameters | |
opts | Undocumented |
enabled | cluster-wide enabled disk-templates |
Initialize the volume group name.
Parameters | |
opts | Undocumented |
enabled | cluster-wide enabled disk templates |
Puts the instances in the list to desired state.
Parameters | |
opts | The command line options selected by the user |
inst | The list of instances to operate on |
start | True if they should be started, False for shutdown |
no | If the instance state should be remembered |
Returns | |
The success of the operation (none failed) |
Start the instances conditional based on node_states.
Parameters | |
opts | The command line options selected by the user |
inst | A dict of inst -> nodes mapping |
nodes | A list of nodes online |
_instance | Callback to start instances (unittest use only) |
Returns | |
Success of the operation on all instances |
Puts the node in the list to desired power state.
Parameters | |
opts | The command line options selected by the user |
node | The list of nodes to operate on |
power | True if they should be powered on, False otherwise |
Returns | |
The success of the operation (none failed) |
Reads and verifies an X509 certificate.
Parameters | |
cert | the path of the file containing the certificate to verify encoded in PEM format |
verify | whether to verify the private key in addition to the public certificate |
Returns | |
string | a string containing the PEM-encoded certificate. |
Read the file documenting the intent to upgrade the cluster.
Returns | |
(string, string) or (None, None) | (old version, version to upgrade to), if the file exists, and (None, None) otherwise. |
Renews cluster certificates, keys and secrets.
Parameters | |
new | Whether to generate a new cluster certificate |
new | Whether to generate a new RAPI certificate |
rapi | Path to file containing new RAPI certificate |
new | Whether to generate a new SPICE certificate |
spice | Path to file containing new SPICE certificate |
spice | Path to file containing the certificate of the CA that signed the SPICE certificate |
new | Whether to generate a new HMAC key |
new | Whether to generate a new cluster domain secret |
cds | Path to file containing new cluster domain secret |
force:bool | Whether to ask user for confirmation |
new | Whether to generate new node certificates |
new | Whether to generate new node SSH keys |
sshconstants.SSHK_ALL | The type of SSH key to be generated |
ssh | The length of the key to be generated |
verbose:boolean | Show verbose output |
debug:boolean | Show debug output |
Run a command and report its output, iff it failed.
Parameters | |
cmd:list | the command to execute |
Returns | |
bool | False, if the execution failed. |
Run action_cb when nodes become reachable.
Parameters | |
node | The list of nodes to be reachable |
action | Callback called when a new host is reachable |
interval | The earliest time to retry |
Symlink the active version of ganeti to the given versionstring, and run the ensure-dirs script.
Parameters | |
versionstring:string | Undocumented |
Returns | |
list | the list of nodes where the version change failed |
Switch to the new Ganeti version and change the configuration, in correct order.
Parameters | |
versionstring:string | the version to change to |
downgrade:bool | True, if the configuration should be downgraded |
Returns | |
(bool, list) | tupe of a bool indicating success, and a list of additional rollback tasks |
Carry out the upgrade actions necessary after switching to the new Ganeti version and updating the configuration.
As this part is run at a time where the new version of Ganeti is already running, no communication should happen via luxi, as this is not a stable interface. Also, as the configuration change is the point of no return, all actions are pushed through, even if some of them fail.
Parameters | |
oldversion:string | the version the upgrade started from |
Returns | |
int | the intended return value |
Carry out all the tasks necessary for an upgrade that happen before the configuration file, or Ganeti version, changes.
Parameters | |
versionstring:string | the version to upgrade to |
Returns | |
(bool, list) | tuple of a bool indicating success and a list of rollback tasks |
Verify that a given command succeeds on all online nodes.
As this function is intended to run during upgrades, it is implemented in such a way that it still works, if all Ganeti daemons are down.
Parameters | |
cmd:list | a list of unquoted shell arguments |
Returns | |
list | the list of node names that are online where the command failed. |
Verify that a given command succeeds on all online nodes.
As this function is intended to run during upgrades, it is implemented in such a way that it still works, if all Ganeti daemons are down.
Parameters | |
command | Undocumented |
cmd:string | a bare string to pass to SSH. The caller must do their own shell/ssh escaping. |
Returns | |
list | the list of node names that are online where the command failed. |
Verify that the given version of ganeti is installed on all online nodes.
Do nothing, if this is the case, otherwise print an appropriate message to stderr.
Parameters | |
versionstring:string | the version to check for |
Returns | |
bool | True, if the version is installed on all online nodes |
Perform any additional downrade tasks that are version specific and need to be done just after the configuration downgrade. This function needs to be idempotent, so that it can be redone if the downgrade procedure gets interrupted after changing the configuration.
Note that this function has to be reset with every version bump.
Returns | |
True upon success |