class documentation

class TLMigrateInstance(Tasklet):

View In Hierarchy

Tasklet class for instance migration.

Method __init__ Initializes this class.
Method CheckPrereq Check prerequisites.
Method Exec Perform the migration.
Instance Variable all_node_uuids Undocumented
Instance Variable allow_runtime_changes Undocumented
Instance Variable cleanup Wheater we cleanup from a failed migration
Instance Variable current_mem Undocumented
Instance Variable failover Whether operation results in failover or migration
Instance Variable fallback Whether fallback to failover is allowed if migration not possible
Instance Variable feedback_fn Undocumented
Instance Variable iallocator The iallocator used to determine target_node
Instance Variable ignore_consistency Wheter we should ignore consistency between source and target node
Instance Variable ignore_hvversions If true, accept incompatible hypervisor versions
Instance Variable ignore_ipolicy If true, we can ignore instance policy when migrating
Instance Variable instance Undocumented
Instance Variable instance_name Undocumented
Instance Variable instance_uuid Undocumented
Instance Variable live whether the migration will be done live or non-live; this variable is initalized only after CheckPrereq has run
Instance Variable migration_info Undocumented
Instance Variable nodes_ip Undocumented
Instance Variable shutdown_timeout In case of failover timeout of the shutdown
Instance Variable source_node_uuid Undocumented
Instance Variable target_node_uuid If given, the target node UUID to reallocate the instance to
Instance Variable tgt_free_mem Undocumented
Method _AbortMigration Call the hypervisor code to abort a started migration.
Method _CloseInstanceDisks Close instance disks.
Method _ExecCleanup Try to cleanup after a failed migration.
Method _ExecFailover Failover an instance.
Method _ExecMigration Migrate an instance.
Method _FindInstanceLocations Returns a list of nodes that have the given instance running
Method _GoReconnect Reconnect to the network.
Method _GoStandalone Disconnect from the network.
Method _OpenInstanceDisks Open instance disks.
Method _RevertDiskStatus Try to revert the disk status after a failed migration.
Method _RunAllocator Run the allocator based on input opcode.
Method _WaitUntilSync Poll with custom rpc for disk sync.
Constant _MIGRATION_FEEDBACK_INTERVAL Undocumented
Constant _MIGRATION_POLL_INTERVAL Undocumented

Inherited from Tasklet:

Instance Variable cfg Undocumented
Instance Variable lu Undocumented
Instance Variable rpc Undocumented
def __init__(self, lu, instance_uuid, instance_name, cleanup, failover, fallback, ignore_consistency, allow_runtime_changes, shutdown_timeout, ignore_ipolicy, ignore_hvversions):

Initializes this class.

def CheckPrereq(self):

Check prerequisites.

This checks that the instance is in the cluster.

def Exec(self, feedback_fn):

Perform the migration.

all_node_uuids =

Undocumented

allow_runtime_changes =

Undocumented

cleanup: boolean =

Wheater we cleanup from a failed migration

current_mem =

Undocumented

failover: boolean =

Whether operation results in failover or migration

fallback: boolean =

Whether fallback to failover is allowed if migration not possible

feedback_fn =

Undocumented

iallocator: string =

The iallocator used to determine target_node

ignore_consistency: boolean =

Wheter we should ignore consistency between source and target node

ignore_hvversions: bool =

If true, accept incompatible hypervisor versions

ignore_ipolicy: bool =

If true, we can ignore instance policy when migrating

instance =

Undocumented

instance_name =

Undocumented

instance_uuid =

Undocumented

live: boolean =

whether the migration will be done live or non-live; this variable is initalized only after CheckPrereq has run

migration_info =

Undocumented

nodes_ip =

Undocumented

shutdown_timeout: int =

In case of failover timeout of the shutdown

source_node_uuid =

Undocumented

target_node_uuid: string =

If given, the target node UUID to reallocate the instance to

tgt_free_mem =

Undocumented

def _AbortMigration(self):

Call the hypervisor code to abort a started migration.

Returns
tuple of rpc call results
def _CloseInstanceDisks(self, node_uuid):

Close instance disks.

def _ExecCleanup(self):

Try to cleanup after a failed migration.

The cleanup is done by:

  • check that the instance is running only on one node
  • try 'aborting' migration if it is running on two nodes
  • 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
def _ExecFailover(self):

Failover an instance.

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

def _ExecMigration(self):

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
def _FindInstanceLocations(self, name):

Returns a list of nodes that have the given instance running

Parameters
name:stringinstance name string to search for
Returns
list of strings, node uuids
def _GoReconnect(self, multimaster):

Reconnect to the network.

def _GoStandalone(self):

Disconnect from the network.

def _OpenInstanceDisks(self, node_uuid, exclusive):

Open instance disks.

def _RevertDiskStatus(self):

Try to revert the disk status after a failed migration.

def _RunAllocator(self):

Run the allocator based on input opcode.

def _WaitUntilSync(self):

Poll with custom rpc for disk sync.

This uses our own step-based rpc call.

_MIGRATION_FEEDBACK_INTERVAL: int =

Undocumented

Value
10
_MIGRATION_POLL_INTERVAL: int =

Undocumented

Value
1