设置 Azure 导入/导出工具Setting up the Azure Import/Export Tool

Azure 导入/导出工具是可与 Azure 导入/导出服务一起使用的驱动器准备和修复工具。The Azure Import/Export Tool is the drive preparation and repair tool that you can use with the Azure Import/Export service. 可以使用该工具实现以下功能:You can use the tool for the following functions:

  • 在创建导入作业之前,可以使用此工具将数据复制到要寄送给 Azure 数据中心的硬盘驱动器。Before creating an import job, you can use this tool to copy data to the hard drives you are going to ship to an Azure data center.
  • 完成某个导入作业后,可以使用此工具修复已损坏、丢失或与其他 Blob 冲突的任何 Blob。After an import job has completed, you can use this tool to repair any blobs that were corrupted, were missing, or conflicted with other blobs.
  • 通过某个已完成的导出作业收到驱动器后,可以使用此工具修复这些驱动器上已损坏或丢失的任何文件。After you receive the drives from a completed export job, you can use this tool to repair any files that were corrupted or missing on the drives.

先决条件Prerequisites

若要为导入作业准备驱动器,必须满足以下先决条件:If you are preparing drives for an import job, the following prerequisites must be met:

  • 必须拥有一个有效的 Azure 订阅。You must have an active Azure subscription.
  • 该订阅必须包含一个存储帐户,其中有足够的可用空间可存储所要导入的文件。Your subscription must include a storage account with enough available space to store the files you are going to import.
  • 至少必须有一个存储帐户访问密钥。You need at least one of the storage account access keys.
  • 需要准备一台装有 Windows 7、Windows Server 2008 R2 或更高版本的 Windows 操作系统的计算机(“复制计算机”)。You need a computer (the "copy machine") with Windows 7, Windows Server 2008 R2, or a newer Windows operating system installed.
  • 必须在复制计算机上安装 .NET Framework 4。The .NET Framework 4 must be installed on the copy machine.
  • 必须在复制计算机上启用 BitLocker。BitLocker must be enabled on the copy machine.
  • 需要一个或多个已连接到复制计算机的空 2.5 英寸或 3.5 英寸 SATA II、III 或 SSD 硬盘。You need one or more empty 2.5-inch or 3.5-inch SATAII or III or SSD hard drives connected to the copy machine.
  • 打算导入的文件必须可从复制计算机访问,无论这些文件是位于网络共享还是本地硬盘驱动器上。The files you plan to import must be accessible from the copy machine, whether they are on a network share or a local hard drive.

若要尝试修复部分失败的导入,需要:If you are attempting to repair an import that has partially failed, you need:

  • 复制日志文件The copy log files
  • 存储帐户密钥The storage account key

若要尝试修复部分失败的导出,需要:If you are attempting to repair an export that has partially failed, you need:

  • 复制日志文件The copy log files
  • 清单文件(可选)The manifest files (optional)
  • 存储帐户密钥The storage account key

安装 Azure 导入/导出工具Installing the Azure Import/Export Tool

首先,下载 Azure 导入/导出工具,并将其提取到计算机上的某个目录,如 c:\WAImportExportFirst, download the Azure Import/Export Tool and extract it to a directory on your computer, for example c:\WAImportExport.

Azure 导入/导出工具由以下文件组成:The Azure Import/Export Tool consists of the following files:

  • dataset.csvdataset.csv
  • driveset.csvdriveset.csv
  • hddid.dllhddid.dll
  • Microsoft.Data.Services.Client.dllMicrosoft.Data.Services.Client.dll
  • Microsoft.WindowsAzure.Storage.dllMicrosoft.WindowsAzure.Storage.dll
  • Microsoft.WindowsAzure.Storage.pdbMicrosoft.WindowsAzure.Storage.pdb
  • Microsoft.WindowsAzure.Storage.xmlMicrosoft.WindowsAzure.Storage.xml
  • WAImportExport.exeWAImportExport.exe
  • WAImportExport.exe.configWAImportExport.exe.config
  • WAImportExport.pdbWAImportExport.pdb
  • WAImportExportCore.dllWAImportExportCore.dll
  • WAImportExportCore.pdbWAImportExportCore.pdb
  • WAImportExportRepair.dllWAImportExportRepair.dll
  • WAImportExportRepair.pdbWAImportExportRepair.pdb

接下来,以管理员模式打开命令提示窗口,并将目录切换到包含解压缩文件的目录。Next, open a Command Prompt window in Administrator mode, and change into the directory containing the extracted files.

若要输出命令帮助,请不带参数运行此工具 (WAImportExport.exe):To output help for the command, run the tool (WAImportExport.exe) without parameters:

WAImportExport, a client tool for Windows Azure Import/Export Service. Microsoft (c) 2013


Copy directories and/or files with a new copy session:
    WAImportExport.exe PrepImport /j:<JournalFile> /id:<SessionId> [/logdir:<LogDirectory>]
        [/sk:<StorageAccountKey>] [/silentmode] [/InitialDriveSet:<driveset.csv>]
        DataSet:<dataset.csv>

Add more drives:
    WAImportExport.exe PrepImport /j:<JournalFile> /id:<SessionId> /AdditionalDriveSet:<driveset.csv>

Abort an interrupted copy session:
    WAImportExport.exe PrepImport /j:<JournalFile> /id:<SessionId> /AbortSession

Resume an interrupted copy session:
    WAImportExport.exe PrepImport /j:<JournalFile> /id:<SessionId> /ResumeSession

List drives:
    WAImportExport.exe PrepImport /j:<JournalFile> /ListDrives

List copy sessions:
    WAImportExport.exe PrepImport /j:<JournalFile> /ListCopySessions

Repair a Drive:
    WAImportExport.exe RepairImport | RepairExport
        /r:<RepairFile> [/logdir:<LogDirectory>]
        [/d:<TargetDirectories>] [/bk:<BitLockerKey>]
        /sn:<StorageAccountName> /sk:<StorageAccountKey>
        [/CopyLogFile:<DriveCopyLogFile>] [/ManifestFile:<DriveManifestFile>]
        [/PathMapFile:<DrivePathMapFile>]

Preview an Export Job:
    WAImportExport.exe PreviewExport
        [/logdir:<LogDirectory>]
        /sn:<StorageAccountName> /sk:<StorageAccountKey>
        /ExportBlobListFile:<ExportBlobListFile> /DriveSize:<DriveSize>

Parameters:

    /j:<JournalFile>
        - Required. Path to the journal file. A journal file tracks a set of drives and
          records the progress in preparing these drives. The journal file must always
          be specified.
    /logdir:<LogDirectory>
        - Optional. The log directory. Verbose log files as well as some temporary
          files will be written to this directory. If not specified, current directory
          will be used as the log directory. The log directory can be specified only
          once for the same journal file.
    /id:<SessionId>
        - Optional. The session Id is used to identify a copy session. It is used to
          ensure accurate recovery of an interrupted copy session.
    /ResumeSession
        - Optional. If the last copy session was terminated abnormally, this parameter
          can be specified to resume the session.
    /AbortSession
        - Optional. If the last copy session was terminated abnormally, this parameter
          can be specified to abort the session.
    /sn:<StorageAccountName>
        - Required. Only applicable for RepairImport and RepairExport. The name of
          the storage account.
    /sk:<StorageAccountKey>
        - Required. The key of the storage account.
    /InitialDriveSet:<driveset.csv>
        - Required. A .csv file that contains a list of drives to prepare.
    /AdditionalDriveSet:<driveset.csv>
        - Required. A .csv file that contains a list of additional drives to be added.
    /r:<RepairFile>
        - Required. Only applicable for RepairImport and RepairExport.
          Path to the file for tracking repair progress. Each drive must have one
          and only one repair file.
    /d:<TargetDirectories>
        - Required. Only applicable for RepairImport and RepairExport.
          For RepairImport, one or more semicolon-separated directories to repair;
          For RepairExport, one directory to repair, e.g. root directory of the drive.
    /CopyLogFile:<DriveCopyLogFile>
        - Required. Only applicable for RepairImport and RepairExport. Path to the
          drive copy log file (verbose or error).
    /ManifestFile:<DriveManifestFile>
        - Required. Only applicable for RepairExport. Path to the drive manifest file.
    /PathMapFile:<DrivePathMapFile>
        - Optional. Only applicable for RepairImport. Path to the file containing
          mappings of file paths relative to the drive root to locations of actual files
          (tab-delimited). When first specified, it will be populated with file paths
          with empty targets, which means either they are not found in TargetDirectories,
          access denied, with invalid name, or they exist in multiple directories. The
          path map file can be manually edited to include the correct target paths and
          specified again for the tool to resolve the file paths correctly.
    /ExportBlobListFile:<ExportBlobListFile>
        - Required. Path to the XML file containing list of blob paths or blob path
          prefixes for the blobs to be exported. The file format is the same as the
          blob list blob format in the Put Job operation of the Import/Export Service
          REST API.
    /DriveSize:<DriveSize>
        - Required. Size of drives to be used for export. For example, 500GB, 1.5TB.
          Note: 1 GB = 1,000,000,000 bytes
                1 TB = 1,000,000,000,000 bytes
    /DataSet:<dataset.csv>
        - Required. A .csv file that contains a list of directories and/or a list files
          to be copied to target drives.

    /silentmode
        - Optional. If not specified, it will remind you the requirement of drives and
          need your confirmation to continue.

Examples:

    Copy a data set to a drive:
    WAImportExport.exe PrepImport
        /j:9WM35C2V.jrn /id:session#1 /sk:VkGbrUqBWLYJ6zg1m29VOTrxpBgdNOlp+kp0C9MEdx3GEL
        xmBw4hK94f7KysbbeKLDksg7VoN1W/a5UuM2zNgQ== /InitialDriveSet:driveset1.csv
        /DataSet:data.csv

    Copy another dataset to the same drive following the above command:
    WAImportExport.exe PrepImport /j:9WM35C2V.jrn /id:session#2 /DataSet:dataset2.csv

    Preview how many 1.5 TB drives are needed for an export job:
    WAImportExport.exe PreviewExport
        /sn:mytestaccount /sk:VkGbrUqBWLYJ6zg1m29VOTrxpBgdNOlp+kp0C9MEdx3GELxmBw4hK94f7K
        ysbbeKLDksg7VoN1W/a5UuM2zNgQ== /ExportBlobListFile:C:\temp\myexportbloblist.xml
        /DriveSize:1.5TB

    Repair an finished import job:
    WAImportExport.exe RepairImport
        /r:9WM35C2V.rep /d:X:\ /bk:442926-020713-108086-436744-137335-435358-242242-2795
        98 /sn:mytestaccount /sk:VkGbrUqBWLYJ6zg1m29VOTrxpBgdNOlp+kp0C9MEdx3GELxmBw4hK94
        f7KysbbeKLDksg7VoN1W/a5UuM2zNgQ== /CopyLogFile:C:\temp\9WM35C2V_error.log

后续步骤Next steps

[Troubleshooting the Azure Import/Export Tool](storage-import-export-tool-troubleshooting-v1.md)