Package ganeti :: Package cmdlib :: Module cluster
[hide private]
[frames] | no frames]

Module cluster

source code

Logical units dealing with the cluster.

Classes [hide private]
  LUClusterRenewCrypto
Renew the cluster's crypto tokens.
  LUClusterActivateMasterIp
Activate the master IP on the master node.
  LUClusterDeactivateMasterIp
Deactivate the master IP on the master node.
  LUClusterConfigQuery
Return configuration values.
  LUClusterDestroy
Logical unit for destroying the cluster.
  LUClusterPostInit
Logical unit for running hooks after cluster initialization.
  ClusterQuery
  LUClusterQuery
Query cluster configuration.
  LUClusterRedistConf
Force the redistribution of cluster configuration.
  LUClusterRename
Rename the cluster.
  LUClusterRepairDiskSizes
Verifies the cluster disks sizes.
  LUClusterSetParams
Change the parameters of the cluster.
  LUClusterVerify
Submits all jobs necessary to verify the cluster.
  _VerifyErrors
Mix-in for cluster/group verify LUs.
  LUClusterVerifyConfig
Verifies the cluster config.
  LUClusterVerifyGroup
Verifies the status of a node group.
  LUClusterVerifyDisks
Verifies the cluster disks status.
Functions [hide private]
string
_UpdateMasterClientCert(lu, master_uuid, cluster, feedback_fn, client_cert=pathutils.NODED_CLIENT_CERT_FILE, client_cert_tmp=pathutils.NODED_CLIENT_CERT_FILE_TMP)
Renews the master's client certificate and propagates the config.
source code
 
_ValidateNetmask(cfg, netmask)
Checks if a netmask is valid.
source code
 
CheckFileBasedStoragePathVsEnabledDiskTemplates(logging_warn_fn, file_storage_dir, enabled_disk_templates, file_disk_template)
Checks whether the given file-based storage directory is acceptable.
source code
 
CheckFileStoragePathVsEnabledDiskTemplates(logging_warn_fn, file_storage_dir, enabled_disk_templates)
Checks whether the given file storage directory is acceptable.
source code
 
CheckSharedFileStoragePathVsEnabledDiskTemplates(logging_warn_fn, file_storage_dir, enabled_disk_templates)
Checks whether the given shared file storage directory is acceptable.
source code
list of (origin, hypervisor, parameters)
_GetAllHypervisorParameters(cluster, instances)
Compute the set of all hypervisor parameters.
source code

Imports: copy, itertools, logging, operator, os, re, time, compat, constants, errors, hypervisor, locking, masterd, netutils, objects, opcodes, pathutils, query, rpc, runtime, ssh, uidpool, utils, vcluster, NoHooksLU, QueryBase, LogicalUnit, ResultWithJobs, ShareAll, RunPostHook, ComputeAncillaryFiles, RedistributeAncillaryFiles, UploadHelper, GetWantedInstances, MergeAndVerifyHvState, MergeAndVerifyDiskState, GetUpdatedIPolicy, ComputeNewInstanceViolations, GetUpdatedParams, CheckOSParams, CheckHVParams, AdjustCandidatePool, CheckNodePVs, ComputeIPolicyInstanceViolation, AnnotateDiskParams, SupportsOob, CheckIpolicyVsDiskTemplates, CheckDiskAccessModeValidity, CheckDiskAccessModeConsistency, CreateNewClientCert, EnsureKvmdOnNodes, ganeti


Function Details [hide private]

_UpdateMasterClientCert(lu, master_uuid, cluster, feedback_fn, client_cert=pathutils.NODED_CLIENT_CERT_FILE, client_cert_tmp=pathutils.NODED_CLIENT_CERT_FILE_TMP)

source code 

Renews the master's client certificate and propagates the config.

Parameters:
  • lu (LogicalUnit) - the logical unit holding the config
  • master_uuid (string) - the master node's UUID
  • cluster (objects.Cluster) - the cluster's configuration
  • feedback_fn (function) - feedback functions for config updates
  • client_cert (string) - the path of the client certificate
  • client_cert_tmp (string) - the temporary path of the client certificate
Returns: string
the digest of the newly created client certificate

_ValidateNetmask(cfg, netmask)

source code 

Checks if a netmask is valid.

Parameters:
  • cfg (config.ConfigWriter) - The cluster configuration
  • netmask (int) - the netmask to be verified
Raises:

CheckFileBasedStoragePathVsEnabledDiskTemplates(logging_warn_fn, file_storage_dir, enabled_disk_templates, file_disk_template)

source code 

Checks whether the given file-based storage directory is acceptable.

Note: This function is public, because it is also used in bootstrap.py.

Parameters:
  • logging_warn_fn (function) - function which accepts a string and logs it
  • file_storage_dir (string) - the directory to be used for file-based instances
  • enabled_disk_templates (list of string) - the list of enabled disk templates
  • file_disk_template (string) - the file-based disk template for which the path should be checked

CheckFileStoragePathVsEnabledDiskTemplates(logging_warn_fn, file_storage_dir, enabled_disk_templates)

source code 

Checks whether the given file storage directory is acceptable.

See Also: CheckFileBasedStoragePathVsEnabledDiskTemplates

CheckSharedFileStoragePathVsEnabledDiskTemplates(logging_warn_fn, file_storage_dir, enabled_disk_templates)

source code 

Checks whether the given shared file storage directory is acceptable.

See Also: CheckFileBasedStoragePathVsEnabledDiskTemplates

_GetAllHypervisorParameters(cluster, instances)

source code 

Compute the set of all hypervisor parameters.

Parameters:
Returns: list of (origin, hypervisor, parameters)
a list with all parameters found, indicating the hypervisor they apply to, and the origin (can be "cluster", "os X", or "instance Y")