将 VM 移动到 Azure Stack Hub 概述Move a VM to Azure Stack Hub overview

可以将虚拟机 (VM) 从你的环境移动到 Azure Stack Hub。You can move virtual machines (VM)s from your environment to Azure Stack Hub. 在规划移动工作负载时,需要预期一些限制。There are some limitations that you need to expect when planning to move your workloads. 本文列出了 Azure Stack Hub 中对虚拟硬盘 (VHD) 的要求。This article lists the requirements for virtual hard disk (VHD)s in Azure Stack Hub. Azure Stack Hub 需要第一 (1) 代 VHD。Azure Stack Hub requires a generation one (1) VHD. VM 需要进行通用化或专用化。Your VM will need to be either generalized or specialized. 使用通用化 VM 作为在 Azure Stack 中创建的 VM 的基础。Use generalized VMs as the base-mage for VMS created in Azure Stack. 专用 VM 包含用户帐户。Specialized VM contains user accounts. 若要迁移、准备和下载 VHD,请验证 VHD 是否满足要求,将映像上传到 Azure Stack Hub 中的存储帐户,然后在云中创建 VM。To migrate, prepare and download the VHD, validate that the VHD meets the requirements, upload the image to a storage account in Azure Stack Hub, and then create the VM in your cloud. 如果有更复杂的迁移任务,可以在“迁移到 Azure Stack Hub”白皮书中找到完整讨论。If you have a more complex migration task, you can find a complete discussion in the Migrate to Azure Stack Hub whitepaper.

自定义映像有两种形式:通用和专用 。Custom images come in two forms: generalized and specialized.

  • 通用映像Generalized image
    通用磁盘映像是使用 Sysprep 准备的用于删除任何唯一信息(如用户帐户)的映像,从而使它能够重复用于创建多个 VM。A generalized disk image is one that has been prepared with Sysprep to remove any unique information (such as user accounts), enabling it to be reused to create multiple VMs. 在创建 Azure Stack Hub 云操作员规划用作市场项的映像时,通用 VHD 非常合适。Generalized VHDs are a good fit for when are creating images that the Azure Stack Hub cloud operator plans to use as marketplace items. 通过管理员门户或管理员终结点提供的映像是平台映像。Images offered through the administrator portal or administrator endpoints are platform images.

  • 专用映像Specialized image
    专用磁盘映像是包含原始 VM 中的用户帐户、应用程序和其他状态数据的现有 VM 中虚拟硬盘 (VHD) 的副本。A specialized disk image is a copy of a virtual hard disk (VHD) from an existing VM that contains the user accounts, applications, and other state data from your original VM. 将 VM 迁移到 Azure Stack Hub 时通常采用此格式。This is typically the format in which VMs are migrated to Azure Stack Hub. 需要将 VM 从本地迁移到 Azure Stack Hub 时,专用 VHD 非常适合此操作。Specialized VHDs are a good fit for when you need to migrate VMs from on-premises to Azure Stack Hub.

将映像移动到 Azure Stack Hub 时,请考虑要如何使用映像。When moving an image into Azure Stack Hub, consider how you would like to have the image used.

  • 个人工作负载Personal workload
    你的本地环境或全局 Azure 中可能有一台用于开发或特定任务的计算机,并且你要充分利用通过 Azure Stack Hub 在私有云中托管它。You may have a machine in your on-premises environment or in global Azure that you use for development or specific tasks and you would like to take advantage of hosting it in a private cloud with Azure Stack Hub. 你要保留该计算机上的数据和用户帐户。You you would like to retain the data and user accounts on the machine. 要将此计算机作为专用映像移动到 Azure Stack Hub。You would want to move this machine into the Azure Stack Hub as a specialized image.

  • 黄金映像Golden image
    你可能要在工作组中共享公用 VM 配置和应用程序集。You may want to share a common VM configuration and set of applications within your workgroup. 你不需要与 Azure Stack Hub 域(目录租户)之外的用户共享映像。You will not have the need to share the image with users outside of your Azure Stack Hub domain (directory tenant). 在这种情况下,需要通过删除数据和用户帐户来通用化映像。In this case, you will want to generalize the image by removing data and user accounts. 随后可以与租户中的其他用户共享此映像。You can then share this image with other users in your tenant.

  • Azure Stack Hub 市场产品/服务Azure Stack Hub Marketplace offering
    云操作员可以使用通用化映像作为 市场产品/服务的基础。Your cloud operator can use generalized image as the basis of a marketplace offering. 准备好映像后,云操作员便可使用自定义映像为 Azure Stack Hub 实例创建市场产品/服务。Once you have prepared your image, your cloud operator can use the custom image to create a marketplace offering for your Azure Stack Hub instance. 用户可以从映像创建自己的 VM,如同创建市场中的任何其他产品/服务。Users can create their own VM from the image as they would any other offering in the Marketplace. 需要与云操作员合作创建此产品/服务。You will need to work with your cloud operator to create this offering.

验证 VHD 要求Verify VHD requirements

重要

准备 VHD 时,必须准备好实施以下要求,否则无法在 Azure Stack Hub 中使用 VHD。When preparing your VHD, you must have the following requirements in place or your will not be able to use your VHD in Azure Stack Hub. 在上传映像之前,请考虑以下因素:Before you upload the image, consider the following:

  • Azure Stack Hub 仅支持来自第一 (1) 代 VM 的映像。Azure Stack Hub only supports images from generation one (1) VMs.
  • VHD 属于固定类型。VHD is of fixed type. Azure Stack Hub 不支持动态磁盘 VHD。Azure Stack Hub does not support dynamic disk VHDs.
  • VHD 的最小虚拟大小至少为 20 MB。VHD has minimum virtual size of at least 20 MB.
  • VHD 已调整,也就是说,虚拟大小必须是 1 MB 的倍数。VHD is aligned, that is, the virtual size must be a multiple of 1 MB.
  • VHD blob 长度 = 虚拟大小 + vhd 页脚长度 (512)。VHD blob length = virtual size + vhd footer length (512). 在 Blob 末尾有一小段脚注,描述了 VHD 的属性。A small footer at the end of the blob describes the properties of the VHD.

可以在验证 VHD 中找到修复 VHD 的步骤You can find steps to repair your VHD at Verify your VHD

移动 VM 的方法Methods of moving a VM

对于以下方案,可以手动将 VM 移动到 Azure Stack Hub 中:You can manually move your VM into Azure Stack Hub with the following scenarios:

方案Scenario InstructionsInstructions
Azure 到 Azure Stack HubAzure to Azure Stack Hub 在 Azure 中准备 VHD,然后上传到 Azure Stack Hub。Prepare your VHD in Azure and then upload to Azure Stack Hub. 有关详细信息,请参阅将 VM 从 Azure 移动到 Azure Stack HubFor more information, see Move a VM from Azure to Azure Stack Hub.
本地通用化到 Azure Stack HubLocal generalized to Azure Stack Hub 在 Hyper-V 中以本地方式准备 VHD 并通用化 VHD,然后上传到 Azure Stack Hub。Prepare your VHD and generalize a VHD locally in Hyper-V and then upload to Azure Stack Hub. 有关详细信息,请参阅将通用化 VM 从本地移动到 Azure Stack HubFor more information, see Move a generalized VM from on-premises to Azure Stack Hub.
本地专用化到 Azure Stack HubLocal specialized to Azure Stack Hub 在 Hyper-V 中以本地方式准备专用化 VHD,然后上传到 Azure Stack Hub。Prepare your specialized VHD locally in Hyper-V and then upload to Azure Stack Hub. 有关详细信息,请参阅将专用化 VM 从本地移动到 Azure Stack HubFor more information, see Move a specialized VM from on-premises to Azure Stack Hub.

迁移到 Azure Stack HubMigrate to Azure Stack Hub

可以在 Azure 中由 AzureCAT 专家撰写的指南中找到用于批量规划和将工作负载迁移到 Azure Stack Hub 的详细信息、检查表和最佳做法。You can find details, checklists, and best practices for planning and migrating your workloads in bulk to Azure Stack Hub in a guide written by the AzureCAT experts in Azure. 该指南重点介绍迁移在物理服务器或现有虚拟化平台上运行的现有应用程序。The guide focuses on the migration of existing applications that run either on physical servers or on existing virtualization platforms. 通过将这些工作负载转移到 Azure Stack Hub IaaS 环境,团队可受益于更顺利的运营、自助部署、标准化硬件配置和 Azure 一致性。By moving these workloads to the Azure Stack Hub IaaS environment, teams can benefit from smoother operations, self-service deployments, standardized hardware configurations, and Azure consistency.

获取白皮书。Get the white paper.

还可以找到有关云采用框架中的迁移的指导。You can also find guidance about migration in the Cloud Adoption Framework. 有关详细信息,请参阅规划 Azure Stack Hub 迁移For more information, see Plan your Azure Stack Hub migration.

后续步骤Next steps

Azure Stack Hub VM 简介Introduction to Azure Stack Hub VMs

将自定义 VM 映像添加到 Azure Stack HubAdd a custom VM image to Azure Stack Hub