Package ganeti :: Package tools :: Module burnin :: Class Burner
[hide private]
[frames] | no frames]

Class Burner

source code


Burner class.

Instance Methods [hide private]
 
__init__(self)
Constructor.
source code
 
ClearFeedbackBuf(self)
Clear the feedback buffer.
source code
 
GetFeedbackBuf(self)
Return the contents of the buffer.
source code
 
Feedback(self, msg)
Acumulate feedback in our buffer.
source code
 
MaybeRetry(self, retry_count, msg, fn, *args)
Possibly retry a given function execution.
source code
 
_ExecOp(self, *ops)
Execute one or more opcodes and manage the exec buffer.
source code
 
ExecOp(self, retry, *ops)
Execute one or more opcodes and manage the exec buffer.
source code
 
ExecOrQueue(self, name, ops, post_process=None)
Execute an opcode and manage the exec buffer.
source code
 
StartBatch(self, retry)
Start a new batch of jobs.
source code
 
CommitQueue(self)
Execute all submitted opcodes in case of parallel burnin
source code
 
ExecJobSet(self, jobs)
Execute a set of jobs and return once all are done.
source code
 
ParseOptions(self)
Parses the command line options.
source code
 
GetState(self)
Read the cluster state from the master daemon.
source code
 
BurnCreateInstances(self)
Create the given instances.
source code
 
BurnModifyRuntimeMemory(self)
Alter the runtime memory.
source code
 
BurnGrowDisks(self)
Grow both the os and the swap disks by the requested amount, if any.
source code
 
BurnReplaceDisks1D8(self)
Replace disks on primary and secondary for drbd8.
source code
 
BurnReplaceDisks2(self)
Replace secondary node.
source code
 
BurnFailover(self)
Failover the instances.
source code
 
BurnMove(self)
Move the instances.
source code
 
BurnMigrate(self)
Migrate the instances.
source code
 
BurnImportExport(self)
Export the instance, delete it, and import it back.
source code
 
BurnStopStart(self)
Stop/start the instances.
source code
 
BurnRemove(self)
Remove the instances.
source code
 
BurnRename(self)
Rename the instances.
source code
 
BurnReinstall(self)
Reinstall the instances.
source code
 
BurnReboot(self)
Reboot the instances.
source code
 
BurnRenameSame(self)
Rename the instances to their own name.
source code
 
BurnActivateDisks(self)
Activate and deactivate disks of the instances.
source code
 
BurnAddRemoveDisks(self)
Add and remove an extra disk for the instances.
source code
 
BurnAddRemoveNICs(self)
Add, change and remove an extra NIC for the instances.
source code
 
ConfdCallback(self, reply)
Callback for confd queries
source code
 
DoConfdRequestReply(self, req) source code
 
BurnConfd(self)
Run confd queries for our instances.
source code
 
_CheckInstanceAlive(self, instance)
Check if an instance is alive by doing http checks.
source code
 
BurninCluster(self)
Test a cluster intensively.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
StopInstanceOp(instance)
Stop given instance.
source code
 
StartInstanceOp(instance)
Start given instance.
source code
 
RenameInstanceOp(instance, instance_new)
Rename instance.
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Constructor.

Overrides: object.__init__

MaybeRetry(self, retry_count, msg, fn, *args)

source code 

Possibly retry a given function execution.

Parameters:
  • retry_count (int) - retry counter:
    • 0: non-retryable action
    • 1: last retry for a retryable action
    • MAX_RETRIES: original try for a retryable action
  • msg (str) - the kind of the operation
  • fn (callable) - the function to be called

_ExecOp(self, *ops)

source code 

Execute one or more opcodes and manage the exec buffer.

Returns:
if only opcode has been passed, we return its result; otherwise we return the list of results

ExecOp(self, retry, *ops)

source code 

Execute one or more opcodes and manage the exec buffer.

Returns:
if only opcode has been passed, we return its result; otherwise we return the list of results

StartBatch(self, retry)

source code 

Start a new batch of jobs.

Parameters:
  • retry - whether this is a retryable batch

ExecJobSet(self, jobs)

source code 

Execute a set of jobs and return once all are done.

The method will return the list of results, if all jobs are successful. Otherwise, OpExecError will be raised from within cli.py.

ParseOptions(self)

source code 

Parses the command line options.

In case of command line errors, it will show the usage and exit the program.

BurnCreateInstances(self)

source code 

Create the given instances.

Decorators:
  • @_DoCheckInstances
  • @_DoBatch(False)

BurnModifyRuntimeMemory(self)

source code 

Alter the runtime memory.

Decorators:
  • @_DoBatch(False)

BurnGrowDisks(self)

source code 

Grow both the os and the swap disks by the requested amount, if any.

Decorators:
  • @_DoBatch(False)

BurnReplaceDisks1D8(self)

source code 

Replace disks on primary and secondary for drbd8.

Decorators:
  • @_DoBatch(True)

BurnReplaceDisks2(self)

source code 

Replace secondary node.

Decorators:
  • @_DoBatch(True)

BurnFailover(self)

source code 

Failover the instances.

Decorators:
  • @_DoCheckInstances
  • @_DoBatch(False)

BurnMove(self)

source code 

Move the instances.

Decorators:
  • @_DoCheckInstances
  • @_DoBatch(False)

BurnMigrate(self)

source code 

Migrate the instances.

Decorators:
  • @_DoBatch(False)

BurnImportExport(self)

source code 

Export the instance, delete it, and import it back.

Decorators:
  • @_DoCheckInstances
  • @_DoBatch(False)

BurnStopStart(self)

source code 

Stop/start the instances.

Decorators:
  • @_DoCheckInstances
  • @_DoBatch(True)

BurnRemove(self)

source code 

Remove the instances.

Decorators:
  • @_DoBatch(False)

BurnRename(self)

source code 

Rename the instances.

Note that this function will not execute in parallel, since we only have one target for rename.

BurnReinstall(self)

source code 

Reinstall the instances.

Decorators:
  • @_DoCheckInstances
  • @_DoBatch(True)

BurnReboot(self)

source code 

Reboot the instances.

Decorators:
  • @_DoCheckInstances
  • @_DoBatch(True)

BurnRenameSame(self)

source code 

Rename the instances to their own name.

Decorators:
  • @_DoCheckInstances
  • @_DoBatch(True)

BurnActivateDisks(self)

source code 

Activate and deactivate disks of the instances.

Decorators:
  • @_DoCheckInstances
  • @_DoBatch(True)

BurnAddRemoveDisks(self)

source code 

Add and remove an extra disk for the instances.

Decorators:
  • @_DoCheckInstances
  • @_DoBatch(False)

BurnAddRemoveNICs(self)

source code 

Add, change and remove an extra NIC for the instances.

Decorators:
  • @_DoBatch(False)

BurnConfd(self)

source code 

Run confd queries for our instances.

The following confd queries are tested:

  • CONFD_REQ_PING: simple ping
  • CONFD_REQ_CLUSTER_MASTER: cluster master
  • CONFD_REQ_NODE_ROLE_BYNAME: node role, for the master

_CheckInstanceAlive(self, instance)

source code 

Check if an instance is alive by doing http checks.

This will try to retrieve the url on the instance /hostname.txt and check that it contains the hostname of the instance. In case we get ECONNREFUSED, we retry up to the net timeout seconds, for any other error we abort.

BurninCluster(self)

source code 

Test a cluster intensively.

This will create instances and then start/stop/failover them. It is safe for existing instances but could impact performance.