Refactoring required for blueprint xenapi-live-migration
This refactoring of the libvirt live migration code is required to enable live migration in the xenapi driver. This change ensures libvirt specific checks are performed only when the libvirt driver is enabled. The complication is that some of these checks require information to be passed between the source and destination hosts. For example, when comparing CPU flags. Change-Id: I7389f0b7f03313d7f04b907f481787dadf0716fd
This commit is contained in:
committed by
Gerrit Code Review
parent
a2c05274af
commit
cac332c396
@@ -251,20 +251,6 @@ class ComputeDriver(object):
|
||||
"""Detach the disk attached to the instance"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def compare_cpu(self, cpu_info):
|
||||
"""Compares given cpu info against host
|
||||
|
||||
Before attempting to migrate a VM to this host,
|
||||
compare_cpu is called to ensure that the VM will
|
||||
actually run here.
|
||||
|
||||
:param cpu_info: (str) JSON structure describing the source CPU.
|
||||
:returns: None if migration is acceptable
|
||||
:raises: :py:class:`~nova.exception.InvalidCPUInfo` if migration
|
||||
is not acceptable.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def migrate_disk_and_power_off(self, context, instance, dest,
|
||||
instance_type, network_info):
|
||||
"""
|
||||
@@ -357,27 +343,63 @@ class ComputeDriver(object):
|
||||
:param host: hostname that compute manager is currently running
|
||||
|
||||
"""
|
||||
# TODO(Vek): Need to pass context in for access to auth_token
|
||||
raise NotImplementedError()
|
||||
|
||||
def live_migration(self, ctxt, instance_ref, dest,
|
||||
post_method, recover_method):
|
||||
"""Spawning live_migration operation for distributing high-load.
|
||||
post_method, recover_method, block_migration=False):
|
||||
"""Live migration of an instance to another host.
|
||||
|
||||
:param ctxt: security context
|
||||
:param instance_ref:
|
||||
:params ctxt: security context
|
||||
:params instance_ref:
|
||||
nova.db.sqlalchemy.models.Instance object
|
||||
instance object that is migrated.
|
||||
:param dest: destination host
|
||||
:param post_method:
|
||||
:params dest: destination host
|
||||
:params post_method:
|
||||
post operation method.
|
||||
expected nova.compute.manager.post_live_migration.
|
||||
:param recover_method:
|
||||
:params recover_method:
|
||||
recovery method when any exception occurs.
|
||||
expected nova.compute.manager.recover_live_migration.
|
||||
|
||||
:params block_migration: if true, migrate VM disk.
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def check_can_live_migrate_destination(self, ctxt, instance_ref,
|
||||
block_migration=False,
|
||||
disk_over_commit=False):
|
||||
"""Check if it is possible to execute live migration.
|
||||
|
||||
This runs checks on the destination host, and then calls
|
||||
back to the source host to check the results.
|
||||
|
||||
:param ctxt: security context
|
||||
:param instance_ref: nova.db.sqlalchemy.models.Instance
|
||||
:param dest: destination host
|
||||
:param block_migration: if true, prepare for block migration
|
||||
:param disk_over_commit: if true, allow disk over commit
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def check_can_live_migrate_destination_cleanup(self, ctxt,
|
||||
dest_check_data):
|
||||
"""Do required cleanup on dest host after check_can_live_migrate calls
|
||||
|
||||
:param ctxt: security context
|
||||
:param dest_check_data: result of check_can_live_migrate_destination
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def check_can_live_migrate_source(self, ctxt, instance_ref,
|
||||
dest_check_data):
|
||||
"""Check if it is possible to execute live migration.
|
||||
|
||||
This checks if the live migration can succeed, based on the
|
||||
results from check_can_live_migrate_destination.
|
||||
|
||||
:param context: security context
|
||||
:param instance_ref: nova.db.sqlalchemy.models.Instance
|
||||
:param dest_check_data: result of check_can_live_migrate_destination
|
||||
"""
|
||||
# TODO(Vek): Need to pass context in for access to auth_token
|
||||
raise NotImplementedError()
|
||||
|
||||
def refresh_security_group_rules(self, security_group_id):
|
||||
|
||||
Reference in New Issue
Block a user