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)
Initializes this class.
source code
 
CheckPrereq(self)
Check prerequisites.
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
 
Exec(self, feedback_fn)
Perform the migration.
source code
Instance Variables [hide private]
boolean live
whether the migration will be done live or non-live; this variable is initalized only after CheckPrereq has run
Method Details [hide private]

__init__(self, lu, instance_name, cleanup)
(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

Exec(self, feedback_fn)

source code 

Perform the migration.

Overrides: Tasklet.Exec