Package ganeti :: Package cmdlib :: Module instance_migration :: Class TLMigrateInstance
[hide private]
[frames] | no frames]

Class TLMigrateInstance

source code


Tasklet class for instance migration.

Instance Methods [hide private]
 
__init__(self, lu, instance_uuid, instance_name, cleanup, failover, fallback, ignore_consistency, allow_runtime_changes, shutdown_timeout, ignore_ipolicy, ignore_hvversions)
Initializes this class.
source code
 
CheckPrereq(self)
Check prerequisites.
source code
 
_RunAllocator(self)
Run the allocator based on input opcode.
source code
 
_WaitUntilSync(self)
Poll with custom rpc for disk sync.
source code
 
_OpenInstanceDisks(self, node_uuid, exclusive)
Open instance disks.
source code
 
_CloseInstanceDisks(self, node_uuid)
Close instance disks.
source code
 
_GoStandalone(self)
Disconnect from the network.
source code
 
_GoReconnect(self, multimaster)
Reconnect to the network.
source code
 
_ExecCleanup(self)
Try to cleanup after a failed migration.
source code
 
_RevertDiskStatus(self)
Try to revert the disk status after a failed migration.
source code
 
_AbortMigration(self)
Call the hypervisor code to abort a started migration.
source code
 
_ExecMigration(self)
Migrate an instance.
source code
 
_ExecFailover(self)
Failover an instance.
source code
 
Exec(self, feedback_fn)
Perform the migration.
source code

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

Class Variables [hide private]
  _MIGRATION_POLL_INTERVAL = 1
  _MIGRATION_FEEDBACK_INTERVAL = 10
Instance Variables [hide private]
boolean cleanup
Wheater we cleanup from a failed migration
boolean failover
Whether operation results in failover or migration
boolean fallback
Whether fallback to failover is allowed if migration not possible
string iallocator
The iallocator used to determine target_node
boolean ignore_consistency
Wheter we should ignore consistency between source and target node
bool ignore_hvversions
If true, accept incompatible hypervisor versions
bool ignore_ipolicy
If true, we can ignore instance policy when migrating
boolean live
whether the migration will be done live or non-live; this variable is initalized only after CheckPrereq has run
int shutdown_timeout
In case of failover timeout of the shutdown
string target_node_uuid
If given, the target node UUID to reallocate the instance to
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, lu, instance_uuid, instance_name, cleanup, failover, fallback, ignore_consistency, allow_runtime_changes, shutdown_timeout, ignore_ipolicy, ignore_hvversions)
(Constructor)

source code 

Initializes this class.

Overrides: object.__init__

CheckPrereq(self)

source code 

Check prerequisites.

This checks that the instance is in the cluster.

Overrides: base.Tasklet.CheckPrereq

_WaitUntilSync(self)

source code 

Poll with custom rpc for disk sync.

This uses our own step-based rpc call.

_ExecCleanup(self)

source code 

Try to cleanup after a failed migration.

The cleanup is done by:

  • check that the instance is running only on one node (and update the config if needed)
  • change disks on its secondary node to secondary
  • wait until disks are fully synchronized
  • disconnect from the network
  • change disks into single-master mode
  • wait again until disks are fully synchronized

_ExecMigration(self)

source code 

Migrate an instance.

The migrate is done by:

  • change the disks into dual-master mode
  • wait until disks are fully synchronized again
  • migrate the instance
  • change disks on the new secondary node (the old primary) to secondary
  • wait until disks are fully synchronized
  • change disks into single-master mode

_ExecFailover(self)

source code 

Failover an instance.

The failover is done by shutting it down on its present node and starting it on the secondary.

Exec(self, feedback_fn)

source code 

Perform the migration.

Overrides: base.Tasklet.Exec