Revision 9f0e6b37 lib/backend.py
b/lib/backend.py | ||
---|---|---|
771 | 771 |
def MigrateInstance(instance, target, live): |
772 | 772 |
"""Migrates an instance to another node. |
773 | 773 |
|
774 |
@type instance: C{objects.Instance} |
|
775 |
@param instance: the instance definition |
|
776 |
@type target: string |
|
777 |
@param target: the target node name |
|
778 |
@type live: boolean |
|
779 |
@param live: whether the migration should be done live or not (the |
|
780 |
interpretation of this parameter is left to the hypervisor) |
|
781 |
@rtype: tuple |
|
782 |
@return: a tuple of (success, msg) where: |
|
783 |
- succes is a boolean denoting the success/failure of the operation |
|
784 |
- msg is a string with details in case of failure |
|
785 |
|
|
774 | 786 |
""" |
775 | 787 |
hyper = hypervisor.GetHypervisor(_GetConfig()) |
776 | 788 |
|
777 | 789 |
try: |
778 |
hyper.MigrateInstance(instance, target, live) |
|
790 |
hyper.MigrateInstance(instance.name, target, live)
|
|
779 | 791 |
except errors.HypervisorError, err: |
780 | 792 |
msg = "Failed to migrate instance: %s" % str(err) |
781 | 793 |
logging.error(msg) |
Also available in: Unified diff