在 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 datacenter 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 or the database server, 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 對此作業系統的支援僅限於特定角色 (2018 年 7 月)。The operating system is supported by Azure for specific roles (July 2018). 詳細資訊Learn more.

應用程式的 Web 和資料層會保留單一容錯移轉點。The web and data tiers of the app will remain a single point of failover.

SQLVM 是在非主流支援的 SQL Server 2008 R2 上執行。SQLVM is running on SQL Server 2008 R2 which isn't in mainstream support. 不過,Azure VM 受到支援 (2018 年 7 月)。However it is supported for Azure VMs (July 2018). 詳細資訊Learn more.

Contoso 必須繼續支持此應用程式作為 Azure VM,而不是轉向 Azure App Service 與 Azure SQL Database 等受控服務。Contoso will need to continue supporting the app as Azure VMs rather than moving to a managed service such as Azure App Service and Azure SQL Database.

移轉程序Migration process

Contoso 會使用 Azure Migrate 伺服器移轉工具無代理程式方法,將應用程式前端和資料庫 VM 移轉至 Azure VM。Contoso will migrate the app front-end and database VMs to Azure VMs with 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 伺服器移轉工具來新增 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 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. 發生容錯移轉時,系統會建立 Azure VM 並產生費用。Azure VMs are created, and incur charges, when failover occurs. 深入了解費用和定價。Learn more about charges and pricing.

PrerequisitesPrerequisites

以下是 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.5On-premises vCenter Servers should be running version 5.5, 6.0, or 6.5

ESXi 主機應該執行版本 5.5、6.0 或 6.5ESXi hosts should run version 5.5, 6.0 or 6.5

一或多部在 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 Server 遷移。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 Server 遷移。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 failover.
  • 步驟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 failover to make sure everything's working, and then run a full failover to migrate the VMs to Azure.

步驟1:準備適用于 Azure Migrate 伺服器遷移工具的 AzureStep 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 時,這些 VM 所在的 VNet。A VNet in which Azure VMs will be located when they're created during failover.
  • Azure Migrate 伺服器移轉工具佈建。The Azure Migrate Server Migration tool provisioned.

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

  1. 設定網路 - Contoso 已設定好網路,當他們 部署 Azure 基礎結構 時,就可以用於 Azure Migrate 伺服器移轉。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 伺服器移轉工具 - 網路和儲存體帳戶準備就緒之後,Contoso 現在會建立復原服務保存庫 (ContosoMigrationVault),然後將它放在主要美國東部 2 區域的 ContosoFailoverRG 資源群組中。Provision the Azure Migrate Server Migration tool-With the network and storage account in place, Contoso now creates a Recovery Services vault (ContosoMigrationVault), and places it in the ContosoFailoverRG resource group in the primary East US 2 region.

    Azure Migrate 伺服器移轉工具

需要其他協助?Need more help?

深入了解設定 Azure Migrate 伺服器移轉工具。Learn about setting up Azure Migrate Server Migration tool.

準備在容錯移轉後連接到 Azure VMPrepare to connect to Azure VMs after failover

容錯移轉之後,Contoso 會想要連線到 Azure VM。After failover, Contoso wants to connect to the Azure VMs. 為此,Contoso 管理員在移轉之前執行了下列作業:To do this, Contoso admins do the following before migration:

  1. 為了透過網際網路存取,他們會:For access over the internet, they:

    • 先在內部部署 VM 上啟用 RDP,然後再容錯移轉。Enable RDP on the on-premises VM before failover.
    • 確定已為公用設定檔新增 TCP 和 UDP 規則。Ensure that TCP and UDP rules are added for the Public profile.
    • 針對所有設定檔,在 [Windows 防火牆] > [允許的應用程式] 中檢查是否允許 RDP。Check that RDP is allowed in Windows Firewall > Allowed Apps for all profiles.
  2. 為了透過站對站 VPN 存取,他們:For access over site-to-site VPN, they:

    • 在內部部署機器上啟用 RDP。Enable RDP on the on-premises machine.
    • 在 [Windows 防火牆] -> [允許的應用程式與功能] 中,允許 [網域和私人] 網路使用 RDP。Allow RDP in the Windows Firewall -> Allowed apps and features, for Domain and Private networks.
    • 將內部部署 VM 的作業系統 SAN 原則設定為 OnlineAllSet the operating system's SAN policy on the on-premises VM to OnlineAll.

此外,當他們執行容錯移轉時,需要檢查以下各項:In addition, when they run a failover they need to check the following:

  • 觸發容錯移轉時,VM 上不應該有擱置的 Windows 更新。There should be no Windows updates pending on the VM when triggering a failover. 如果有,在更新完成之前,他們將無法登入 VM。If there are, they'll be unable to log into the VM until the update completes.
  • 在容錯移轉之後,他們可以勾選 [開機診斷] 以檢視 VM 的螢幕擷取畫面。After failover, 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?

步驟 3:複寫內部部署 VMStep 3: 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.

步驟 4:遷移 VMStep 4: Migrate the VMs

Contoso 管理員會執行一次快速的容錯移轉測試,然後再執行一次完整的容錯移轉來遷移 VM。Contoso admins run a quick test failover, and then a full failover to migrate the VMs.

執行測試容錯移轉Run a test failover

  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 failover to complete the 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.

安全性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 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.

BCDRBCDR

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

  • 保護資料安全:Contoso 會使用 Azure 備份服務來備份 VM 上的資料。Keep data safe: Contoso backs up the data on the VMs using the Azure Backup service. 詳細資訊Learn more.
  • 保持應用程式啟動及執行:Contoso 會使用 Site Recovery,在 Azure 中將應用程式 VM 複寫至次要區域。Keep apps up and running: Contoso replicates the app VMs in Azure to a secondary region using Site Recovery. 詳細資訊Learn more.

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

  1. 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.
  2. Contoso 會啟用 Microsoft 子公司 Cloudyn 授權的 Azure 成本管理。Contoso will enable Azure Cost Management licensed by Cloudyn, a Microsoft subsidiary. 它是一種多雲端成本管理解決方案,可協助您使用和管理 Azure 和其他雲端資源。It's a multicloud cost management solution that helps to use and manage Azure and other cloud resources. 深入了解 Azure 成本管理。Learn more about Azure Cost Management.

結論Conclusion

在本文中,Contoso 會使用 Azure Migrate 伺服器移轉工具,將應用程式 VM 移轉至 Azure VM,以便重新在 Azure 裝載 SmartHotel360 應用程式。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.