Commit b1808f46 authored by Thomas Thrainer's avatar Thomas Thrainer
Browse files

Use secondary IP when moving instances



All data traffic usually goes over the secondary network, but
gnt-instance move didn't. This patch corrects this problem by using the
target nodes secondary IP as move target.
Signed-off-by: default avatarThomas Thrainer <thomasth@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
(cherry picked from commit f56ab6d1)
parent 08d58f4c
......@@ -2437,13 +2437,13 @@ def BlockdevGetdimensions(disks):
return result
def BlockdevExport(disk, dest_node, dest_path, cluster_name):
def BlockdevExport(disk, dest_node_ip, dest_path, cluster_name):
"""Export a block device to a remote node.
@type disk: L{objects.Disk}
@param disk: the description of the disk to export
@type dest_node: str
@param dest_node: the destination node to export to
@type dest_node_ip: str
@param dest_node_ip: the destination node IP to export to
@type dest_path: str
@param dest_path: the destination path on the target node
@type cluster_name: str
......@@ -2467,7 +2467,7 @@ def BlockdevExport(disk, dest_node, dest_path, cluster_name):
destcmd = utils.BuildShellCmd("dd of=%s conv=nocreat,notrunc bs=65536"
" oflag=dsync", dest_path)
remotecmd = _GetSshRunner(cluster_name).BuildCmd(dest_node,
remotecmd = _GetSshRunner(cluster_name).BuildCmd(dest_node_ip,
constants.SSH_LOGIN_USER,
destcmd)
......
......@@ -1792,8 +1792,8 @@ class LUInstanceMove(LogicalUnit):
dev_path = result.payload
result = self.rpc.call_blockdev_export(source_node.uuid, (disk,
self.instance),
target_node.name, dev_path,
cluster_name)
target_node.secondary_ip,
dev_path, cluster_name)
if result.fail_msg:
self.LogWarning("Can't copy data over for disk %d: %s",
idx, result.fail_msg)
......
......@@ -428,7 +428,7 @@ _BLOCKDEV_CALLS = [
" given amount"),
("blockdev_export", SINGLE, None, constants.RPC_TMO_1DAY, [
("cf_bdev", ED_SINGLE_DISK_DICT_DP, None),
("dest_node", None, None),
("dest_node_ip", None, None),
("dest_path", None, None),
("cluster_name", None, None),
], None, None, "Export a given disk to another node"),
......
......@@ -393,8 +393,8 @@ class NodeRequestHandler(http.server.HttpServerHandler):
"""
disk = objects.Disk.FromDict(params[0])
dest_node, dest_path, cluster_name = params[1:]
return backend.BlockdevExport(disk, dest_node, dest_path, cluster_name)
dest_node_ip, dest_path, cluster_name = params[1:]
return backend.BlockdevExport(disk, dest_node_ip, dest_path, cluster_name)
@staticmethod
def perspective_blockdev_setinfo(params):
......
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