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

通过迁移到 Azure Vm 和 Azure SQL 托管实例来 Rehost 本地应用程序Rehost an on-premises application by migrating to Azure VMs and Azure SQL Managed Instance

本文介绍了虚构的公司 Contoso 如何使用 Azure Migrate 将运行在 VMware 虚拟机上的两层 Windows .NET 前端应用程序迁移 (Vm) 到 Azure VM。This article shows how the fictional company Contoso migrates a two-tier Windows .NET front-end application running on VMware virtual machines (VMs) to an Azure VM by using Azure Migrate. 它还显示 Contoso 如何将应用程序数据库迁移到 Azure SQL 托管实例。It also shows how Contoso migrates the application database to Azure SQL Managed Instance.

本示例中使用的 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, download it from GitHub.

业务驱动因素Business drivers

Contoso 的 IT 领导团队已经与公司的业务合作伙伴密切合作,以了解该企业想要如何实现此迁移。Contoso's IT leadership team has worked closely with the company's business partners to understand what the business wants to achieve with this migration. 它们需要:They want to:

  • 解决业务增长。Address business growth. Contoso 在不断发展。Contoso is growing. 因此,公司的本地系统和基础结构面临的压力也越来越大。As a result, pressure has increased on the company's on-premises systems and infrastructure.
  • 提高效率。Increase efficiency. Contoso 需要摒弃不必要的流程,简化开发人员和用户流程。Contoso needs to remove unnecessary procedures and streamline processes for its developers and users. 业务需要快速而不是浪费时间或金钱,使公司能够更快地提供客户需求。The business needs IT to be fast and not waste time or money for the company to deliver faster on customer requirements.
  • 提高灵活性。Increase agility. Contoso IT 需要对业务需求更加敏感。Contoso IT needs to be more responsive to the needs of the business. 它必须比 marketplace 中发生的更改更快,使公司能够在全球经济中取得成功。It must react faster than the changes that occur in the marketplace for the company to be successful in a global economy. 同时它不能阻碍发展,成为业务的绊脚石。IT at Contoso must not get in the way or become a business blocker.
  • 纵向.Scale. 随着公司业务成功发展,Contoso IT 部门必须提供能够同步成长的系统。As the company's business grows successfully, Contoso IT must provide systems that can grow at the same pace.

迁移目标Migration goals

Contoso 云团队已确定本次迁移的目标。The Contoso cloud team has identified goals for this migration. 公司使用迁移目标确定最佳迁移方法。The company uses migration goals to determine the best migration method.

  • 迁移后,Azure 中的应用程序应具有与在 Contoso 的本地 VMware 环境中的应用程序目前相同的性能功能。After migration, the application in Azure should have the same performance capabilities that the application has today in Contoso's on-premises VMware environment. 迁移到云并不意味着应用程序性能不太重要。Moving to the cloud doesn't mean that application performance is less critical.
  • Contoso 不希望在应用程序中投入投资。Contoso doesn't want to invest in the application. 该应用程序对于业务至关重要且非常重要,但 Contoso 只是想要将应用程序以其当前形式移到云中。The application is critical and important to the business, but Contoso simply wants to move the application in its current form to the cloud.
  • 迁移应用程序后,应最大程度地减少数据库管理任务。Database administration tasks should be minimized after the application is migrated.
  • Contoso 不希望对此应用程序使用 Azure SQL 数据库。Contoso doesn't want to use Azure SQL Database for this application. 正在寻求替代项。It's looking for alternatives.

解决方案设计Solution design

在固定公司的目标和需求后,Contoso 设计和审查部署解决方案并识别迁移过程。After pinning down the company's goals and requirements, Contoso designs and reviews a deployment solution and identifies the migration process. 还将标识它将用于迁移的 Azure 服务。The Azure services that it will use for the migration also are identified.

当前体系结构Current architecture

  • Contoso 有一个主数据中心 (contoso-datacenter) 。Contoso has one main datacenter (contoso-datacenter). 数据中心位于东部美国的纽约。The datacenter is located in New York City in the eastern United States.
  • Contoso 在美国还有 3 家当地分支机构。Contoso has three additional local branches across the United States.
  • 使用光纤连接到 internet 连接到 internet 时, (每秒500兆位) 。The main datacenter is connected to the internet with a fiber-optic Metro Ethernet connection (500 megabits per second).
  • 每家分支机构均在本地使用业务级连接实现联网,使用 IPsec VPN 隧道连接回主要数据中心。Each branch is connected locally to the internet by using business-class connections with IPsec VPN tunnels back to the main datacenter. 此设置使得 Contoso 的整个网络永久连接不掉线,同时优化了 Internet 的连接性。The setup allows Contoso's entire network to be permanently connected and optimizes internet connectivity.
  • 主要数据中心通过 VMware 实现了完全的虚拟化处理。The main datacenter is fully virtualized with VMware. Contoso 有两台 ESXi 6.5 虚拟化主机,由 vCenter Server 6.5 进行托管。Contoso has two ESXi 6.5 virtualization hosts that are managed by vCenter Server 6.5.
  • Contoso 使用 Active Directory 进行标识管理。Contoso uses Active Directory for identity management. Contoso 在内网上使用 DNS 服务器。Contoso uses DNS servers on the internal network.
  • Contoso 有一个本地域控制器 (contosodc1) 。Contoso has an on-premises domain controller (contosodc1).
  • 域控制器在 VMware VM 上运行。The domain controllers run on VMware VMs. 而当地分支机构的域控制器在物理服务器上运行。The domain controllers at local branches run on physical servers.
  • SmartHotel360 应用程序跨两个 Vm 进行分层 (WEBVMSQLVM) 位于 VMware ESXi 版本6.5 主机 (contosohost1.contoso.com) 上。The SmartHotel360 application is tiered across two VMs (WEBVM and SQLVM) that are located on a VMware ESXi version 6.5 host (contosohost1.contoso.com).
  • 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 体系结构的关系图。

建议的体系结构Proposed architecture

在此方案中,Contoso 希望迁移其双层本地旅行应用程序,如下所示:In this scenario, Contoso wants to migrate its two-tier on-premises travel application as follows:

  • 将应用程序数据库 (SmartHotelDB) 迁移到 SQL 托管实例。Migrate the application database (SmartHotelDB) to a SQL managed instance.
  • 将前端迁移 WEBVM 到 AZURE VM。Migrate the front end, WEBVM, to an Azure VM.
  • 迁移完成时,Contoso 数据中心的本地 VM 将停止使用。The on-premises VMs in the Contoso datacenter will be decommissioned when the migration is finished.

方案体系结构的关系图。

数据库注意事项Database considerations

作为解决方案设计过程的一部分,Contoso 在 Azure SQL 数据库和 SQL 托管实例之间进行了一项功能比较。As part of the solution design process, Contoso did a feature comparison between Azure SQL Database and SQL Managed Instance. 以下注意事项有助于公司决定使用 SQL 托管实例。The following considerations helped the company decide to use SQL Managed Instance.

  • SQL 托管实例旨在提供与最新的本地 SQL Server 版本几乎100% 的兼容性。SQL Managed Instance aims to deliver almost 100% compatibility with the latest on-premises SQL Server version. 对于运行 SQL Server 本地或基础结构即服务的客户,我们建议使用 SQL 托管实例 (IaaS) Vm,并想要将其应用程序迁移到完全托管的服务,并对设计进行极少的更改。We recommend SQL Managed Instance for customers who are running SQL Server on-premises or on infrastructure as a service (IaaS) VMs and want to migrate their applications to a fully managed service with minimal design changes.
  • Contoso 计划将大量应用程序从本地迁移到 IaaS。Contoso is planning to migrate a large number of applications from on-premises to IaaS. 其中的许多应用程序都是 ISV 提供的。Many of these applications are ISV provided. Contoso 认识到使用 SQL 托管实例有助于确保这些应用程序的数据库兼容性,而不是使用可能不受支持的 SQL 数据库。Contoso realizes that using SQL Managed Instance will help ensure database compatibility for these applications, rather than using SQL Database, which might not be supported.
  • Contoso 可以使用完全自动化的 Azure 数据库迁移服务,执行到 SQL 托管实例的逐步迁移。Contoso can perform a lift-and-shift migration to SQL Managed Instance by using the fully automated Azure Database Migration Service. 部署此服务后,Contoso 在将来进行数据库迁移时可以重复使用它。With this service in place, Contoso can reuse it for future database migrations.
  • SQL 托管实例支持 SQL Server 代理 SmartHotel360 应用程序的重要组件。SQL Managed Instance supports SQL Server Agent, an important component of the SmartHotel360 application. Contoso 需要这种兼容性。Contoso needs this compatibility. 否则,必须重新设计应用程序所需的维护计划。Otherwise, it will have to redesign maintenance plans required by the application.
  • 使用软件保障,Contoso 可以通过使用 SQL Server 的 Azure 混合权益来交换其现有许可证,以获得 SQL 托管实例的折扣率。With Software Assurance, Contoso can exchange its existing licenses for discounted rates on a SQL managed instance by using the Azure Hybrid Benefit for SQL Server. 出于此原因,Contoso 可节省多达30% 的 SQL 托管实例。For this reason, Contoso can save up to 30 percent on SQL Managed Instance.
  • SQL 托管实例完全包含在虚拟网络中,因此它为 Contoso 的数据提供更强的隔离和安全性。SQL Managed Instance is fully contained in the virtual network, so it provides greater isolation and security for Contoso's data. Contoso 可以获得公有云的好处,同时使环境与公共 internet 隔离。Contoso can get the benefits of the public cloud while keeping the environment isolated from the public internet.
  • SQL 托管实例支持许多安全功能。SQL Managed Instance supports many security features. 它们包括 Always Encrypted、动态数据掩码、行级别安全性和威胁检测。They include Always Encrypted, dynamic data masking, row-level security, and threat detection.

解决方案评审Solution review

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

注意事项Consideration 详细信息Details
优点Pros WEBVM 将移动到 Azure,而不会发生更改,从而简化了迁移。WEBVM will be moved to Azure without changes, which makes the migration simple.

SQL 托管实例支持 Contoso 的技术要求和目标。SQL Managed Instance supports Contoso's technical requirements and goals.

SQL 托管实例将提供100% 的兼容性与 Contoso 当前的部署,同时使公司远离 SQL Server 2008 R2。SQL Managed Instance will provide 100 percent compatibility with Contoso's current deployment while moving the company away from SQL Server 2008 R2.

Contoso 可以利用其对软件保障的投资,并为 SQL Server 和 Windows Server 使用 Azure 混合权益。Contoso can take advantage of its investment in Software Assurance and use the Azure Hybrid Benefit for SQL Server and Windows Server.

Contoso 可以重复使用 Azure 数据库迁移服务,以进行更进一步的迁移。Contoso can reuse Azure Database Migration Service for additional future migrations.

SQL 托管实例具有内置的容错能力,Contoso 无需进行配置。SQL Managed Instance has built-in fault tolerance that Contoso doesn't need to configure. 此功能可确保数据层不再是单一故障点。This feature ensures that the data tier is no longer a single point of failure.
缺点Cons WEBVM 正在运行 Windows Server 2008 R2。WEBVM is running Windows Server 2008 R2. 尽管 Azure 支持此操作系统,但不再是受支持的平台。Although this operating system is supported by Azure, it's no longer a supported platform. 若要了解详细信息,请参阅 支持策略 Microsoft SQL Server 产品To learn more, see Support policy for Microsoft SQL Server products.

Web 层仍然是一个故障转移点,只 WEBVM 提供服务。The web tier remains a single point of failover with only WEBVM providing services.

Contoso 需要继续将应用程序 web 层支持为 VM,而不是迁移到托管服务,如 Azure App Service。Contoso will need to continue supporting the application web tier as a VM rather than moving to a managed service, such as Azure App Service.

对于数据层,如果 Contoso 要自定义操作系统或数据库服务器,或者如果公司想要运行第三方应用程序和 SQL Server,SQL 托管实例可能不是最佳解决方案。For the data tier, SQL Managed Instance might not be the best solution if Contoso wants to customize the operating system or the database server, or if the company wants to run third-party applications along with SQL Server. 在 IaaS VM 上运行 SQL Server 可提供这种灵活性。Running SQL Server on an IaaS VM could provide this flexibility.

迁移过程Migration process

Contoso 会通过完成以下步骤将其 SmartHotel360 应用程序的 web 层和数据层迁移到 Azure:Contoso will migrate the web and data tiers of its SmartHotel360 application to Azure by completing these steps:

  1. Contoso 已部署有 Azure 基础结构,因此只需为此方案添加几个特定的 Azure 组件即可。Contoso already has its Azure infrastructure in place, so it just needs to add a couple of specific Azure components for this scenario.

  2. 数据层将使用 Azure 数据库迁移服务进行迁移。The data tier will be migrated by using Azure Database Migration Service. 此服务通过 Contoso 数据中心与 Azure 之间的站点到站点 VPN 连接连接到本地 SQL Server VM。This service connects to the on-premises SQL Server VM across a Site-to-Site VPN connection between the Contoso datacenter and Azure. 然后,该服务将迁移数据库。The service then migrates the database.

  3. Web 层将通过使用 "Azure Migrate" 进行迁移。The web tier will be migrated by using a lift-and-shift migration by using Azure Migrate. 该进程需要准备本地 VMware 环境、设置和启用复制操作,同时通过将 VM 故障转移到 Azure 实现 VM 迁移。The process entails preparing the on-premises VMware environment, setting up and enabling replication, and migrating the VMs by failing them over to Azure.

    迁移体系结构示意图。

Azure 服务Azure services

服务Service 说明Description 成本Cost
Azure 数据库迁移服务Azure Database Migration Service Azure 数据库迁移服务实现了从多个数据库源到 Azure 数据平台的无缝迁移,且停机时间最短。Azure Database Migration Service enables seamless migration from multiple database sources to Azure data platforms with minimal downtime. 了解 受支持的区域Azure 数据库迁移服务的定价Learn about supported regions and Azure Database Migration Service pricing.
Azure SQL 托管实例Azure SQL Managed Instance SQL 托管实例是一种托管数据库服务,表示 Azure 云中完全托管的 SQL Server 实例。SQL Managed Instance is a managed database service that represents a fully managed SQL Server instance in the Azure cloud. 它使用的代码与 SQL Server 数据库引擎的最新版本相同,并具有最新的功能、性能改进和安全修补程序。It uses the same code as the latest version of SQL Server Database Engine and has the latest features, performance improvements, and security patches. 使用在 Azure 中运行的 SQL 托管实例会根据容量收取费用。Using a SQL managed instance running in Azure incurs charges based on capacity. 了解有关 SQL 托管实例定价的详细信息。Learn more about SQL Managed Instance pricing.
Azure MigrateAzure Migrate Contoso 使用 Azure Migrate 对其 VMware Vm 进行评估。Contoso uses Azure Migrate to assess its VMware VMs. Azure Migrate 评估计算机是否适合迁移。Azure Migrate assesses the migration suitability of the machines. 它对在 Azure 中运行时的大小和成本进行估算。It provides sizing and cost estimates for running in Azure. 无需额外付费即可使用 Azure Migrate。Azure Migrate is available at no additional charge. 它们可能会产生费用,具体取决于 (第一方或独立软件供应商) 他们决定用于评估和迁移的工具。They might incur charges depending on the tools (first-party or independent software vendor) they decide to use for assessment and migration. 了解有关 Azure Migrate 定价的详细信息。Learn more about Azure Migrate pricing.

先决条件Prerequisites

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

要求Requirements 详细信息Details
Azure 订阅Azure subscription Contoso 已经在本系列的第一篇文章中创建了订阅。Contoso already created a subscription in the first 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 of the subscription, work with the admin to assign you Owner or Contributor permissions to the necessary resource groups and resources.
Azure 基础结构Azure infrastructure Contoso 根据 用于迁移的 azure 基础结构中所述设置其 azure 基础结构。Contoso set up its Azure infrastructure as described in Azure infrastructure for migration.
本地服务器On-premises servers 本地 vCenter Server 应运行版本5.5、6.0 或6.5。The on-premises vCenter Server should be running version 5.5, 6.0, or 6.5.

ESXi 主机应运行版本5.5、6.0 或6.5。An ESXi host should be running version 5.5, 6.0, or 6.5.

ESXi 主机上应运行有一个或多个 VMware VM。One or more VMware VMs should be running on the ESXi host.
本地 VMOn-premises VMs 查看已获允在 Azure 上运行的 Linux 计算机Review Linux machines that are endorsed to run on Azure.
数据库迁移服务Database Migration Service 对于 Azure 数据库迁移服务,需要一个 兼容的本地 VPN 设备For Azure Database Migration Service, you need a compatible on-premises VPN device.

必须能够配置本地 VPN 设备。You must be able to configure the on-premises VPN device. 它必须有一个面向外部的公共 IPv4 地址。It must have an external-facing public IPv4 address. 该地址不能位于 NAT 设备之后。The address can't be located behind a NAT device.

请确保可以访问本地 SQL Server 数据库。Make sure you can access your on-premises SQL Server database.

Windows 防火墙应该能够访问源数据库引擎。Windows Firewall should be able to access the source database engine. 了解如何为 数据库引擎访问配置 Windows 防火墙Learn how to configure Windows Firewall for database engine access.

如果数据库计算机的前面有防火墙,请添加规则,以允许通过 SMB 端口 445 访问数据库和文件。If there's a firewall in front of your database machine, add rules to allow access to the database and files via SMB port 445.

用于连接到源 SQL Server 实例和目标 SQL 托管实例的凭据必须是 sysadmin 服务器角色的成员。The credentials that are used to connect to the source SQL Server instance and that target SQL Managed Instance must be members of the sysadmin server role.

你需要 Azure 数据库迁移服务可用于备份源数据库的本地数据库中的网络共享。You need a network share in your on-premises database that Azure Database Migration Service can use to back up the source database.

确保运行源 SQL Server 实例的服务帐户对该网络共享拥有写入权限。Make sure that the service account running the source SQL Server instance has write permissions on the network share.

记下在该网络共享中拥有完全控制权限的 Windows 用户和密码。Make a note of a Windows user and password that has full control permissions on the network share. Azure 数据库迁移服务模拟这些用户凭据,将备份文件上传到 Azure 存储容器。Azure Database Migration Service impersonates these user credentials to upload backup files to the Azure Storage container.

SQL Server Express 安装过程默认会将 TCP/IP 协议设置为“已禁用”。The SQL Server Express installation process sets the TCP/IP protocol to Disabled by default. 请确保已启用该协议。Make sure that it's enabled.

方案步骤Scenario steps

Contoso 计划按以下流程设置部署:Here's how Contoso plans to set up the deployment:

  • 步骤1:准备 SQL 托管实例。Step 1: Prepare a SQL managed instance. Contoso 需要现有托管实例,以便将本地 SQL Server 数据库迁移到其中。Contoso needs an existing managed instance to which the on-premises SQL Server database will migrate.
  • 步骤2:准备 Azure 数据库迁移服务。Step 2: Prepare Azure Database Migration Service. Contoso 必须注册数据库迁移提供程序,创建实例,然后创建数据库迁移服务项目。Contoso must register the database migration provider, create an instance, and then create a Database Migration Service project. Contoso 还必须 (SAS) 统一资源标识符 (URI) 为数据库迁移服务实例设置共享访问签名。Contoso also must set up a shared access signature (SAS) uniform resource identifier (URI) for the Database Migration Service instance. SAS URI 提供对 Contoso 存储帐户中的资源的委托访问权限,以便 Contoso 可以对存储对象授予有限的权限。An SAS URI provides delegated access to resources in Contoso's storage account so that Contoso can grant limited permissions to storage objects. Contoso 设置 SAS URI,使 Azure 数据库迁移服务能够访问该服务将 SQL Server 备份文件上传到的存储帐户容器。Contoso sets up an SAS URI so that Azure Database Migration Service can access the storage account container to which the service uploads the SQL Server backup files.
  • 步骤3:为 Azure Migrate: Server 迁移工具准备 Azure。Step 3: Prepare Azure for the Azure Migrate: Server Migration tool. Contoso 将服务器迁移工具添加到其 Azure Migrate 项目。Contoso adds the server migration tool to its Azure Migrate project.
  • 步骤4:准备 Azure Migrate 的本地 VMware:服务器迁移。Step 4: Prepare on-premises VMware for Azure Migrate: Server Migration. Contoso 为 VM 发现准备帐户,并准备在迁移后连接到 Azure Vm。Contoso prepares accounts for VM discovery and prepares to connect to Azure VMs after migration.
  • 步骤5:复制本地 Vm。Step 5: Replicate the on-premises VMs. Contoso 设置复制并开始将 Vm 复制到 Azure 存储。Contoso sets up replication and starts replicating VMs to Azure Storage.
  • 步骤6:通过 Azure 数据库迁移服务迁移数据库。Step 6: Migrate the database via Azure Database Migration Service. Contoso 迁移数据库。Contoso migrates the database.
  • 步骤7:迁移 Vm 并 Azure Migrate:服务器迁移。Step 7: Migrate the VMs with Azure Migrate: Server Migration. Contoso 运行测试迁移,确保一切正常,并运行完整的迁移,将 VM 移到 Azure。Contoso runs a test migration to make sure everything's working and then runs a full migrate to move the VM to Azure.

步骤1:准备 SQL 托管实例Step 1: Prepare a SQL managed instance

若要设置 SQL 托管实例,Contoso 需要一个满足以下要求的子网:To set up a SQL managed instance, Contoso needs a subnet that meets the following requirements:

  • 子网必须是专用网络。The subnet must be dedicated. 它必须为空。It must be empty. 它不能包含任何其他云服务。It can't contain any other cloud service. 子网不能为网关子网。The subnet can't be a gateway subnet.
  • 创建托管实例之后,Contoso 不应向子网中添加资源。After the managed instance is created, Contoso shouldn't add resources to the subnet.
  • 该子网不能有关联的网络安全组。The subnet can't have a network security group associated with it.
  • 子网必须有用户定义的路由表。The subnet must have a user-defined route table. 分配的唯一路由应该是 0.0.0.0/0 下一个跃点 internet。The only route assigned should be 0.0.0.0/0 next-hop internet.
  • 如果为虚拟网络指定了可选的自定义 DNS,则 168.63.129.16 必须将 Azure 中递归解析程序的虚拟 IP 地址添加到列表。If an optional custom DNS is specified for the virtual network, the virtual IP address 168.63.129.16 for the recursive resolvers in Azure must be added to the list. 了解如何为 SQL 托管实例配置自定义 DNSLearn how to configure custom DNS for a SQL managed instance.
  • 该子网不能有关联的服务终结点(存储或 SQL)。The subnet must not have a service endpoint (storage or SQL) associated with it. 应在虚拟网络上禁用服务终结点。Service endpoints should be disabled on the virtual network.
  • 该子网必须至少有 16 个 IP 地址。The subnet must have a minimum of 16 IP addresses. 了解如何 调整托管实例子网的大小Learn how to size the managed instance subnet.
  • 在 Contoso 混合环境中,自定义 DNS 设置为必需项。In Contoso's hybrid environment, custom DNS settings are required. Contoso 将 DNS 设置配置为使用一个或多个公司 Azure DNS 服务器。Contoso configures DNS settings to use one or more of the company's Azure DNS servers. 详细了解 DNS 自定义Learn more about DNS customization.

为托管实例设置虚拟网络Set up a virtual network for the managed instance

若要设置虚拟网络,Contoso 管理员:To set up the virtual network, the Contoso admins:

  1. VNET-SQLMI-EU2在主区域 () 中创建新的虚拟网络 () East US 2Create a new virtual network (VNET-SQLMI-EU2) in the primary region (East US 2). 它将虚拟网络添加到 ContosoNetworkingRG 资源组。It adds the virtual network to the ContosoNetworkingRG resource group.

  2. 分配的地址空间 10.235.0.0/24Assign an address space of 10.235.0.0/24. 确保范围不与企业中任何其他网络重叠。They ensure that the range doesn't overlap with any other networks in its enterprise.

  3. 向网络添加两个子网:Add two subnets to the network:

    • SQLMI-DS-EUS2 (10.235.0.0/25).SQLMI-DS-EUS2 (10.235.0.0/25).

    • SQLMI-SAW-EUS2 (10.235.0.128/29).SQLMI-SAW-EUS2 (10.235.0.128/29). 此子网用于将目录附加到托管实例。This subnet is used to attach a directory to the managed instance.

      显示 SQL 托管实例的屏幕截图: "创建虚拟网络" 窗格。

  4. 部署虚拟网络和子网之后,按如下所述进行网络对等互连:After the virtual network and subnets are deployed, they peer networks as follows:

    • VNET-SQLMI-EUS2VNET-HUB-EUS2 () 中的中心虚拟网络 East US 2Peers VNET-SQLMI-EUS2 with VNET-HUB-EUS2 (the hub virtual network in East US 2).

    • VNET-SQLMI-EUS2VNET-PROD-EUS2 生产网络) (的对等方。Peers VNET-SQLMI-EUS2 with VNET-PROD-EUS2 (the production network).

      显示网络对等互连的屏幕截图。

  5. 设置自定义 DNS 设置。Set custom DNS settings. DNS 先指向 Contoso 的 Azure 域控制器。DNS points first to Contoso's Azure domain controllers. Azure DNS 为辅助设置。Azure DNS is secondary. Contoso Azure 域控制器位置如下所示:The Contoso Azure domain controllers are located as follows:

    • 位于 PROD-DC-EUS2 子网中的 East US 2 生产网络 (VNET-PROD-EUS2) 。Located in the PROD-DC-EUS2 subnet, in the East US 2 production network (VNET-PROD-EUS2).

    • CONTOSODC3 地址: 10.245.42.4CONTOSODC3 address: 10.245.42.4.

    • CONTOSODC4 地址: 10.245.42.5CONTOSODC4 address: 10.245.42.5.

    • Azure DNS 解析程序: 168.63.129.16Azure DNS resolver: 168.63.129.16.

      显示网络 DNS 服务器的屏幕截图。

需要更多帮助?Need more help?

设置路由Set up routing

托管实例放置在专用虚拟网络中。The managed instance is placed in a private virtual network. Contoso 需要一个用于虚拟网络的路由表,以便与 Azure 管理服务通信。Contoso needs a route table for the virtual network to communicate with the Azure management service. 如果虚拟网络不能与管理它的服务进行通信,则无法访问虚拟网络。If the virtual network can't communicate with the service that manages it, the virtual network becomes inaccessible.

Contoso 会考虑以下因素:Contoso considers these factors:

  • 路由表包含一组规则 (路由) 指定如何在虚拟网络中路由从托管实例发送的数据包。The route table contains a set of rules (routes) that specify how packets sent from the managed instance should be routed in the virtual network.
  • 路由表与部署托管实例的子网相关联。The route table is associated with subnets where managed instances are deployed. 离开子网的每个数据包均根据关联的路由表进行处理。Each packet that leaves a subnet is handled based on the associated route table.
  • 子网仅能与一个路由表相关联。A subnet can be associated with only one route table.
  • 在 Microsoft Azure 中创建路由表不额外产生费用。There are no additional charges for creating route tables in Microsoft Azure.

若要设置路由,Contoso 管理员需要执行以下步骤:To set up routing, the Contoso admins do the following steps:

  1. 在资源组中创建用户定义的路由表 ContosoNetworkingRGCreate a user-defined route table in the ContosoNetworkingRG resource group.

    显示路由表的屏幕截图。

  2. 为了符合 SQL 托管实例要求,在部署路由表 (MIRouteTable) 后,它们将添加一个地址前缀为的路由 0.0.0.0/0To comply with SQL Managed Instance requirements, after the route table (MIRouteTable) is deployed, they add a route that has an address prefix of 0.0.0.0/0. 将“下一个跃点类型”选项设置为“Internet”。The Next hop type option is set to Internet.

    显示路由表前缀的屏幕截图。

  3. 将路由表与 SQLMI-DB-EUS2 网络) 中的子网 (相关联 VNET-SQLMI-EUS2Associate the route table with the SQLMI-DB-EUS2 subnet (in the VNET-SQLMI-EUS2 network).

    显示路由表子网的屏幕截图。

需要更多帮助?Need more help?

了解如何 设置托管实例的路由Learn how to set up routes for a managed instance.

创建托管实例Create a managed instance

Contoso 管理员现在可以预配 SQL 托管实例:Now the Contoso admins can provision a SQL managed instance:

  1. 由于托管实例提供业务应用程序,因此,它们会在公司的主要区域 () 中部署托管实例 East US 2Because the managed instance serves a business application, they deploy the managed instance in the company's primary region (East US 2). 它们将托管实例添加到 ContosoRG 资源组。They add the managed instance to the ContosoRG resource group.

  2. 选择实例的定价层、计算大小和存储。They select a pricing tier, size compute, and storage for the instance. 了解有关 SQL 托管实例定价的详细信息。Learn more about SQL Managed Instance pricing.

    显示 "SQL 托管实例" 窗格的屏幕截图。

  3. 部署托管实例后,资源组中将显示两个新资源 ContosoRGAfter the managed instance is deployed, two new resources appear in the ContosoRG resource group:

    • SQL 托管实例。The SQL managed instance.

    • 一个虚拟群集,其中 Contoso 有多个托管实例。A virtual cluster in case Contoso has multiple managed instances.

      显示两个新资源的屏幕截图。

需要更多帮助?Need more help?

了解如何 预配托管实例Learn how to provision a managed instance.

步骤2:准备 Azure 数据库迁移服务Step 2: Prepare Azure Database Migration Service

为了准备 Azure 数据库迁移服务,Contoso 管理员需要执行以下操作:To prepare Azure Database Migration Service, the Contoso admins need to do a few things:

  • 在 Azure 中注册数据库迁移服务提供程序。Register the Database Migration Service provider in Azure.
  • 为数据库迁移服务授予访问 Azure 存储的权限,以便上传用于迁移数据库的备份文件。Grant permission for Database Migration Service to access Azure Storage for uploading the backup files that are used to migrate a database. 若要提供对 Azure 存储的访问权限,请创建 Azure Blob 存储容器。To provide access to Azure Storage, create an Azure Blob Storage container. 为 Blob 存储容器生成 SAS URI。Generate an SAS URI for the Blob Storage container.
  • 创建 Azure 数据库迁移服务项目。Create an Azure Database Migration Service project.

它们完成了以下步骤:They complete the following steps:

  1. 将数据库迁移提供程序注册到其订阅下。Register the database migration provider under its subscription. 显示数据库迁移服务注册的屏幕截图。

  2. 创建 Azure Blob 存储容器。Create an Azure Blob Storage container. Contoso 生成 SAS URI,使 Azure 数据库迁移服务能够访问它。Contoso generates an SAS URI so that Azure Database Migration Service can access it.

    显示生成 SAS URI 的屏幕截图。

  3. 创建 Azure 数据库迁移服务实例。Create an Azure Database Migration Service instance.

    显示创建实例的屏幕截图。

  4. 将数据库迁移服务实例置于 PROD-DC-EUS2 虚拟网络的子网中 VNET-PROD-DC-EUS2Place the Database Migration Service instance in the PROD-DC-EUS2 subnet of the VNET-PROD-DC-EUS2 virtual network.

    • 此实例位于此处,因为该服务必须位于可通过 VPN 网关访问本地 SQL Server VM 的虚拟网络中。The instance is placed here because the service must be in a virtual network that can access the on-premises SQL Server VM via a VPN gateway.

    • VNET-PROD-EUS2 将对等互连到 VNET-HUB-EUS2 ,并允许使用远程网关。VNET-PROD-EUS2 is peered to VNET-HUB-EUS2 and is allowed to use remote gateways. " 使用远程网关 " 选项可确保实例可以根据需要进行通信。The Use remote gateways option ensures that the instance can communicate as required.

      显示配置网络的屏幕截图。

需要更多帮助?Need more help?

步骤3:为 Azure Migrate 准备 Azure: Server 迁移工具Step 3: Prepare Azure for the Azure Migrate: Server Migration tool

Contoso 需具备以下 Azure 组件才能将 VM 迁移到 Azure:Here are the Azure components Contoso needs to migrate the VMs to Azure:

  • 在迁移过程中创建 Azure Vm 时,Azure Vm 将位于其中的虚拟网络。A virtual network in which Azure VMs will be located when they're created during migration.
  • Azure Migrate:服务器迁移工具已预配。The Azure Migrate: Server Migration tool provisioned.

Contoso 管理员设置以下组件:The Contoso admins set up these components:

  1. 设置网络。Set up a network. Contoso 已设置网络,该网络可用于在 部署 Azure 基础结构时进行 Azure Migrate:服务器迁移。Contoso already set up a network 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) of the production network.
    • 应用程序数据库 VM (SQLVM) 会迁移到 (PROD-DB-EUS2 生产网络) 的数据库子网。The application database VM (SQLVM) will migrate to the database subnet (PROD-DB-EUS2) of the production network.

步骤4:准备 Azure Migrate 的本地 VMware:服务器迁移Step 4: Prepare on-premises VMware for Azure Migrate: Server Migration

Contoso 需具备以下 Azure 组件才能将 VM 迁移到 Azure:Here are the Azure components Contoso needs to migrate the VMs to Azure:

  • 在迁移过程中创建 Azure Vm 时,Azure Vm 将位于其中的虚拟网络。A virtual network in which Azure VMs will be located when they're created during migration.
  • Azure Migrate 设备,预配和配置。The Azure Migrate appliance, provisioned and configured.

Contoso 管理员通过执行以下步骤设置这些组件:The Contoso admins set up these components by following these steps:

  1. 设置网络。Set up a network. Contoso 已设置网络,该网络可用于在 部署 Azure 基础结构时进行 Azure Migrate:服务器迁移。Contoso already set up a network 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 appliance.

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

      显示下载 .OVA 文件的屏幕截图。

    2. 按照以下步骤启动导入的映像并配置该工具:Start the imported image and configure the tool by following these steps:

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

        显示必备组件设置的屏幕截图。

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

        显示选择订阅的屏幕截图

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

        显示设置 VMware vCenter 凭据的屏幕截图。

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

        显示设置 Linux 和 Windows 凭据的屏幕截图。

  3. 完成配置后,该工具将需要一段时间来枚举所有虚拟机。After configuration, it takes some time for the tool to enumerate all the virtual machines. 完成此过程后,Contoso 管理员可以看到在 Azure 的 Azure Migrate 工具中填充的虚拟机。After the process is finished, the Contoso admins can see the VMs populated in the Azure Migrate tool in Azure.

需要更多帮助?Need more help?

了解如何设置 Azure Migrate 设备Learn about how to set up the Azure Migrate appliance.

准备本地 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, they:

    • 迁移之前,在本地 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, they:

    • 迁移之前,在本地 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 agent:They install the Azure agent:

  4. 其他注意事项:Other considerations:

    • 对于 Windows,触发迁移时,VM 上应该不会有任何挂起的 Windows 更新。For Windows, there should be no Windows updates pending on the VM when triggering a migration. 如果有,则在更新完成之前,这些用户将无法登录到 VM。If there are, they won't be able to sign in to the VM until the update finishes.
    • 迁移后,他们可以检查 启动诊断 以查看 VM 的屏幕截图。After migration, they 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 these troubleshooting tips.

需要更多帮助?Need more help?

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

步骤5:复制本地 VmStep 5: 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, they go to Servers > Azure Migrate: Server Migration. 然后选择 " 复制"。Then they select Replicate.

    显示复制选项的屏幕截图。

  2. 复制 > 源设置 中, > 计算机是否已虚拟化?,它们选择 "是",并 VMware vSphereIn Replicate > Source settings > Are your machines virtualized?, they select Yes, with VMware vSphere.

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

    显示“源设置”选项卡的屏幕截图。

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

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

    显示选择评估的屏幕截图。

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

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

  7. Azure 混合权益 中,它们:In Azure Hybrid Benefit, they:

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

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

    • 可以从复制中排除磁盘。They can exclude disks from replication.
    • 如果排除了磁盘,则在迁移后它们将不会出现在 Azure VM 中。If disks are excluded, they won't be present on the Azure VM after migration.
  10. 若要 查看和开始复制,请查看设置。In Review + start replication, they review the settings. 然后选择 " 复制 ",为服务器启动初始复制。Then they select Replicate to start the initial replication for the servers.

备注

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

步骤6:通过 Azure 数据库迁移服务迁移数据库Step 6: Migrate the database via Azure Database Migration Service

Contoso 管理员需要创建一个数据库迁移服务项目,然后迁移数据库。The Contoso admins need to create a Database Migration Service project and then migrate the database.

创建 Azure 数据库迁移服务项目Create an Azure Database Migration Service project

  1. 管理员创建数据库迁移服务项目。The admins create a Database Migration Service project. 它们选择 SQL Server 源服务器类型和 Azure SQL 托管实例 作为目标。They select the SQL Server source server type and Azure SQL Managed Instance as the target.

    显示 "新建迁移项目" 窗格的屏幕截图。

  2. 迁移向导随即打开。The Migration Wizard opens.

迁移数据库Migrate the database

  1. 在迁移向导中,指定本地数据库所在的源 VM。In the Migration Wizard, they specify the source VM on which the on-premises database is located. 输入用于访问数据库的凭据。They enter the credentials to access the database.

    显示 "源详细信息" 窗格的屏幕截图。

  2. 它们选择要迁移的数据库 (SmartHotel.Registration) 。They select the database to migrate (SmartHotel.Registration).

    显示 "选择源数据库" 窗格的屏幕截图。

  3. 对于目标,它们会在 Azure 中输入托管实例的名称和访问凭据。For the target, they enter the name of the managed instance in Azure and the access credentials.

    显示 "目标详细信息" 窗格的屏幕截图。

  4. 新的活动 > 运行迁移 时,它们指定运行迁移的设置:In New Activity > Run migration, they specify settings to run the migration:

    • 源和目标凭据。Source and target credentials.

    • 要迁移的数据库。The database to migrate.

    • 在本地 VM 上创建的网络共享。The network share created on the on-premises VM. Azure 数据库迁移服务会将源备份到此共享。Azure Database Migration Service takes source backups to this share.

      • 运行源 SQL Server 实例的服务帐户必须具有此共享的写权限。The service account that runs the source SQL Server instance must have write permissions on this share.
      • 必须使用共享的 FQDN 路径。The FQDN path to the share must be used.
    • SAS URI,该 URI 为 Azure 数据库迁移服务提供访问权限的存储帐户容器的访问权限,服务会将备份文件上传到该容器。The SAS URI that provides Azure Database Migration Service with access to the storage account container to which the service uploads the backup files for migration.

      显示 "配置迁移设置" 屏幕的屏幕截图。

  5. 它们保存迁移设置,然后运行迁移。They save the migration settings and then run the migration.

  6. 在“概述”中监视迁移状态。In Overview, they monitor the migration status.

    显示状态的屏幕截图。

  7. 迁移完成后,它们将验证目标数据库是否存在于托管实例上。When migration is finished, they verify that the target databases exist on the managed instance.

    显示验证数据库迁移的屏幕截图。

步骤7:迁移 Vm 并 Azure Migrate:服务器迁移Step 7: Migrate the VMs with Azure Migrate: Server Migration

Contoso 管理员运行快速测试迁移并验证 VM 是否正常工作。The Contoso admins run a quick test migration and verify the VM is working properly. 然后,它们将迁移 VM。Then they migrate the VM.

运行测试迁移Run a test migration

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

    显示 "测试已迁移的服务器" 项的屏幕截图。

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

    显示测试迁移项的屏幕截图。

  3. 测试迁移 中,它们会选择 azure 虚拟网络,以便在迁移之后存放 azure VM。In Test migration, they select the Azure virtual network in which the Azure VM will be located after the migration. 建议使用非生产虚拟网络。We recommend using a nonproduction virtual network.

  4. “测试迁移”作业随即启动。The Test migration job starts. 它们监视门户通知中的作业。They monitor the job in the portal notifications.

  5. 迁移完成后,它们会在 "Azure 门户中的" 虚拟机 "视图中查看迁移的 Azure VM。After the migration finishes, they view the migrated Azure VM in Virtual Machines in the Azure portal. 计算机名称带有 -Test 后缀。The machine name has a suffix -Test.

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

    显示 "清理测试" 迁移项的屏幕截图。

迁移 VMMigrate the VM

现在,Contoso 管理员运行完全迁移来完成移动。Now the Contoso admins run a full migration to complete the move.

  1. 在 Azure Migrate 项目中,它们会转向 服务器 > Azure Migrate:服务器迁移,然后选择 复制服务器In the Azure Migrate project, they go to Servers > Azure Migrate: Server Migration and select Replicating servers.

    显示 "复制服务器" 项的屏幕截图。

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

  3. 在 "迁移 关闭 > 虚拟机" 和 "执行计划的迁移并不丢失数据" 中,选择 "是 > " "确定"In Migrate > Shut down virtual machines and perform a planned migration with no data loss, they 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 occurred. 此操作可确保不会丢失数据。This action ensures no data loss.
    • 如果他们不想关闭 VM,则选择 " "。If they don't want to shut down the VM, they select No.
  4. 随即会针对该 VM 启动一个迁移作业。A migration job starts for the VM. 它们跟踪 Azure 通知中的作业。They track the job in Azure notifications.

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

  6. 最后,它们会更新 WEBVM 其中一个 Contoso 域控制器上的 DNS 记录。Finally, they update the DNS records for WEBVM on one of the Contoso domain controllers.

更新连接字符串Update the connection string

作为迁移过程的最后一步,Contoso 管理员更新了应用程序的连接字符串,以指向运行在 SQL 托管实例上的已迁移数据库。As the final step in the migration process, the Contoso admins update the connection string of the application to point to the migrated database that's running on the SQL managed instance.

  1. 在 Azure 门户中,它们通过选择 "设置" "连接字符串" 来查找连接字符串 > 。In the Azure portal, they find the connection string by selecting Settings > Connection strings.

    显示连接字符串选项的屏幕截图。

  2. 它们将用 SQL 托管实例的用户名和密码来更新该字符串。They update the string with the user name and password of the SQL managed instance.

  3. 配置字符串后,它们将替换 web.config 其应用程序文件中的当前连接字符串。After the string is configured, they replace the current connection string in the web.config file of its application.

  4. 更新文件并保存后,它们会 WEBVM iisreset /restart 在命令提示符窗口中运行来重新启动 IIS。After they update the file and save it, they restart IIS on WEBVM by running iisreset /restart in a command prompt window.

  5. 重新启动 IIS 后,应用程序将使用 SQL 托管实例上运行的数据库。After IIS is restarted, the application uses the database that's running on the SQL managed instance.

  6. 此时,他们可以关闭本地 SQLVM 计算机。At this point, they can shut down the on-premises SQLVM machine. 迁移已完成。The migration is finished.

需要更多帮助?Need more help?

迁移后的清理Clean up after migration

完成迁移后,SmartHotel360 应用程序会在 Azure VM 上运行,SmartHotel360 数据库将在 Azure SQL 托管实例中可用。With the migration finished, the SmartHotel360 application is running on an Azure VM and the SmartHotel360 database is available in the Azure SQL managed instance.

现在,Contoso 需要执行以下清理任务:Now, Contoso needs to perform these cleanup tasks:

  • WEBVM从 vCenter Server 清单中删除计算机。Remove the WEBVM machine from the vCenter Server inventory.
  • SQLVM从 vCenter Server 清单中删除计算机。Remove the SQLVM machine from the vCenter Server inventory.
  • WEBVM SQLVM 从本地备份作业中删除和。Remove WEBVM and SQLVM from local backup jobs.
  • 更新内部文档以显示的新位置和 IP 地址 WEBVMUpdate internal documentation to show the new location and IP address for WEBVM.
  • SQLVM从内部文档中删除。Remove SQLVM from internal documentation. 另外,Contoso 还可以修改文档,使其显示 SQLVM 为已删除,不再位于 VM 清单中。Alternatively, Contoso can revise the documentation to show SQLVM as deleted and no longer in the VM inventory.
  • 查看与已解除授权的 VM 进行交互的任何资源。Review any resources that interact with the decommissioned VMs. 更新任何相关设置或文档以反映新配置。Update any relevant settings or documentation to reflect the new configuration.

查看部署Review the deployment

Azure 中存在已迁移的资源后,Contoso 需要全面运营并保护其新基础设施。With the migrated resources in Azure, Contoso needs to fully operationalize and secure its new infrastructure.

安全性Security

Contoso 安全团队检查 Azure Vm 和 SQL 托管实例,以了解实现中的任何安全问题:The Contoso security team checks the Azure VMs and the SQL managed instance for any security issues in the implementation:

  • 团队审查用来控制对 VM 访问的网络安全组。The team reviews the network security groups that are used to control access for the VM. 网络安全组可帮助确保仅允许应用程序可以通过的流量。Network security groups help ensure that only traffic that's allowed to the application can pass.

  • Contoso 的安全团队还在考虑通过使用 Azure 磁盘加密和 Azure Key Vault 保护磁盘上的数据。Contoso's security team also is considering securing the data on the disk by using Azure Disk Encryption and Azure Key Vault.

  • 团队对托管实例启用威胁检测。The team enables threat detection on the managed instance. 如果检测到威胁,威胁检测会向 Contoso 的安全团队/服务台系统发送警报以创建票证。Threat detection sends an alert to Contoso's security team/service desk system to open a ticket if a threat is detected. 了解有关 SQL 托管实例的威胁检测的详细信息。Learn more about threat detection for SQL Managed Instance.

    显示 SQL 托管实例安全:威胁检测屏幕的屏幕截图。

若要详细了解 VM 的安全做法,请参阅Azure 中 IaaS 工作负荷的安全性最佳实践To learn more about security practices for VMs, 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 现有的许可 WEBVMContoso has existing licensing for WEBVM. 为利用 Azure 混合权益的定价优势,Contoso 转换现有 Azure VM。To take advantage of pricing with Azure Hybrid Benefit, Contoso converts the existing Azure VM.
  • Contoso 将使用 Azure 成本管理 + 计费 来确保公司始终处于 IT 领导地位确立的预算范围内。Contoso will use Azure Cost Management + Billing to ensure the company stays within budgets established by the IT leadership.

结论Conclusion

在本文中,Contoso 通过使用 Azure Migrate 将应用程序前端 VM 迁移到 Azure,在 Azure 中原名不同 SmartHotel360 应用程序。In this article, Contoso rehosts the SmartHotel360 application in Azure by migrating the application front-end VM to Azure by using Azure Migrate. Contoso 使用 Azure 数据库迁移服务将本地数据库迁移到 SQL 托管实例。Contoso migrates the on-premises database to a SQL managed instance by using Azure Database Migration Service.