Commit dc700f75 authored by Daniel Krambrock's avatar Daniel Krambrock Committed by Guido Trotter
Browse files

rapi client: add target_node to migrate instance



This allows migrating to any node, as it is already possible for
failover, when instances are externally mirrored.
Signed-off-by: default avatarDaniel Krambrock <danielk_lists@z9d.de>
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent d8f0b7c1
......@@ -1193,7 +1193,8 @@ class GanetiRapiClient(object): # pylint: disable=R0904
("/%s/instances/%s/export" %
(GANETI_RAPI_VERSION, instance)), None, body)
def MigrateInstance(self, instance, mode=None, cleanup=None):
def MigrateInstance(self, instance, mode=None, cleanup=None,
target_node=None):
"""Migrates an instance.
@type instance: string
......@@ -1202,6 +1203,8 @@ class GanetiRapiClient(object): # pylint: disable=R0904
@param mode: Migration mode
@type cleanup: bool
@param cleanup: Whether to clean up a previously failed migration
@type target_node: string
@param target_node: Target Node for externally mirrored instances
@rtype: string
@return: job id
......@@ -1209,6 +1212,7 @@ class GanetiRapiClient(object): # pylint: disable=R0904
body = {}
_SetItemIf(body, mode is not None, "mode", mode)
_SetItemIf(body, cleanup is not None, "cleanup", cleanup)
_SetItemIf(body, target_node is not None, "target_node", target_node)
return self._SendRequest(HTTP_PUT,
("/%s/instances/%s/migrate" %
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment