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

Class TLMigrateInstance

source code


Tasklet class for instance migration.

Instance Methods [hide private]
 
__init__(self, lu, instance_name, cleanup=False, failover=False, fallback=False, ignore_consistency=False, shutdown_timeout=constants.DEFAULT_SHUTDOWN_TIMEOUT)
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
 
_EnsureSecondary(self, node)
Demote a node to secondary.
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
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
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
If given, the target_node to reallocate the instance to
Method Details [hide private]

__init__(self, lu, instance_name, cleanup=False, failover=False, fallback=False, ignore_consistency=False, shutdown_timeout=constants.DEFAULT_SHUTDOWN_TIMEOUT)
(Constructor)

source code 

Initializes this class.

Overrides: Tasklet.__init__

CheckPrereq(self)

source code 

Check prerequisites.

This checks that the instance is in the cluster.

Overrides: 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: Tasklet.Exec