Revision cd42d0ad lib/backend.py
b/lib/backend.py | ||
---|---|---|
980 | 980 |
@param instance: the instance definition |
981 | 981 |
|
982 | 982 |
""" |
983 |
return (True, '') |
|
983 |
hyper = hypervisor.GetHypervisor(instance.hypervisor) |
|
984 |
try: |
|
985 |
info = hyper.MigrationInfo(instance) |
|
986 |
except errors.HypervisorError, err: |
|
987 |
msg = "Failed to fetch migration information" |
|
988 |
logging.exception(msg) |
|
989 |
return (False, '%s: %s' % (msg, err)) |
|
990 |
return (True, info) |
|
984 | 991 |
|
985 | 992 |
|
986 | 993 |
def AcceptInstance(instance, info, target): |
... | ... | |
994 | 1001 |
@param target: target host (usually ip), on this node |
995 | 1002 |
|
996 | 1003 |
""" |
1004 |
hyper = hypervisor.GetHypervisor(instance.hypervisor) |
|
1005 |
try: |
|
1006 |
hyper.AcceptInstance(instance, info, target) |
|
1007 |
except errors.HypervisorError, err: |
|
1008 |
msg = "Failed to accept instance" |
|
1009 |
logging.exception(msg) |
|
1010 |
return (False, '%s: %s' % (msg, err)) |
|
997 | 1011 |
return (True, "Accept successfull") |
998 | 1012 |
|
999 | 1013 |
|
... | ... | |
1008 | 1022 |
@param success: whether the migration was a success or a failure |
1009 | 1023 |
|
1010 | 1024 |
""" |
1025 |
hyper = hypervisor.GetHypervisor(instance.hypervisor) |
|
1026 |
try: |
|
1027 |
hyper.FinalizeMigration(instance, info, success) |
|
1028 |
except errors.HypervisorError, err: |
|
1029 |
msg = "Failed to finalize migration" |
|
1030 |
logging.exception(msg) |
|
1031 |
return (False, '%s: %s' % (msg, err)) |
|
1011 | 1032 |
return (True, "Migration Finalized") |
1012 | 1033 |
|
1013 | 1034 |
|
Also available in: Unified diff