在 Azure 中创建虚拟机时不支持 VHDVHD is not supported when you create a virtual machine in Azure

本文有助于在 Windows 或 Linux 中运行虚拟机时更正 VHD 错误。This article helps correct VHD errors when running Virtual Machine in Windows or Linux.

症状Symptoms

使用上传的 VHD 在 Azure 中创建虚拟机时,部署失败并返回以下错误消息:When you create a virtual machine in Azure by using an uploaded VHD, the deployment fails and returns the following error message:

New-AzureRmVM : Long running operation failed with status 'Failed'.
ErrorCode: InvalidVhd
ErrorMessage: The specified cookie value in VHD footer indicates that disk 'diskname' with blob https://xxxxxx.blob.core.chinacloudapi.cn/vhds/samplename.vhd is not a supported VHD. Disk is expected to have cookie value 'conectix'.

原因Cause

此问题是由以下原因之一导致的:This problem occurs for one of the following reasons:

  • VHD 不符合 1 MB 对齐(偏移)规范。The VHD does not comply with the 1 MB alignment (offset). 支持的磁盘大小应为 1 MB * N。例如,磁盘大小应为 102,401 MB。The supported disk size should be 1 MB * N. For example, the disk should be 102,401 MB.
  • VHD 已损坏或不受支持。The VHD is corrupted or not supported.

解决方法Resolution

备注

若要执行以下修复,客户需要在将 VHD 上传到 Azure 之前执行这些步骤。To perform the following fix, the customer will need to perform these steps prior to uploading the VHD into Azure.

若要解决此问题,请调整磁盘大小以符合 1 MB 一致性:To resolve this problem, resize the disk to comply with 1 MB alignment:

有关如何创建和上传 VHD 以创建 Azure VM 的更多信息,请参阅以下文章:For more information about how to create and upload a VHD for creating Azure VM, see the following articles:

持续出现的问题可能表明 VHD 已损坏。Continuing problems may indicate a corrupted VHD. 在这种情况下,我们建议你从头开始重新生成 VHD。In this situation, we recommend that you rebuild the VHD from scratch.

有关详细信息,请参阅以下文章:For more information, see the following article: