在 Azure Vm 上重新裝載內部部署應用程式Rehost an on-premises app on Azure VMs

本文示範虛構公司 Contoso 如何藉由將應用程式 VM 移轉至 Azure VM,重新裝載在 VMware VM 上執行的兩層式 Windows .NET 前端應用程式。This article demonstrates how the fictional company Contoso rehosts a two-tier Windows .NET front-end app running on VMware VMs, by migrating the app VMs to Azure VMs.

此範例中使用的 SmartHotel360 應用程式以開放原始碼的形式提供。The SmartHotel360 app used in this example is provided as open source. 如果想將它用於自己的測試目的,您可以從 github 進行下載。If you'd like 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:

  • 解決業務成長。Address business growth. Contoso 的業務量日益增多,對其內部部署系統和基礎結構造成了壓力。Contoso is growing, and as a result there is pressure on their on-premises systems and infrastructure.
  • 限制風險。Limit risk. SmartHotel360 應用程式對 Contoso 的業務影響甚大。The SmartHotel360 app is critical for the Contoso business. Contoso 想要在亳無風險的情況下,將應用程式移至 Azure。It wants to move the app to Azure with zero risk.
  • 延遲.Extend. Contoso 不想要修改應用程式,但想要確保其穩定性。Contoso doesn't want to modify the app, but does want to ensure that it's stable.

移轉目標Migration goals

Contoso 雲端小組已針對此次移轉擬定好各項目標。The Contoso cloud team has pinned down goals for this migration. 這些目標是用來判斷最合適的移轉方法:These goals are used to determine the best migration method:

  • 移轉之後,應用程式不管是在 Azure 或 VMware 中,應具有相同效能。After migration, the app in Azure should have the same performance capabilities as it does today in VMware. 應用程式不管是在雲端中或在內部部署,都一樣重要。The app will remain as critical in the cloud as it is on-premises.
  • Contoso 不想要投資此應用程式。Contoso doesn't want to invest in this app. 這對企業很重要,但以其目前的格式而言,Contoso 只想安全地移至雲端。It is important to the business, but in its current form Contoso simply wants to move it safely to the cloud.
  • Contoso 不想變更這個應用程式的 ops 模型。Contoso doesn't want to change the ops model for this app. Contoso 想要按照目前的方式,與其在雲端中互動。Contoso do want to interact with it in the cloud in the same way that they do now.
  • Contoso 不想變更任何應用程式的功能。Contoso doesn't want to change any app functionality. 只會變更應用程式位置。Only the app location will change.

解決方案設計Solution design

擬定好目標和需求後,Contoso 會設計和檢閱部署解決方案,並識別移轉程序,包括 Contoso 會用於移轉的 Azure 服務。After pinning down goals and requirements, Contoso designs and review a deployment solution, and identifies the migration process, including the Azure services that Contoso will use for the migration.

目前的應用程式Current app

  • 應用程式會跨兩個 Vm (WEBVMSQLVM)進行分層。The app 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 環境是由在 VM 上執行的 vCenter Server 6.5 (vcenter.contoso.com)所管理。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 會位於生產資源群組 ContosoRG 中。Since the app is a production workload, the app VMs in Azure will reside in the production resource group ContosoRG.
  • 應用程式 VM 將會遷移到主要 Azure 區域 (美國東部 2),並且放在生產網路 (VNET-PROD-EUS2) 中。The app 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-EUS2)。The database VM will reside in the database subnet (PROD-DB-EUS2) in the production network.
  • 在遷移完成後,Contoso 資料中心內的內部部署 Vm 將會解除委任。The on-premises VMs in the Contoso data-center will be decommissioned after the migration is done.


資料庫考量Database considerations

在解決方案設計過程中,Contoso 會進行 Azure SQL Database 與 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 them to decide to go with 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 if it might want to colocate and run third-party apps on the same VM.
  • 透過軟體保證,Contoso 未來可以使用適用於 SQL Server 的 Azure Hybrid Benefit,以折扣優惠在 SQL Database 受控執行個體上交換執行個體的現有授權。With Software Assurance, in future Contoso can exchange existing licenses for discounted rates on a SQL Database Managed Instance using the Azure Hybrid Benefit for SQL Server. 最多可節省 30% 的受控執行個體。This can save up to 30% on Managed Instance.

解決方案檢閱Solution review

Contoso 會透過比較一份優缺點清單,來評估建議設計。Contoso evaluates the proposed design by putting together a pros and cons list.

考量Consideration 詳細資料Details
優點Pros 這兩個應用程式 VM 都會移至 Azure (不需變更),讓移轉變簡單。Both the app VMs will be moved to Azure without changes, making the migration simple.

因為 Contoso 會針對這兩個應用程式 Vm 使用隨即轉移方法,所以應用程式資料庫不需要任何特殊設定或遷移工具。Since Contoso is using a lift and shift approach for both app VMs, no special configuration or migration tools are needed for the app database.

Contoso 可以使用 Azure Hybrid Benefit,充分發揮軟體保證的投資效益。Contoso can take advantage of their investment in Software Assurance, using the Azure Hybrid Benefit.

Contoso 會保留 Azure 中應用程式 VM 的完整控制權。Contoso will retain full control of the app VMs in Azure.
缺點Cons WEBVM 和 SQLVM 會執行 Windows Server 2008 R2。WEBVM and SQLVM are running Windows Server 2008 R2. Azure 支援特定角色的作業系統。The operating system is supported by Azure for specific roles. 深入了解Learn more.

應用程式的 web 和資料層會保留單一失敗點。The web and data tiers of the app will remain a single point of failure.

SQLVM 是在 SQL Server 2008 R2 上執行,而不再屬於主流支援。SQLVM is running on SQL Server 2008 R2, which is no longer in mainstream support. 不過,它支援 Azure Vm。However, it is supported for Azure VMs. 深入了解Learn more.

Contoso 必須繼續支援 Azure Vm 上的應用程式,而不是移至受管理的服務,例如 Azure App Service 和 Azure SQL Database。Contoso must continue supporting the app on Azure VMs, rather than moving to a managed service such as Azure App Service and Azure SQL Database.

移轉程序Migration process

Contoso 會使用 Azure Migrate:伺服器遷移工具無代理程式方法,將 app 前端和資料庫 Vm 遷移至 Azure Vm。Contoso will migrate the app front-end and database VMs to Azure VMs using the Azure Migrate: Server Migration tool agentless method.

  • 在第一個步驟中,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: Server 遷移工具來設定 vm 的複寫。They already have the Azure infrastructure in place, so Contoso just needs to add 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 會藉由測試遷移來遷移 VM,如果成功,則會將它容錯移轉至 Azure。After replication is enabled and working, Contoso will migrate the VM by testing the migration and if successful, failing it over to Azure.


Azure 服務Azure services

服務Service 描述Description 成本Cost
Azure Migrate:伺服器移轉Azure Migrate: Server Migration 該服務會協調和管理您的內部部署應用程式和工作負載,以及 AWS/GCP VM 執行個體的移轉。The service orchestrates and manages migration of your on-premises apps and workloads, and AWS/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.


以下是 Contoso 要執行此案例所需的項目。Here's what Contoso needs to run 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, you need to work with the admin to assign you Owner or Contributor permissions.

如果您需要更細微的權限,請檢閱此文章If you need more granular permissions, review this article.
Azure 基礎結構Azure infrastructure 了解 Contoso 如何設定 Azure 基礎結構。Learn how Contoso set up an Azure infrastructure.

深入瞭解 Azure Migrate 的特定必要條件需求:伺服器遷移。Learn more about specific prerequisites requirements 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:準備內部部署 VMware 以進行 Azure Migrate:伺服器遷移。Step 2: Prepare on-premises VMware for Azure Migrate: Server Migration. 他們會準備帳戶以進行 VM 探索,並準備在遷移後連線到 Azure Vm。They prepare accounts for VM discovery, and prepare to connect to Azure VMs after migration.
  • 步驟3:複寫 Vm。Step 3: Replicate VMs. 他們要設定複寫,然後開始將 VM 複寫至 Azure 儲存體。They set up replication, and start replicating VMs to Azure storage.
  • 步驟4:使用 Azure Migrate:伺服器遷移來遷移 Vm。Step 4: 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 Migrate 的 Azure:伺服器遷移工具Step 1: Prepare Azure for the Azure Migrate: Server Migration tool

以下是 Contoso 將 VM 移轉至 Azure 時,所需的 Azure 元件:Here are the Azure components Contoso needs to migrate the VMs to Azure:

  • 在遷移期間建立 Azure Vm 時,將會在其中尋找其所在的 VNet。A VNet in which Azure VMs will be located when they're created during migration.
  • Azure Migrate:已布建並設定伺服器遷移工具(OVA)。The Azure Migrate: Server Migration tool (OVA) provisioned and configured.

他們依照下列方式進行其設定:They set these up as follows:

  1. 設定網路-Contoso 已設定可用於 Azure Migrate 的網路:部署 Azure 基礎結構時的伺服器遷移Set up a network-Contoso already set up a network that can be for Azure Migrate: Server Migration when they deployed the Azure infrastructure

    • SmartHotel360 應用程式為生產應用程式,而且 VM 會被移轉至美國東部 2 主要區域的 Azure 生產網路 (VNET-PROD-EUS2)。The SmartHotel360 app is a production app, and the VMs will be migrated to the Azure production network (VNET-PROD-EUS2) in the primary East US 2 region.
    • 這兩個 VM 會置於可作為生產資源的 ContosoRG 資源群組中。Both VMs will be placed in the ContosoRG resource group, which is used for production resources.
    • 應用程式前端 VM (WEBVM) 將移轉至生產網路中的前端子網路 (PROD-FE-EUS2)。The app front-end VM (WEBVM) will migrate to the front-end subnet (PROD-FE-EUS2), in the production network.
    • 應用程式前端 VM (SQLVM) 將移轉至生產網路中的資料庫子網路 (PROD-DB-EUS2)。The app 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.

    • 從 Azure Migrate 下載 OVA 映射,並將其匯入 VMWare。From Azure Migrate, download the OVA image and import it into VMWare.

      下載 OVA 檔案

    • 啟動匯入的映射並設定工具,包括下列步驟:Start the imported image and configure the tool, including the following steps:

      • 設定必要條件。Set up the prerequisites.


      • 將工具指向 Azure 訂用帳戶。Point the tool to the Azure subscription.


      • 設定 VMWare vCenter 認證。Set the VMWare vCenter credentials.


      • 新增任何以 Windows 為基礎的認證以供探索。Add any Windows-based credentials for discovery.


  3. 設定完成後,工具會花一些時間來列舉所有虛擬機器。Once configured, it will take some time for the tool to enumerate all the virtual machines. 完成後,您會看到它們填入 Azure 中的 [Azure Migrate] 工具。Once complete, you will see them populate in the Azure Migrate tool in Azure.

需要其他協助?Need more help?

瞭解如何設定Azure Migrate:伺服器遷移工具Learn about setting 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 管理員在移轉之前執行了下列作業:To do this, Contoso admins do the following before migration:

  1. 為了透過網際網路存取,他們會: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 代理程式。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 log into the VM until the update completes.
    • 在遷移之後,他們可以勾選 [開機診斷] 以查看 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.
  5. 需要其他協助?Need more help?

步驟2:複寫內部部署 VmStep 2: Replicate the on-premises VMs

Contoso 管理員必須先設定並啟用複寫,才能執行移轉至 Azure 的作業。Before Contoso admins can run a migration to Azure, they need to set up and enable replication.

完成探索之後,您就可以開始將 VMware VM 複寫至 Azure。With discovery completed, you can begin replication of VMware VMs to Azure.

  1. 在 Azure Migrate 專案 >伺服器Azure Migrate:伺服器遷移] 中,選取 [ 複寫]。In the Azure Migrate project > Servers, Azure Migrate: Server Migration, select Replicate.

    複寫 VM

  2. 在 [複寫] > [來源設定] > [您的電腦虛擬化了嗎] 中,選取 [是,使用 VMware vSphere] 。In 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 > OK.


  4. 在 [虛擬機器] 中,選取您要複寫的機器。In Virtual machines, select the machines you want to replicate.

    • 如果您已執行 VM 的評估,您可以套用評估結果中的 VM 大小調整和磁碟類型 (進階/標準) 建議。If you've run an assessment for the VMs, you can apply VM sizing and disk type (premium/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 options.
    • 如果您選擇使用評估,請選取 VM 群組和評估名稱。If you selected to use the assessment, select the VM group, and assessment name.


  5. 在 [虛擬機器] 中,視需要搜尋 VM,並檢查您要遷移的每個 VM。In Virtual machines, search for VMs as needed, and check each VM you want to migrate. 然後選取 [下一步:目標設定]Then select Next: Target settings.

  6. 在 [目標設定] 中,選取訂用帳戶、您的遷移目標區域,並指定 Azure VM 在移轉後所在的資源群組。In Target settings, select the subscription, and target region to which you'll migrate, and specify the resource group in which the Azure VMs will reside after migration. 在 [虛擬網路] 中,選取 Azure VM 在移轉後所將加入的 Azure VNet/子網路。In Virtual Network, select the Azure VNet/subnet to which the Azure VMs will be joined after migration.

  7. 在 [ Azure Hybrid Benefit中,選取下列各項:In Azure Hybrid Benefit, select the following:

    • 如果您不想套用 Azure Hybrid Benefit,請選取 [否] 。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 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 dropdown 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 (開機)磁片。OS disk: 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, specify the set. 此設定組必須位於您為移轉指定的目標資源群組中。The set must be in the target resource group 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, won't be present on the Azure VM after migration.
  10. 在 [審查並啟動複寫] 中,檢查設定,然後選取 [複寫],啟動伺服器的初始複寫。In Review and start replication, review the settings, then select Replicate to start the initial replication for the servers.


您可以在複寫開始之前隨時更新複寫設定 (經由 [管理] > [複寫機器] )。You can update replication settings any time before replication starts, in Manage > Replicating machines. 在複寫啟動後,就無法變更設定。Settings can't be changed after replication starts.

步驟3:遷移 VmStep 3: Migrate the VMs

Contoso 管理員會執行快速測試遷移,然後進行完整遷移以遷移 Vm。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,然後選取 [測試遷移]。Right-click the VM to test, then select Test migrate.


  3. 在 [測試移轉] 中,選取 Azure VM 在移轉後將位於其中的 Azure VNet。In Test Migration, select the Azure VNet in which the Azure VM will be located after the migration. 我們建議使用非生產 VNet。We recommend you use a nonproduction VNet.

  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. 機器名稱會具有尾碼 -TestThe machine name has a suffix -Test.

  6. 測試完成之後,以滑鼠右鍵按一下 [複寫機器] 中的 [Azure VM],然後選取 [清除測試遷移]。After the test is done, right-click the Azure VM in Replicating machines, then select Clean up test migration.


遷移 VMMigrate the VMs

Contoso 管理員現在會執行完整的遷移。Now Contoso admins run a full migration.

  1. 在 [Azure Migrate 專案 >伺服器 > Azure Migrate: [伺服器遷移],然後選取 [複寫伺服器]。In the Azure Migrate project > Servers > Azure Migrate: Server Migration, then select Replicating servers.


  2. 在 [複寫機器] 中,以滑鼠右鍵按一下 VM > [遷移] 。In Replicating machines, right-click the VM > 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 occurred. 這樣可確保不會遺失任何資料。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 app tiers are now running on Azure VMs.

現在,Contoso 必須完成以下的清除步驟:Now, Contoso needs to complete these cleanup steps:

  • 完成移轉之後,即停止複寫。After the migration is complete, stop replication.
  • 從 vCenter 清查中移除 WEBVM 機器。Remove the WEBVM machine from the vCenter inventory.
  • 從 vCenter 清查中移除 SQLVM 機器。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 app now running, Contoso now needs to fully operationalize and secure it in Azure.


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 app can reach it.
  • 小組也會考慮使用 Azure 磁碟加密和 Key Vault 來保護磁碟上的資料。The team also consider securing the data on the disk 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

針對商務持續性和災害復原 (BCDR),Contoso 採取下列動作:For business continuity and disaster recovery (BCDR), Contoso takes the following actions:

授權和成本最佳化Licensing and cost optimization

  • Contoso 為他們的 VM 準備了現有的授權,且將運用 Azure Hybrid Benefit。Contoso has existing licensing for their 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 to help monitor and manage the Azure resources.


在本文中,Contoso 會在 Azure 中重新裝載 SmartHotel360 應用程式,方法是使用 Azure Migrate: Server 遷移工具將應用程式 Vm 遷移至 Azure Vm。In this article, Contoso rehosted the SmartHotel360 app in Azure by migrating the app VMs to Azure VMs using the Azure Migrate: Server Migration tool.