Script burnin :: Class Burner
[hide private]
[frames] | no frames]

Class Burner


Burner class.

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

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.
 
StartInstanceOp(instance)
Start given instance.
 
RenameInstanceOp(instance, instance_new)
Rename instance.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

 

Constructor.

Overrides: object.__init__

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

 

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)

 

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)

 

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)

 

Start a new batch of jobs.

Parameters:
  • retry - whether this is a retryable batch

ExecJobSet(self, jobs)

 

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)

 

Parses the command line options.

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

BurnCreateInstances(self)

 

Create the given instances.

Decorators:
  • @_DoCheckInstances
  • @_DoBatch(False)

BurnGrowDisks(self)

 

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

Decorators:
  • @_DoBatch(False)

BurnReplaceDisks1D8(self)

 

Replace disks on primary and secondary for drbd8.

Decorators:
  • @_DoBatch(True)

BurnReplaceDisks2(self)

 

Replace secondary node.

Decorators:
  • @_DoBatch(True)

BurnFailover(self)

 

Failover the instances.

Decorators:
  • @_DoCheckInstances
  • @_DoBatch(False)

BurnMove(self)

 

Move the instances.

Decorators:
  • @_DoCheckInstances
  • @_DoBatch(False)

BurnMigrate(self)

 

Migrate the instances.

Decorators:
  • @_DoBatch(False)

BurnImportExport(self)

 

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

Decorators:
  • @_DoCheckInstances
  • @_DoBatch(False)

BurnStopStart(self)

 

Stop/start the instances.

Decorators:
  • @_DoCheckInstances
  • @_DoBatch(True)

BurnRemove(self)

 

Remove the instances.

Decorators:
  • @_DoBatch(False)

BurnRename(self)

 

Rename the instances.

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

BurnReinstall(self)

 

Reinstall the instances.

Decorators:
  • @_DoCheckInstances
  • @_DoBatch(True)

BurnReboot(self)

 

Reboot the instances.

Decorators:
  • @_DoCheckInstances
  • @_DoBatch(True)

BurnActivateDisks(self)

 

Activate and deactivate disks of the instances.

Decorators:
  • @_DoCheckInstances
  • @_DoBatch(True)

BurnAddRemoveDisks(self)

 

Add and remove an extra disk for the instances.

Decorators:
  • @_DoCheckInstances
  • @_DoBatch(False)

BurnAddRemoveNICs(self)

 

Add and remove an extra NIC for the instances.

Decorators:
  • @_DoBatch(False)

BurnConfd(self)

 

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)

 

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)

 

Test a cluster intensively.

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