package documentation

Configuration management for Ganeti

This module provides the interface to the Ganeti cluster configuration.

The configuration data is stored on every node but is updated on the master only. After each update, the master distributes the data to the other nodes.

Currently, the data storage format is JSON. YAML was slow and consuming too much memory.

Module temporary_reservations Reserve resources, so that jobs can't take them.
Module utils Utilities used by the config module.
Module verify Verification helpers for the configuration object.

From __init__.py:

Class ConfigWriter The interface to the cluster configuration.
Class DetachedConfig Read-only snapshot of the config.
Function GetConfig A utility function for constructing instances of ConfigWriter.
Function GetWConfdContext Prepare a context for communication with WConfd.
Function _CheckInstanceDiskIvNames Checks if instance's disks' iv_name attributes are in order.
Function _MatchNameComponentIgnoreCase Wrapper around utils.text.MatchNameComponent.
Constant _UPGRADE_CONFIG_JID Undocumented
def GetWConfdContext(ec_id, livelock):

Prepare a context for communication with WConfd.

WConfd needs to know the identity of each caller to properly manage locks and detect job death. This helper function prepares the identity object given a job ID (optional) and a livelock file.

Parameters
ec_id:int, or Nonethe job ID or None, if the caller isn't a job
livelock:ganeti.utils.livelock.LiveLocka livelock object holding the lockfile needed for WConfd
Returns
the WConfd context
def GetConfig(ec_id, livelock, **kwargs):

A utility function for constructing instances of ConfigWriter.

It prepares a WConfd context and uses it to create a ConfigWriter instance.

Parameters
ec_id:int, or Nonethe job ID or None, if the caller isn't a job
livelock:ganeti.utils.livelock.LiveLocka livelock object holding the lockfile needed for WConfd
**kwargs:dictAny additional arguments for the ConfigWriter constructor
Returns
ConfigWriterthe ConfigWriter context
_UPGRADE_CONFIG_JID: str =

Undocumented

Value
'jid-cfg-upgrade'
def _MatchNameComponentIgnoreCase(short_name, names):
def _CheckInstanceDiskIvNames(disks):

Checks if instance's disks' iv_name attributes are in order.

Parameters
disks:list of objects.DiskList of disks
Returns
list of tuples; (int, string, string)List of wrongly named disks, each tuple contains disk index, expected and actual name