Revision 6906a9d8 lib/rpc.py
b/lib/rpc.py | ||
---|---|---|
432 | 432 |
return self._SingleNodeCall(node, "instance_shutdown", |
433 | 433 |
[self._InstDict(instance)]) |
434 | 434 |
|
435 |
def call_migration_info(self, node, instance): |
|
436 |
"""Gather the information necessary to prepare an instance migration. |
|
437 |
|
|
438 |
This is a single-node call. |
|
439 |
|
|
440 |
@type node: string |
|
441 |
@param node: the node on which the instance is currently running |
|
442 |
@type instance: C{objects.Instance} |
|
443 |
@param instance: the instance definition |
|
444 |
|
|
445 |
""" |
|
446 |
return self._SingleNodeCall(node, "migration_info", |
|
447 |
[self._InstDict(instance)]) |
|
448 |
|
|
449 |
def call_accept_instance(self, node, instance, info, target): |
|
450 |
"""Prepare a node to accept an instance. |
|
451 |
|
|
452 |
This is a single-node call. |
|
453 |
|
|
454 |
@type node: string |
|
455 |
@param node: the target node for the migration |
|
456 |
@type instance: C{objects.Instance} |
|
457 |
@param instance: the instance definition |
|
458 |
@type info: opaque/hypervisor specific (string/data) |
|
459 |
@param info: result for the call_migration_info call |
|
460 |
@type target: string |
|
461 |
@param target: target hostname (usually ip address) (on the node itself) |
|
462 |
|
|
463 |
""" |
|
464 |
return self._SingleNodeCall(node, "accept_instance", |
|
465 |
[self._InstDict(instance), info, target]) |
|
466 |
|
|
467 |
def call_finalize_migration(self, node, instance, info, success): |
|
468 |
"""Finalize any target-node migration specific operation. |
|
469 |
|
|
470 |
This is called both in case of a successful migration and in case of error |
|
471 |
(in which case it should abort the migration). |
|
472 |
|
|
473 |
This is a single-node call. |
|
474 |
|
|
475 |
@type node: string |
|
476 |
@param node: the target node for the migration |
|
477 |
@type instance: C{objects.Instance} |
|
478 |
@param instance: the instance definition |
|
479 |
@type info: opaque/hypervisor specific (string/data) |
|
480 |
@param info: result for the call_migration_info call |
|
481 |
@type success: boolean |
|
482 |
@param success: whether the migration was a success or a failure |
|
483 |
|
|
484 |
""" |
|
485 |
return self._SingleNodeCall(node, "finalize_migration", |
|
486 |
[self._InstDict(instance), info, success]) |
|
487 |
|
|
435 | 488 |
def call_instance_migrate(self, node, instance, target, live): |
436 | 489 |
"""Migrate an instance. |
437 | 490 |
|
Also available in: Unified diff