Package ganeti :: Package client :: Module gnt_cluster
[hide private]
[frames] | no frames]

Module gnt_cluster

source code

Cluster related commands

Functions [hide private]
int
InitCluster(opts, args)
Initialize the cluster.
source code
int
DestroyCluster(opts, args)
Destroy the cluster.
source code
int
RenameCluster(opts, args)
Rename the cluster.
source code
int
RedistributeConfig(opts, args)
Forces push of the cluster configuration.
source code
int
ShowClusterVersion(opts, args)
Write version of ganeti software to the standard output.
source code
int
ShowClusterMaster(opts, args)
Write name of master node to the standard output.
source code
 
_PrintGroupedParams(paramsdict, level=1, roman=False)
Print Grouped parameters (be, nic, disk) by group.
source code
int
ShowClusterConfig(opts, args)
Shows cluster information.
source code
int
ClusterCopyFile(opts, args)
Copy a file from master to some nodes.
source code
int
RunClusterCommand(opts, args)
Run a command on some nodes.
source code
int
VerifyCluster(opts, args)
Verify integrity of cluster, performing various test on nodes.
source code
int
VerifyDisks(opts, args)
Verify integrity of cluster disks.
source code
int
RepairDiskSizes(opts, args)
Verify sizes of cluster disks.
source code
int
MasterFailover(opts, args)
Failover the master node.
source code
int
MasterPing(opts, args)
Checks if the master is alive.
source code
int
SearchTags(opts, args)
Searches the tags on all the cluster.
source code
 
_RenewCrypto(new_cluster_cert, new_rapi_cert, rapi_cert_filename, new_confd_hmac_key, new_cds, cds_filename, force)
Renews cluster certificates, keys and secrets.
source code
 
RenewCrypto(opts, args)
Renews cluster certificates, keys and secrets.
source code
int
SetClusterParams(opts, args)
Modify the cluster.
source code
int
QueueOps(opts, args)
Queue operations.
source code
 
_ShowWatcherPause(until) source code
int
WatcherOps(opts, args)
Watcher operations.
source code
 
Main() source code
Variables [hide private]
  commands = {'init':(InitCluster, [ArgHost(min= 1, max= 1)], [B...
  aliases = {'masterfailover': 'master-failover',}
dictionary with aliases for commands

Imports: os, time, OpenSSL, opcodes, constants, errors, utils, bootstrap, ssh, objects, uidpool, compat


Function Details [hide private]

InitCluster(opts, args)

source 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
Decorators:
  • @UsesRPC

DestroyCluster(opts, args)

source 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
Decorators:
  • @UsesRPC

RenameCluster(opts, args)

source 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

RedistributeConfig(opts, args)

source 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

ShowClusterVersion(opts, args)

source 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

ShowClusterMaster(opts, args)

source 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

_PrintGroupedParams(paramsdict, level=1, roman=False)

source code 

Print Grouped parameters (be, nic, disk) by group.

Parameters:
  • paramsdict (dict of dicts) - {group: {param: value, ...}, ...}
  • level (int) - Level of indention

ShowClusterConfig(opts, args)

source 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

ClusterCopyFile(opts, args)

source code 

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

RunClusterCommand(opts, args)

source 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

VerifyCluster(opts, args)

source 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

VerifyDisks(opts, args)

source 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

RepairDiskSizes(opts, args)

source 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

MasterFailover(opts, args)

source 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
Decorators:
  • @UsesRPC

MasterPing(opts, args)

source 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

SearchTags(opts, args)

source 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

_RenewCrypto(new_cluster_cert, new_rapi_cert, rapi_cert_filename, new_confd_hmac_key, new_cds, cds_filename, force)

source code 

Renews cluster certificates, keys and secrets.

Parameters:
  • new_cluster_cert (bool) - Whether to generate a new cluster certificate
  • new_rapi_cert (bool) - Whether to generate a new RAPI certificate
  • rapi_cert_filename (string) - Path to file containing new RAPI certificate
  • new_confd_hmac_key (bool) - Whether to generate a new HMAC key
  • new_cds (bool) - Whether to generate a new cluster domain secret
  • cds_filename (string) - Path to file containing new cluster domain secret
  • force (bool) - Whether to ask user for confirmation

SetClusterParams(opts, args)

source 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

QueueOps(opts, args)

source 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

WatcherOps(opts, args)

source 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

Variables Details [hide private]

commands

Value:
{'init':(InitCluster, [ArgHost(min= 1, max= 1)], [BACKEND_OPT, CP_SIZE\
_OPT, ENABLED_HV_OPT, GLOBAL_FILEDIR_OPT, HVLIST_OPT, MAC_PREFIX_OPT, \
MASTER_NETDEV_OPT, NIC_PARAMS_OPT, NOLVM_STORAGE_OPT, NOMODIFY_ETCHOST\
S_OPT, NOMODIFY_SSH_SETUP_OPT, SECONDARY_IP_OPT, VG_NAME_OPT, MAINTAIN\
_NODE_HEALTH_OPT, UIDPOOL_OPT, DRBD_HELPER_OPT, NODRBD_STORAGE_OPT, DE\
FAULT_IALLOCATOR_OPT, PRIMARY_IP_VERSION_OPT, PREALLOC_WIPE_DISKS_OPT,\
 NODE_PARAMS_OPT], "[opts...] <cluster_name>", "Initialises a new clus\
ter configuration"), 'destroy':(DestroyCluster, ARGS_NONE, [YES_DOIT_O\
...