raise errors.BlockDeviceError("Cannot create block device symlink: %s" %
e.strerror)
- block_devices.append((disk, link_name))
+ block_devices.append((disk, link_name, device))
return block_devices
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
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)
result["DISK_%d_BACKEND_TYPE" % idx] = "block"
elif disk.dev_type in [constants.DT_FILE, constants.DT_SHARED_FILE]:
result["DISK_%d_BACKEND_TYPE" % idx] = \
- "file:%s" % disk.physical_id[0]
+ "file:%s" % disk.logical_id[0]
# NICs
for idx, nic in enumerate(instance.nics):
config.set(constants.INISECT_INS, "disk%d_ivname" % disk_count,
("%s" % disk.iv_name))
config.set(constants.INISECT_INS, "disk%d_dump" % disk_count,
- ("%s" % disk.physical_id[1]))
+ ("%s" % disk.logical_id[1]))
config.set(constants.INISECT_INS, "disk%d_size" % disk_count,
("%d" % disk.size))
"""Rename a list of block devices.
@type devlist: list of tuples
- @param devlist: list of tuples of the form (disk,
- new_logical_id, new_physical_id); disk is an
- L{objects.Disk} object describing the current disk,
- and new logical_id/physical_id is the name we
- rename it to
+ @param devlist: list of tuples of the form (disk, new_unique_id); disk is
+ an L{objects.Disk} object describing the current disk, and new
+ unique_id is the name we rename it to
@rtype: boolean
@return: True if all renames succeeded, False otherwise