将 VMDK 转换为 VHD

Ant*_*lme 9 azure

我正在考虑将 VMDK 硬盘驱动器转换为 VHD(虚拟硬盘驱动器)。VMDK 来自我们 VMware 机器的导出,我想尝试将其导入 Azure。

知道如何实现吗?我尝试了各种小工具来尝试在两种格式之间移动,但到目前为止都无济于事。大多数工具以某种方式声明 VMDK 无效。

小智 10

Microsoft 虚拟机转换器 (MVMC) 包括 Microsoft 虚拟磁盘转换器工具 (MVDC.exe),可将 VMDK 文件转换为 VHD 文件。

http://www.microsoft.com/en-ca/download/details.aspx?id=42497

MVDC SrcDisk  DstDisk  [/?]  [/Dyn]

SrcDisk  Specifies the source VMDK disk path to be converted.
DstDisk  Specifies the path for the converted disk.
[/?]     Show Help
[/Dyn]   Indicates the destination disk should be dynamic rather than fixed.
Run Code Online (Sandbox Code Playgroud)

例如:

C:\Program Files (x86)\Microsoft Virtual Machine Converter Solution Accelerator>mvdc "D:\VM\Windows Server 2008 R2 x64\Windows Server 2008 R2 x64.vmdk" "D:\VM\Windows Server 2008 R2 x64\Windows Server 2008 R2 x64.vhd"
Step 1 of 3: Loading Source Disk...
Step 1 of 3: Loading Source Disk Completed.
Source file found of size 40.0 GB.
DiskGeometry:
   Cylinders:        5221
   Tracks/Cylinder:  255
   Sectors/Track:    63
   Bytes/Sector:     512
   MediaType:        FixedMedia
Step 2 of 3: Creating Destination Disk...
Step 2 of 3: Creating Destination Disk Completed.
Destination file created of size 40.0 GB.
DiskGeometry:
   Cylinders:        5221
   Tracks/Cylinder:  255
   Sectors/Track:    63
   Bytes/Sector:     512
   MediaType:        FixedMedia
Step 3 of 3: Copying raw data...
Step 3 of 3: Copying raw data completed.
Conversion Complete!  The converted file is located at: D:\VM\Windows Server 2008 R2 x64\Windows Server 2008 R2 x64.vhd
Run Code Online (Sandbox Code Playgroud)

默认情况下,它会创建一个固定大小的 VHD,这也是 Azure VM 所需要的。

将其转换为 VHD 后,最好在 Hyper-V 中本地启动它,确保将其配置为动态 IP 并且启用了 RDP,并且您能够成功地将 RDP 导入其中。然后,如果要将其用作基础映像,还需要使用 sysprep 对其进行泛化。如果要将其用于单个 Azure VM,请不要运行 sysprep,而是将其作为磁盘而不是映像上传(Csupload Add-Disk 而不是 Add-PersistentVMImage)。

另见:http : //www.windowsazure.com/en-us/manage/windows/common-tasks/upload-a-vhd/


Fre*_*ers 7

我为此使用 VirtualBox(实际上是 CLI vboxmanage,与 VirtualBox 一起安装),我在安装 VirtualBox 和 Hyper-V 时没有问题,但是你不能同时运行它们,那是另一个线程!

无论如何在提升的(管理员模式)提示下使用

cd %programfiles%\Oracle\VirtualBox

vboxmanage clonehd "C:\tmp\file.vmdk" "C:\tmp\file.vhd" -format VHD
Run Code Online (Sandbox Code Playgroud)

注意,您可以使用 7zip 从 OVA 中提取 VMDK!