您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

使用 Azure Migrate 在 Azure Vm 上 Rehost 本地应用程序Rehost an on-premises application on Azure VMs by using Azure Migrate

本文演示了如何通过将应用程序 Vm 迁移到 Azure Vm 来原名不同在 VMware 虚拟) (机上运行的两层 Windows .NET 前端应用程序。This article demonstrates how the fictional company Contoso rehosts a two-tier Windows .NET front-end application running on VMware virtual machines (VMs) by migrating application VMs to Azure VMs.

本示例中使用的 SmartHotel360 应用程序作为开源软件提供。The SmartHotel360 application used in this example is provided as open-source software. 如果要将其用于自己的测试目的,可以从 GitHub下载。If you want to use it for your own testing purposes, you can download it from GitHub.

业务驱动因素Business drivers

IT 领先团队与业务合作伙伴密切合作,以了解他们希望在此迁移中实现的目标。The IT leadership team has worked closely with business partners to understand what they want to achieve with this migration. 它们需要:They want to:

  • 解决业务增长。Address business growth. Contoso 正在不断增长,因此公司的本地系统和基础结构会有压力。Contoso is growing, so there's pressure on the company's on-premises systems and infrastructure.
  • 限制风险。Limit risk. SmartHotel360 应用程序对于 Contoso 企业至关重要。The SmartHotel360 application is critical for the Contoso business. 该公司希望将应用程序移到 Azure,但没有风险。The company wants to move the application to Azure with zero risk.
  • 扩展.Extend. Contoso 不希望修改应用程序,但需要确保应用程序是稳定的。Contoso doesn't want to modify the application, but it does want to ensure that the application is stable.

迁移目标Migration goals

Contoso 云团队制定了本次迁移的目标。The Contoso cloud team has pinned down goals for this migration. 它使用这些目标来确定最佳迁移方法:It used these goals to determine the best migration method:

  • 迁移后,Azure 中的应用程序应具有与今天在 VMware 中的相同性能功能。After migration, the application in Azure should have the same performance capabilities as it does today in VMware. 当应用程序在本地时,应用程序将在云中保持重要。The application will remain as critical in the cloud as it is on-premises.
  • 虽然此应用程序对于 Contoso 非常重要,但公司现在并不想投入资金。Although this application is important to Contoso, the company doesn't want to invest in it at this time. Contoso 想要将应用程序安全地移动到云的当前形式。Contoso wants to move the application safely to the cloud in its current form.
  • Contoso 不希望更改此应用程序的 ops 模型。Contoso doesn't want to change the ops model for this application. Contoso 想要按照目前的相同方式与云中的 it 交互。Contoso does want to interact with it in the cloud in the same way that it does now.
  • Contoso 不希望更改任何应用程序功能。Contoso doesn't want to change any application functionality. 只有应用程序位置会发生更改。Only the application location will change.

解决方案设计Solution design

确立目标和需求后,Contoso 设计和审查部署解决方案。After establishing goals and requirements, Contoso designs and reviews a deployment solution. Contoso 会确定迁移过程,包括用于迁移的 Azure 服务。Contoso identifies the migration process, including the Azure services that it will use for the migration.

当前应用程序Current application

  • 应用程序跨两个 Vm 进行分层 (WEBVMSQLVM) 。The application is tiered across two VMs (WEBVM and SQLVM).
  • 这两个 VM 位于 VMware ESXi 主机 contosohost1.contoso.com(版本 6.5)上。The VMs are located on VMware ESXi host contosohost1.contoso.com (version 6.5).
  • VMware 环境由 vcenter.contoso.com 在 VM 上运行) vCenter Server 6.5 (进行管理。The VMware environment is managed by vCenter Server 6.5 (vcenter.contoso.com) running on a VM.
  • Contoso 有一个本地数据中心 (contoso-datacenter) 与本地域控制器 (contosodc1) 。Contoso has an on-premises datacenter (contoso-datacenter) with an on-premises domain controller (contosodc1).

建议的体系结构Proposed architecture

  • 由于应用程序是生产工作负荷,因此 Azure 中的应用程序 Vm 将位于生产资源组中 ContosoRGBecause the application is a production workload, the application VMs in Azure will reside in the production resource group ContosoRG.
  • 应用程序 Vm 将迁移到主要 Azure 区域 (美国东部 2) 并放置在生产网络 (VNET-PROD-EUS2) 中。The application VMs will be migrated to the primary Azure region (East US 2) and placed in the production network (VNET-PROD-EUS2).
  • Web 前端 VM 将位于生产网络中的前端子网 (PROD-FE-EUS2) 。The web front-end VM will reside in the front-end subnet (PROD-FE-EUS2) in the production network.
  • 数据库 VM 将位于生产网络中 () 的数据库子网中 PROD-DB-EUS2The database VM will reside in the database subnet (PROD-DB-EUS2) in the production network.
  • 迁移完成后,Contoso 数据中心的本地 VM 将停止使用。The on-premises VMs in the Contoso datacenter will be decommissioned after the migration is done.

显示方案体系结构的关系图。

数据库注意事项Database considerations

在解决方案设计过程中,Contoso 对 Azure SQL 数据库和 SQL Server 做了功能比较。As part of the solution design process, Contoso did a feature comparison between Azure SQL Database and SQL Server. 以下注意事项有助于公司决定使用在 Azure IaaS VM 上运行 SQL Server:The following considerations helped the company to decide to use SQL Server running on an Azure IaaS VM:

  • 如果 Contoso 需要自定义操作系统和数据库,或者归置并在同一 VM 上运行合作伙伴应用程序,则使用运行 SQL Server 的 Azure VM 似乎是最佳解决方案。Using an Azure VM running SQL Server seems to be an optimal solution if Contoso needs to customize the operating system and the database, or co-locate and run partner applications on the same VM.
  • 使用软件保障,Contoso 以后可以通过使用 Azure 混合权益 SQL Server,为 Azure SQL 托管实例上的折扣率交换现有许可证。With Software Assurance, Contoso can later exchange existing licenses for discounted rates on Azure SQL Managed Instance by using the Azure Hybrid Benefit for SQL Server. 这可节省多达30% 的 SQL 托管实例。This can save up to 30 percent on SQL Managed Instance.

解决方案评审Solution review

Contoso 通过组合一系列的优点和缺点来评估建议的设计。Contoso evaluates the proposed design by putting together a list of pros and cons.

注意事项Consideration 详细信息Details
优点Pros 这两个应用程序 Vm 无需更改即可迁移到 Azure,从而简化迁移。Both the application VMs will be moved to Azure without changes, making the migration simple.

由于 Contoso 正在对这两个应用程序 Vm 使用双向方法,因此不需要为应用程序数据库提供任何特殊的配置或迁移工具。Because Contoso is using a lift-and-shift approach for both application VMs, it doesn't need any special configuration or migration tools for the application database.

Contoso 可以通过使用 Azure 混合权益,充分利用其对软件保障的投资。Contoso can take advantage of its investment in Software Assurance by using the Azure Hybrid Benefit.

Contoso 将保留对 Azure 中应用程序 Vm 的完全控制。Contoso will retain full control of the application VMs in Azure.
缺点Cons WEBVM 和正在 SQLVM 运行 Windows Server 2008 R2。WEBVM and SQLVM are running Windows Server 2008 R2. Azure 支持针对特定角色的操作系统。Azure supports the operating system for specific roles. 了解详细信息Learn more.

应用程序的 web 层和数据层保持为单点故障。The web and data tiers of the application remain as single points of failure.

SQLVM 正在 SQL Server 2008 R2 上运行。SQLVM is running on SQL Server 2008 R2. SQL Server 2008 R2 不再处于主流支持中,但 Azure Vm 支持。SQL Server 2008 R2 is no longer in mainstream support, but it is supported for Azure VMs. 了解详细信息Learn more.

Contoso 必须继续支持 Azure Vm 上的应用程序,而不是迁移到 Azure App Service 或 Azure SQL 数据库等托管服务。Contoso must continue supporting the application on Azure VMs rather than moving to a managed service such as Azure App Service or Azure SQL Database.

迁移过程Migration process

Contoso 使用 Azure Migrate: Server 迁移工具中的无代理方法将应用程序前端和数据库 Vm 迁移到 Azure Vm。Contoso will migrate the application front-end and database VMs to Azure VMs by using the agentless method in the Azure Migrate: Server Migration tool.

  • 作为第一步,Contoso 准备并设置用于 Azure Migrate 的 Azure 组件:服务器迁移,并准备本地 VMware 基础结构。As a first step, Contoso prepares and sets up Azure components for Azure Migrate: Server Migration, and prepares the on-premises VMware infrastructure.
  • Azure 基础结构已准备就绪,因此 Contoso 只需通过 Azure Migrate:服务器迁移工具配置 vm 的复制。The Azure infrastructure is in place, so Contoso just needs to configure the replication of the VMs through the Azure Migrate: Server Migration tool.
  • 待一切准备就绪后,Contoso 可以开始复制 VM。With everything prepared, Contoso can start replicating the VMs.
  • 启用复制并正常工作后,Contoso 将通过测试迁移并将其故障转移到 Azure 来迁移 VM (如果成功)。After replication is enabled and working, Contoso will migrate the VM by testing the migration and failing it over to Azure, if successful.

此图显示了迁移过程中的步骤。

Azure 服务Azure services

服务Service 说明Description 成本Cost
Azure Migrate:服务器迁移Azure Migrate: Server Migration 该服务协调和管理本地应用程序和工作负荷的迁移,以及 Amazon Web Services (AWS) 和 Google Cloud Platform () GCP VM 实例。The service orchestrates and manages migration of on-premises applications and workloads as well as Amazon Web Services (AWS) and Google Cloud Platform (GCP) VM instances. 在复制到 Azure 的过程中,会产生 Azure 存储费用。During replication to Azure, Azure Storage charges are incurred. 在迁移发生并且 Vm 在 Azure 中运行时,将创建 Azure Vm 并产生费用。Azure VMs are created, and incur charges, when the migration occurs and the VMs are running in Azure. 了解有关 费用和定价的详细信息。Learn more about charges and pricing.

先决条件Prerequisites

Contoso 和其他用户必须满足此方案的以下先决条件。Contoso and other users must meet the following prerequisites for this scenario.

要求Requirements 详细信息Details
Azure 订阅Azure subscription 在前面的系列文章中,Contoso 已创建订阅。Contoso created subscriptions in an earlier article in this series. 如果还没有 Azure 订阅,可以创建一个免费帐户If you don't have an Azure subscription, create a free account.

如果创建的是免费帐户,则你是自己的订阅的管理员,可以执行所有操作。If you create a free account, you're the administrator of your subscription and can perform all actions.

如果你使用现有的订阅,并且你不是管理员,请与管理员合作,为你分配所有者或参与者权限。If you use an existing subscription and you're not the administrator, work with the admin to assign you Owner or Contributor permissions.

如果需要更精细的权限,请参阅 使用 Azure 基于角色的访问控制管理 Site Recovery 访问If you need more granular permissions, see Manage Site Recovery access with Azure role-based access control.
Azure 基础结构Azure infrastructure 了解 Contoso 如何 设置 Azure 基础结构Learn how Contoso set up an Azure infrastructure.

详细了解 Azure Migrate:服务器迁移的特定 先决条件Learn more about specific prerequisites for Azure Migrate: Server Migration.
本地服务器On-premises servers 本地 vCenter 服务器应该运行版本5.5、6.0、6.5 或6.7。On-premises vCenter servers should be running version 5.5, 6.0, 6.5, or 6.7.

ESXi 主机应运行版本5.5、6.0、6.5 或6.7。ESXi hosts should run version 5.5, 6.0, 6.5, or 6.7.

ESXi 主机上应运行有一个或多个 VMware VM。One or more VMware VMs should be running on the ESXi host.

方案步骤Scenario steps

Contoso 管理员按如下所述运行迁移:Here's how Contoso admins will run the migration:

  • 步骤1:准备 Azure 以进行 Azure Migrate:服务器迁移。Step 1: Prepare Azure for Azure Migrate: Server Migration. 它们将服务器迁移工具添加到其 Azure Migrate 项目。They add the server migration tool to their Azure Migrate project.
  • 步骤2:复制本地 Vm。Step 2: Replicate on-premises VMs. 它们设置复制并开始将 Vm 复制到 Azure 存储。They set up replication and start replicating VMs to Azure Storage.
  • 步骤3:迁移 Vm 并 Azure Migrate:服务器迁移。Step 3: Migrate the VMs with Azure Migrate: Server Migration. 它们运行测试迁移,确保一切正常运行,然后运行完整的迁移将 Vm 移到 Azure。They run a test migration to make sure everything's working, and then run a full migration to move the VMs to Azure.

步骤1:准备 Azure 以进行 Azure Migrate:服务器迁移Step 1: Prepare Azure for Azure Migrate: Server Migration

若要将 Vm 迁移到 Azure,Contoso 需要一个虚拟网络,在迁移过程中创建 Azure Vm 时,Azure Vm 将位于该网络中。To migrate the VMs to Azure, Contoso needs a virtual network in which Azure VMs will be located when they're created during migration. 还需要预配和配置 Azure Migrate:服务器迁移工具 (.OVA) 文件。It also needs the Azure Migrate: Server Migration tool (OVA file) provisioned and configured.

  1. 设置网络。Set up a network. Contoso 已设置了一个可用于 Azure Migrate: 部署 Azure 基础结构时的服务器迁移。Contoso already set up one that can be used for Azure Migrate: Server Migration when it deployed the Azure infrastructure.

    • SmartHotel360 应用程序是生产应用程序,Vm 将迁移到 Azure 生产网络, (VNET-PROD-EUS2 () 的主要区域) East US 2The SmartHotel360 application is a production application, and the VMs will be migrated to the Azure production network (VNET-PROD-EUS2) in the primary region (East US 2).
    • 这两个 Vm 都将放在 ContosoRG 用于生产资源的资源组中。Both VMs will be placed in the ContosoRG resource group, which is used for production resources.
    • 应用程序前端 VM (WEBVM) 会迁移到 PROD-FE-EUS2) (生产网络中的前端子网。The application front-end VM (WEBVM) will migrate to the front-end subnet (PROD-FE-EUS2) in the production network.
    • 应用程序数据库 VM (SQLVM) 会迁移到生产网络中 () 的数据库子网 PROD-DB-EUS2The application database VM (SQLVM) will migrate to the database subnet (PROD-DB-EUS2) in the production network.
  2. 预配 Azure Migrate:服务器迁移工具。Provision the Azure Migrate: Server Migration tool.

    1. 从 Azure Migrate 下载 .OVA 映像,并将其导入到 VMware。From Azure Migrate, download the OVA image and import it into VMware.

      显示 O V 文件的 "下载" 按钮的屏幕截图。

    2. 启动导入的映像并配置该工具,包括以下步骤:Start the imported image and configure the tool, including the following steps:

      • 设置先决条件。Set up the prerequisites.

        屏幕截图,显示用于设置必备许可条款的区域。

      • 将工具指向 Azure 订阅。Point the tool to the Azure subscription.

        显示用于向 Azure Migrate 注册的选择的屏幕截图。

      • 设置 VMware vCenter 凭据。Set the VMware vCenter credentials.

        显示用于指定 vCenter 服务器的选择的屏幕截图。

      • 添加任何基于 Windows 的凭据以用于发现。Add any Windows-based credentials for discovery.

        用于发现虚拟机上的应用程序和依赖项的区域屏幕截图。

完成配置后,该工具将需要一段时间来枚举所有 Vm。When you complete the configuration, the tool will take some time to enumerate all the VMs. 完成此过程后,会看到它们填充 Azure 中的 Azure Migrate 工具。You'll see them populate the Azure Migrate tool in Azure when this process finishes.

需要更多帮助?Need more help?

了解如何设置 Azure Migrate:服务器迁移工具Learn about how to set up the Azure Migrate: Server Migration tool.

准备本地 VmPrepare on-premises VMs

迁移后,Contoso 希望连接到 Azure Vm 并允许 Azure 管理 Vm。After migration, Contoso wants to connect to the Azure VMs and allow Azure to manage the VMs. Contoso 管理员必须在迁移之前执行以下步骤:The Contoso admins must do the following steps before migration:

  1. 若要通过 internet 访问:For access over the internet:

    • 迁移之前,在本地 VM 上启用 RDP 或 SSH。Enable RDP or SSH on the on-premises VM before migration.
    • 确保为“公共”配置文件添加了 TCP 和 UDP 规则。Ensure that TCP and UDP rules are added for the Public profile.
    • 检查操作系统防火墙中是否允许使用 RDP 或 SSH。Check that RDP or SSH is allowed in the operating system firewall.
  2. 对于站点到站点 VPN 访问:For access over Site-to-Site VPN:

    • 迁移之前,在本地 VM 上启用 RDP 或 SSH。Enable RDP or SSH on the on-premises VM before migration.
    • 检查操作系统防火墙中是否允许使用 RDP 或 SSH。Check that RDP or SSH is allowed in the operating system firewall.
    • 对于 Windows,请将本地 VM 上的操作系统的 SAN 策略设置为 OnlineAllFor Windows, set the operating system's SAN policy on the on-premises VM to OnlineAll.
  3. 安装 Azure Windows 代理Install the Azure Windows agent.

其他注意事项:Other considerations:

  • 对于 Windows,当你触发迁移时,VM 上应该不会有任何挂起的 Windows 更新。For Windows, there should be no Windows updates pending on the VM when you're triggering a migration. 如果有,则在更新完成之前,管理员无法登录到 VM。If there are, the admins won't be able to sign in to the VM until the updates finish.
  • 迁移后,管理员可以检查 启动诊断 以查看 VM 的屏幕截图。After migration, the admins can check Boot diagnostics to view a screenshot of the VM. 如果这不起作用,它们应该验证 VM 是否正在运行,并查看 故障排除提示If this doesn't work, they should verify that the VM is running and review troubleshooting tips.

需要更多帮助?Need more help?

了解如何准备要 迁移的 vmLearn about how to prepare VMs for migration.

步骤2:复制本地 VmStep 2: Replicate the on-premises VMs

在 Contoso 管理员可运行迁移到 Azure 之前,需要设置并启用复制。Before the Contoso admins can run a migration to Azure, they need to set up and enable replication.

发现完成后,可以开始将 VMware Vm 复制到 Azure。With discovery completed, they can begin replication of VMware VMs to Azure.

  1. 在 Azure Migrate 项目中转到 "服务器 > Azure Migrate:服务器迁移"。In the Azure Migrate project, go to Servers > Azure Migrate: Server Migration. 然后选择 " 复制"。Then select Replicate.

    用于复制虚拟机的选项的屏幕截图。

  2. 在 "复制 > 源设置" " > 虚拟机" 中,选择 "是",并 VMware vSphereIn Replicate > Source settings > Are your machines virtualized?, select Yes, with VMware vSphere.

  3. "本地设备" 中,选择设置的 Azure Migrate 设备的名称,然后选择 "确定"In On-premises appliance, select the name of the Azure Migrate appliance that you set up, and then select OK.

    显示源设置的屏幕截图。

  4. 在 " 虚拟机" 中,选择要复制的计算机。In Virtual machines, select the machines that you want to replicate.

    • 如果已为 Vm 运行评估,可以从评估结果中 (高级或标准) 建议应用 VM 大小和磁盘类型。If you've run an assessment for the VMs, you can apply VM sizing and disk type (premium or standard) recommendations from the assessment results. 为此,请在“从 Azure Migrate 评估导入迁移设置?”中选择“是”选项。 To do this, in Import migration settings from an Azure Migrate assessment?, select the Yes option.
    • 如果未运行评估,或者不想使用评估设置,请选择 " " 选项。If you didn't run an assessment, or you don't want to use the assessment settings, select the No option.
    • 如果选择使用评估,请选择 VM 组和评估名称。If you selected to use the assessment, select the VM group and assessment name.

    显示用于选择要迁移的虚拟机的框的屏幕截图。

  5. 在 " 虚拟机" 中,根据需要搜索 vm,并检查要迁移的每个虚拟机。In Virtual machines, search for VMs as needed and check each VM that you want to migrate. 然后选择 " 下一步:目标设置"。Then select Next: Target settings.

  6. 在 " 目标设置" 中,选择要迁移到的订阅和目标区域。In Target settings, select the subscription and target region to which you'll migrate. 然后指定迁移之后 Azure Vm 所在的资源组。Then specify the resource group in which the Azure VMs will reside after migration. 在 " 虚拟网络" 中,选择 azure vm 在迁移后要连接到的 azure 虚拟网络或子网。In Virtual Network, select the Azure virtual network or subnet to which the Azure VMs will be joined after migration.

  7. 在“Azure 混合权益”中:In Azure Hybrid Benefit:

    • 如果你不想要应用 Azure 混合权益,请选择“否”。Select No if you don't want to apply Azure Hybrid Benefit. 然后,选择“下一步”。Then select Next.
    • 如果你有与活动的软件保障或 Windows Server 订阅涵盖的 Windows Server 计算机,并且你想要将权益应用于你要迁移的计算机,请选择 "是"Select Yes if you have Windows Server machines that are covered with active Software Assurance or Windows Server subscriptions and you want to apply the benefit to the machines that you're migrating. 然后,选择“下一步”。Then select Next.
  8. 在“计算”中,查看 VM 名称、大小、OS 磁盘类型和可用性集。In Compute, review the VM name, size, OS disk type, and availability set. VM 必须符合 Azure 要求VMs must conform with Azure requirements.

    • VM 大小: 如果使用的是评估建议,"VM 大小" 下拉列表将包含建议的大小。VM size: If you're using assessment recommendations, the VM size drop-down list will contain the recommended size. 否则,Azure Migrate 会根据 Azure 订阅中最接近的匹配项选择大小。Otherwise, Azure Migrate picks a size based on the closest match in the Azure subscription. 或者,请在“Azure VM 大小”中的手动选择一个大小。Alternatively, pick a manual size in Azure VM size.
    • OS 磁盘: 为 VM 指定 OS (boot) 磁盘。OS disk: Specify the OS (boot) disk for the VM. OS 磁盘具有操作系统引导程序和安装程序。The OS disk has the operating system bootloader and installer.
    • 可用性集: 如果迁移后 VM 应在 Azure 可用性集中,请指定集。Availability set: If the VM should be in an Azure availability set after migration, specify the set. 该集必须位于你为迁移指定的目标资源组中。The set must be in the target resource group that you specify for the migration.
  9. 在“磁盘”中,指定是否要将 VM 磁盘复制到 Azure,并选择 Azure 中的磁盘类型(标准 SSD/HDD 或高级托管磁盘)。In Disks, specify whether the VM disks should be replicated to Azure, and select the disk type (standard SSD/HDD or premium-managed disks) in Azure. 然后,选择“下一步”。Then select Next.

    可以从复制中排除磁盘。You can exclude disks from replication. 如果你排除磁盘,则在迁移后它们将不会出现在 Azure VM 中。If you exclude disks, they won't be present on the Azure VM after migration.

  10. 在 " 检查并启动复制" 中,查看设置,然后选择 " 复制 ",为服务器启动初始复制。In Review and start replication, review the settings, and then select Replicate to start the initial replication for the servers.

备注

在复制开始之前,你可以在 管理 复制计算机中随时更新复制设置 > 。You can update replication settings at any time before replication starts, in Manage > Replicating machines. 开始复制后无法更改设置。Settings can't be changed after replication starts.

步骤3:通过 Azure Migrate 迁移 Vm:服务器迁移Step 3: Migrate the VMs with Azure Migrate: Server Migration

Contoso 管理员先运行快速测试迁移,然后执行完整迁移以迁移 Vm。The Contoso admins run a quick test migration and then a full migration to migrate the VMs.

运行测试迁移Run a test migration

  1. 在 "迁移目标 > 服务器 > Azure Migrate:服务器迁移 中,选择"测试迁移的服务器"。In Migration goals > Servers > Azure Migrate: Server Migration, select Test migrated servers.

    用于启动已迁移服务器测试的按钮屏幕截图。

  2. 选择并按住 (或右键单击要测试) VM,然后选择 " 测试迁移"。Select and hold (or right-click) the VM to test, and then select Test migrate.

    所选虚拟机的屏幕截图和启动迁移测试按钮。

  3. 在“测试迁移”中,选择 Azure VM 在迁移后所在的 Azure 虚拟网络。In Test Migration, select the Azure virtual network in which the Azure VM will be located after the migration. 建议使用非生产虚拟网络。We recommend that you use a nonproduction virtual network.

  4. “测试迁移”作业随即启动。The Test migration job starts. 在门户通知中监视该作业。Monitor the job in the portal notifications.

  5. 迁移完成后,在 Azure 门户上的“虚拟机”中查看已迁移的 Azure VM。After the migration finishes, view the migrated Azure VM in Virtual Machines in the Azure portal. 计算机名称具有 -Test 后缀。The machine name has a -Test suffix.

  6. 测试完成后,选择并保持 (或右键单击 " 复制计算机" 中的 Azure VM) ,然后选择 " 清理测试迁移"。After the test is done, select and hold (or right-click) the Azure VM in Replicating machines, and then select Clean up test migration.

    用于清理迁移的选项的屏幕截图。

迁移 VMMigrate the VMs

现在,Contoso 管理员运行完全迁移。Now the Contoso admins run a full migration.

  1. 在 Azure Migrate 项目中,选择 "服务器" > Azure Migrate "服务器迁移 > 复制服务器"。In the Azure Migrate project, select Servers > Azure Migrate: Server Migration > Replicating servers.

    用于复制服务器的选择的屏幕截图。

  2. 在 " 复制计算机" 中,选择并按住 (或右键单击 VM) ,然后选择 " 迁移"。In Replicating machines, select and hold (or right-click) the VM, and then select Migrate.

  3. 在“迁移” > “关闭虚拟机并执行计划迁移(不会丢失任何数据)”中,选择“是” > “确定”。 In Migrate > Shut down virtual machines and perform a planned migration with no data loss, select Yes > OK.

    默认情况下,Azure Migrate 关闭本地 VM 并运行按需复制,以便同步自上次复制后发生的任何 VM 更改。By default, Azure Migrate shuts down the on-premises VM and runs an on-demand replication to synchronize any VM changes that occurred since the last replication. 这可以确保不会丢失数据。This ensures no data loss. 如果你不想要关闭 VM,请选择“否”。If you don't want to shut down the VM, select No.

  4. 随即会针对该 VM 启动一个迁移作业。A migration job starts for the VM. 在 Azure 通知中跟踪该作业。Track the job in Azure notifications.

  5. 该作业完成后,可以从“虚拟机”页查看和管理该 VM。After the job finishes, you can view and manage the VM from the Virtual Machines page.

需要更多帮助?Need more help?

迁移后的清理Clean up after migration

完成迁移后,SmartHotel360 应用程序层现在会在 Azure Vm 上运行。With migration complete, the SmartHotel360 application tiers are now running on Azure VMs.

现在,Contoso 需要执行这些清理步骤:Now, Contoso needs to do these cleanup steps:

  • 在迁移完成后,停止复制。After the migration is complete, stop replication.
  • WEBVM从 vCenter 清单中删除计算机。Remove the WEBVM machine from the vCenter inventory.
  • SQLVM从 vCenter 清单中删除计算机。Remove the SQLVM machine from the vCenter inventory.
  • WEBVM SQLVM 从本地备份作业中删除和。Remove WEBVM and SQLVM from local backup jobs.
  • 更新内部文档以显示 Vm 的新位置和 IP 地址。Update internal documentation to show the new location and IP addresses for the VMs.
  • 查看与 VM 交互的所有资源,并更新所有相关设置或文档以反映新配置。Review any resources that interact with the VMs, and update any relevant settings or documentation to reflect the new configuration.

查看部署Review the deployment

在应用程序现已运行的情况下,Contoso 需要在 Azure 中完全操作和保护它。With the application now running, Contoso needs to fully operationalize and secure it in Azure.

安全性Security

Contoso 安全团队查看 Azure Vm 以确定任何安全问题。The Contoso security team reviews the Azure VMs to determine any security issues. 若要控制访问,团队需审查 VM 的网络安全组 (NSG)。To control access, the team reviews the network security groups (NSGs) for the VMs. Nsg 用于确保仅允许应用程序访问的流量。NSGs are used to ensure that only traffic allowed to the application can reach it. 此团队还会考虑使用 Azure 磁盘加密和 Key Vault 来保护磁盘上的数据。The team also considers securing the data on the disk by using Azure Disk Encryption and Key Vault.

有关详细信息,请参阅 Azure 中 IaaS 工作负荷的最佳安全方案For more information, see Security best practices for IaaS workloads in Azure.

业务连续性和灾难恢复Business continuity and disaster recovery

对于业务连续性和灾难恢复,Contoso 采取了以下措施:For business continuity and disaster recovery, Contoso takes the following actions:

许可和成本优化Licensing and cost optimization

Contoso 现有的 Vm 许可,并将利用 Azure 混合权益。Contoso has existing licensing for its VMs and will take advantage of the Azure Hybrid Benefit. Contoso 将对现有的 Azure VM 进行转换,以利用此定价的优势。Contoso will convert the existing Azure VMs to take advantage of this pricing.

Contoso 将启用 Azure 成本管理 + 计费 ,以帮助监视和管理 azure 资源。Contoso will enable Azure Cost Management + Billing to help monitor and manage Azure resources.

结论Conclusion

在本文中,Contoso 重新承载 Azure 中的 SmartHotel360 应用程序。In this article, Contoso rehosted the SmartHotel360 application in Azure. 管理员使用 Azure Migrate: Server 迁移工具将应用程序 Vm 迁移到 Azure Vm。The admins migrated the application VMs to Azure VMs by using the Azure Migrate: Server Migration tool. 你还可以查看已在 DevOps 生成器中发布的 Azure DevOps 项目。You can also review the Azure DevOps projects which have been published in the DevOps generator. 进入生成器后,在 "云采用框架导航" 下下载 服务器迁移项目Once in the generator, download the Server Migration Project under the Cloud Adoption Framework navigation.