Package ganeti :: Package masterd :: Module instance
[hide private]
[frames] | no frames]

Module instance

source code

Instance-related functions and classes for masterd.

Classes [hide private]
  _ImportExportError
Local exception to report import/export errors.
  ImportExportTimeouts
  ImportExportCbBase
Callbacks for disk import/export.
  _DiskImportExportBase
  DiskImport
  DiskExport
  ImportExportLoop
  _TransferInstCbBase
  _TransferInstSourceCb
  _TransferInstDestCb
  DiskTransfer
  _DiskTransferPrivate
  _RemoteExportCb
  ExportInstanceHelper
  _RemoteImportCb
Functions [hide private]
 
FormatProgress(progress)
Formats progress information for user consumption
source code
 
_GetInstDiskMagic(base, instance_name, index)
Computes the magic value for a disk export or import.
source code
list
TransferInstanceData(lu, feedback_fn, src_node_uuid, dest_node_uuid, dest_ip, compress, instance, all_transfers)
Transfers an instance's data from one node to another.
source code
 
RemoteImport(lu, feedback_fn, instance, pnode, source_x509_ca, cds, compress, timeouts)
Imports an instance from another cluster.
source code
 
_GetImportExportHandshakeMessage(version)
Returns the handshake message for a RIE protocol version.
source code
 
ComputeRemoteExportHandshake(cds)
Computes the remote import/export handshake.
source code
 
CheckRemoteExportHandshake(cds, handshake)
Checks the handshake of a remote import/export.
source code
 
_GetRieDiskInfoMessage(disk_index, host, port, magic)
Returns the hashed text for import/export disk information.
source code
 
CheckRemoteExportDiskInfo(cds, disk_index, disk_info)
Verifies received disk information for an export.
source code
 
ComputeRemoteImportDiskInfo(cds, salt, disk_index, host, port, magic)
Computes the signed disk information for a remote import.
source code
 
CalculateGroupIPolicy(cluster, group)
Calculate instance policy for group.
source code
 
ComputeDiskSize(disks)
Compute disk size requirements according to disk template
source code

Imports: logging, time, OpenSSL, constants, errors, compat, utils, objects, netutils, pathutils


Function Details [hide private]

_GetInstDiskMagic(base, instance_name, index)

source code 

Computes the magic value for a disk export or import.

Parameters:
  • base (string) - Random seed value (can be the same for all disks of a transfer)
  • instance_name (string) - Name of instance
  • index (number) - Disk index

TransferInstanceData(lu, feedback_fn, src_node_uuid, dest_node_uuid, dest_ip, compress, instance, all_transfers)

source code 

Transfers an instance's data from one node to another.

Parameters:
  • lu - Logical unit instance
  • feedback_fn - Feedback function
  • src_node_uuid (string) - Source node UUID
  • dest_node_uuid (string) - Destination node UUID
  • dest_ip (string) - IP address of destination node
  • compress (string) - Compression tool to use
  • instance (objects.Instance) - Instance object
  • all_transfers (list of DiskTransfer instances) - List of all disk transfers to be made
Returns: list
List with a boolean (True=successful, False=failed) for success for each transfer

RemoteImport(lu, feedback_fn, instance, pnode, source_x509_ca, cds, compress, timeouts)

source code 

Imports an instance from another cluster.

Parameters:
  • lu - Logical unit instance
  • feedback_fn - Feedback function
  • instance (objects.Instance) - Instance object
  • pnode (objects.Node) - Primary node of instance as an object
  • source_x509_ca (OpenSSL.crypto.X509) - Import source's X509 CA
  • cds (string) - Cluster domain secret
  • compress (string) - Compression tool to use
  • timeouts (ImportExportTimeouts) - Timeouts for this import

_GetImportExportHandshakeMessage(version)

source code 

Returns the handshake message for a RIE protocol version.

Parameters:
  • version (number)

ComputeRemoteExportHandshake(cds)

source code 

Computes the remote import/export handshake.

Parameters:
  • cds (string) - Cluster domain secret

CheckRemoteExportHandshake(cds, handshake)

source code 

Checks the handshake of a remote import/export.

Parameters:
  • cds (string) - Cluster domain secret
  • handshake (sequence) - Handshake sent by remote peer

_GetRieDiskInfoMessage(disk_index, host, port, magic)

source code 

Returns the hashed text for import/export disk information.

Parameters:
  • disk_index (number) - Index of disk (included in hash)
  • host (string) - Hostname
  • port (number) - Daemon port
  • magic (string) - Magic value

CheckRemoteExportDiskInfo(cds, disk_index, disk_info)

source code 

Verifies received disk information for an export.

Parameters:
  • cds (string) - Cluster domain secret
  • disk_index (number) - Index of disk (included in hash)
  • disk_info (sequence) - Disk information sent by remote peer

ComputeRemoteImportDiskInfo(cds, salt, disk_index, host, port, magic)

source code 

Computes the signed disk information for a remote import.

Parameters:
  • cds (string) - Cluster domain secret
  • salt (string) - HMAC salt
  • disk_index (number) - Index of disk (included in hash)
  • host (string) - Hostname
  • port (number) - Daemon port
  • magic (string) - Magic value