为导入作业准备硬盘驱动器的示例工作流Sample workflow to prepare hard drives for an import job

本主题讲解如何完成为导入作业准备驱动器的整个过程。This topic walks you through the complete process of preparing drives for an import job.

本示例将以下数据导入到名为 mystorageaccount 的 Azure 存储帐户:This example imports the following data into a Azure storage account named mystorageaccount:

位置Location 说明Description
H:\VideoH:\Video 视频集合,总共 5 TB。A collection of videos, 5 TB in total.
H:\PhotoH:\Photo 照片集合,总共 30 GB。A collection of photos, 30 GB in total.
K:\Temp\FavoriteMovie.ISOK:\Temp\FavoriteMovie.ISO Blu-Ray™ 磁盘映像,25 GB。A Blu-Ray™ disk image, 25 GB.
\\bigshare\john\music\\bigshare\john\music 网络共享上的音乐文件集合,总共 10 GB。A collection of music files on a network share, 10 GB in total.

导入作业将这些数据导入到存储帐户中的以下目标:The import job imports this data into the following destinations in the storage account:

SourceSource 目标虚拟目录或 BlobDestination virtual directory or blob
H:\VideoH:\Video https://mystorageaccount.blob.core.chinacloudapi.cn/videohttps://mystorageaccount.blob.core.chinacloudapi.cn/video
H:\PhotoH:\Photo https://mystorageaccount.blob.core.chinacloudapi.cn/photohttps://mystorageaccount.blob.core.chinacloudapi.cn/photo
K:\Temp\FavoriteMovie.ISOK:\Temp\FavoriteMovie.ISO https://mystorageaccount.blob.core.chinacloudapi.cn/favorite/FavoriteMovies.ISOhttps://mystorageaccount.blob.core.chinacloudapi.cn/favorite/FavoriteMovies.ISO
\\bigshare\john\music\\bigshare\john\music https://mystorageaccount.blob.core.chinacloudapi.cn/musichttps://mystorageaccount.blob.core.chinacloudapi.cn/music

使用此映射时,文件 H:\Video\Drama\GreatMovie.mov 导入到 blob https://mystorageaccount.blob.core.chinacloudapi.cn/video/Drama/GreatMovie.mov。With this mapping, the file H:\Video\Drama\GreatMovie.mov is imported to the blob https://mystorageaccount.blob.core.chinacloudapi.cn/video/Drama/GreatMovie.mov.

接下来,为了确定所需的硬盘驱动器数目,应计算数据大小:Next, to determine how many hard drives are needed, compute the size of the data:

5TB + 30GB + 25GB + 10GB = 5TB + 65GB

对于本示例,两个 3-TB 硬盘驱动器应该足够。For this example, two 3-TB hard drives should be sufficient. 但是,由于源目录 H:\Video 包含 5 TB 数据,而单个硬盘驱动器的容量仅为 3 TB,因此在运行 Azure 导入/导出工具之前,需要将 H:\Video 分解为两个小目录:H:\Video1H:\Video2However, since the source directory H:\Video has 5 TB of data and your single hard drive's capacity is only 3 TB, it's necessary to break H:\Video into two smaller directories: H:\Video1 and H:\Video2, before running the Azure Import/Export Tool. 此步骤生成以下源目录:This step yields the following source directories:

位置Location 大小Size 目标虚拟目录或 BlobDestination virtual directory or blob
H:\Video1H:\Video1 2.5 TB2.5 TB https://mystorageaccount.blob.core.chinacloudapi.cn/videohttps://mystorageaccount.blob.core.chinacloudapi.cn/video
H:\Video2H:\Video2 2.5 TB2.5 TB https://mystorageaccount.blob.core.chinacloudapi.cn/videohttps://mystorageaccount.blob.core.chinacloudapi.cn/video
H:\PhotoH:\Photo 30 GB30 GB https://mystorageaccount.blob.core.chinacloudapi.cn/photohttps://mystorageaccount.blob.core.chinacloudapi.cn/photo
K:\Temp\FavoriteMovies.ISOK:\Temp\FavoriteMovies.ISO 25 GB25 GB https://mystorageaccount.blob.core.chinacloudapi.cn/favorite/FavoriteMovies.ISOhttps://mystorageaccount.blob.core.chinacloudapi.cn/favorite/FavoriteMovies.ISO
\\bigshare\john\music\\bigshare\john\music 10 GB10 GB https://mystorageaccount.blob.core.chinacloudapi.cn/musichttps://mystorageaccount.blob.core.chinacloudapi.cn/music

即使已将 H:\Video 目录分解为两个目录,它们也会指向存储帐户中的同一目标虚拟目录。Even though the H:\Videodirectory has been split to two directories, they point to the same destination virtual directory in the storage account. 这样,所有视频文件将保留在存储帐户中的单个 video 容器下。This way, all video files are maintained under a single video container in the storage account.

接下来,将上面的源目录均匀分配到两个硬盘驱动器中:Next, the previous source directories are evenly distributed to the two hard drives:

硬盘驱动器Hard drive 源目录Source directories 总大小Total size
第一个驱动器First Drive H:\Video1H:\Video1 2.5 TB + 30 GB2.5 TB + 30 GB
H:\PhotoH:\Photo
第二个驱动器Second Drive H:\Video2H:\Video2 2.5 TB + 35 GB2.5 TB + 35 GB
K:\Temp\BlueRay.ISOK:\Temp\BlueRay.ISO
\\bigshare\john\music\\bigshare\john\music

此外,可为所有文件设置以下元数据:In addition, you can set the following metadata for all files:

  • UploadMethod: Windows Azure 导入/导出服务UploadMethod: Windows Azure Import/Export service

  • DataSetName: SampleDataDataSetName: SampleData

  • CreationDate: 2013 年 10 月 1 日CreationDate: 10/1/2013

若要为导入的文件设置元数据,请创建包含以下内容的文本文件 c:\WAImportExport\SampleMetadata.txtTo set metadata for the imported files, create a text file, c:\WAImportExport\SampleMetadata.txt, with the following content:

<?xml version="1.0" encoding="UTF-8"?>  
<Metadata>  
    <UploadMethod>Windows Azure Import/Export service</UploadMethod>  
    <DataSetName>SampleData</DataSetName>  
    <CreationDate>10/1/2013</CreationDate>  
</Metadata>  

还可为 FavoriteMovie.ISO Blob 设置一些属性:You can also set some properties for the FavoriteMovie.ISO blob:

  • Content-Type: application/octet-streamContent-Type: application/octet-stream

  • Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ==Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ==

  • Cache-Control: no-cacheCache-Control: no-cache

若要设置这些属性,请创建文本文件 c:\WAImportExport\SampleProperties.txtTo set these properties, create a text file, c:\WAImportExport\SampleProperties.txt:

<?xml version="1.0" encoding="UTF-8"?>  
<Properties>  
    <Content-Type>application/octet-stream</Content-Type>  
    <Content-MD5>Q2hlY2sgSW50ZWdyaXR5IQ==</Content-MD5>  
    <Cache-Control>no-cache</Cache-Control>  
</Properties>  

现在,便可以运行 Azure 导入/导出工具来准备两个硬盘驱动器了。Now you are ready to run the Azure Import/Export Tool to prepare the two hard drives. 请注意:Note that:

  • 第一个驱动器将作为驱动器 X 装入。The first drive is mounted as drive X.

  • 第二个驱动器将作为驱动器 Y 装入。The second drive is mounted as drive Y.

  • 存储帐户 mystorageaccount 的密钥为 8ImTigJhIwvL9VEIQKB/zbqcXbxrIHbBjLIfOt0tyR98TxtFvUM/7T0KVNR6KRkJrh26u5I8hTxTLM2O1aDVqg==The key for the storage account mystorageaccount is 8ImTigJhIwvL9VEIQKB/zbqcXbxrIHbBjLIfOt0tyR98TxtFvUM/7T0KVNR6KRkJrh26u5I8hTxTLM2O1aDVqg==.

在预先加载了数据的情况下为导入准备磁盘Preparing disk for import when data is pre-loaded

如果要导入的数据已在磁盘上,可以使用标志 /skipwrite。If the data to be imported is already present on the disk, use the flag /skipwrite. /t 和 /srcdir 的值应该指向为导入准备的磁盘。The value of /t and /srcdir should both point to the disk being prepared for import. 如果要导入的所有数据并非都传送到同一个目标虚拟目录或存储帐户根目录,则可针对每个目标目录单独运行相同的命令,但每次运行需要保持使用相同的 /id 值。If all of the data to be imported is not going to the same destination virtual directory or root of the storage account, run the same command for each destination directory separately, keeping the value of /id the same across all runs.

Note

请不要指定 /format,否则会擦除磁盘上的数据。Do not specify /format as it will wipe the data on the disk. 可以根据磁盘是否已加密,指定 /encrypt 或 /bk。You can specify /encrypt or /bk depending on whether the disk is already encrypted or not.

    When data is already present on the disk for each drive run the following command.
    WAImportExport.exe PrepImport /j:FirstDrive.jrn /id:Video1 /logdir:c:\logs /sk:8ImTigJhIwvL9VEIQKB/zbqcXbxrIHbBjLIfOt0tyR98TxtFvUM/7T0KVNR6KRkJrh26u5I8hTxTLM2O1aDVqg== /t:x /format /encrypt /srcdir:x:\Video1 /dstdir:video/ /MetadataFile:c:\WAImportExport\SampleMetadata.txt /skipwrite

复制会话 - 第 1 个驱动器Copy sessions - first drive

对于第 1 个驱动器,请运行 Azure 导入/导出工具 2 次来复制两个源目录:For the first drive, run the Azure Import/Export Tool twice to copy the two source directories:

第 1 个复制会话First copy session

WAImportExport.exe PrepImport /j:FirstDrive.jrn /id:Video1 /logdir:c:\logs /sk:8ImTigJhIwvL9VEIQKB/zbqcXbxrIHbBjLIfOt0tyR98TxtFvUM/7T0KVNR6KRkJrh26u5I8hTxTLM2O1aDVqg== /t:x /format /encrypt /srcdir:H:\Video1 /dstdir:video/ /MetadataFile:c:\WAImportExport\SampleMetadata.txt  

第 2 个复制会话Second copy session

WAImportExport.exe PrepImport /j:FirstDrive.jrn /id:Photo /srcdir:H:\Photo /dstdir:photo/ /MetadataFile:c:\WAImportExport\SampleMetadata.txt

复制会话 - 第二个驱动器Copy sessions - second drive

对于第二个驱动器,请运行 Azure 导入/导出工具 3 次(针对每个源目录运行 1 次,针对独立 Blu-Ray™ 映像文件运行 1 次):For the second drive, run the Azure Import/Export Tool three times, once each for the source directories, and once for the standalone Blu-Ray™ image file):

第 1 个复制会话First copy session

WAImportExport.exe PrepImport /j:SecondDrive.jrn /id:Video2 /logdir:c:\logs /sk:8ImTigJhIwvL9VEIQKB/zbqcXbxrIHbBjLIfOt0tyR98TxtFvUM/7T0KVNR6KRkJrh26u5I8hTxTLM2O1aDVqg== /t:y /format /encrypt /srcdir:H:\Video2 /dstdir:video/ /MetadataFile:c:\WAImportExport\SampleMetadata.txt  

第 2 个复制会话Second copy session

WAImportExport.exe PrepImport /j:SecondDrive.jrn /id:Music /srcdir:\\bigshare\john\music /dstdir:music/ /MetadataFile:c:\WAImportExport\SampleMetadata.txt  

第 3 个复制会话Third copy session

WAImportExport.exe PrepImport /j:SecondDrive.jrn /id:BlueRayIso /srcfile:K:\Temp\BlueRay.ISO /dstblob:favorite/BlueRay.ISO /MetadataFile:c:\WAImportExport\SampleMetadata.txt /PropertyFile:c:\WAImportExport\SampleProperties.txt  

复制会话完成Copy session completion

复制会话完成后,可断开两个驱动器与复制计算机的连接,并将其寄送到相应的 Microsoft Azure 数据中心。Once the copy sessions have completed, you can disconnect the two drives from the copy computer and ship them to the appropriate Windows Azure data center. Azure 门户中创建导入作业时,上传两个日记文件:FirstDrive.jrnSecondDrive.jrnUpload the two journal files, FirstDrive.jrn and SecondDrive.jrn, when you create the import job in the Azure portal.

后续步骤Next steps