Script gnt_cluster
[hide private]
[frames] | no frames]

Script gnt_cluster

Cluster related commands

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

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


Function Details [hide private]

InitCluster(opts, args)

 

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)

 

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)

 

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)

 

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)

 

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)

 

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)

 

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

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

ShowClusterConfig(opts, args)

 

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)

 

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)

 

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)

 

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)

 

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)

 

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)

 

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)

 

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)

 

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)

 

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)

 

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)

 

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)

 

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], "[opts...] <cluster_name>", "Initialises a new \
cluster configuration"), 'destroy':(DestroyCluster, ARGS_NONE, [YES_DO\
IT_OPT], "", "Destroy cluster"), 'rename':(RenameCluster, [ArgHost(min\
...