使用 PowerShell 設定 VMM 網狀架構中的軟體定義網路 (SDN) 元件Set up Software Defined Network (SDN) components in the VMM fabric using PowerShell

重要

已不再支援此版本的 Virtual Machine Manager (VMM),建議升級至 VMM 2019This version of Virtual Machine Manager (VMM) has reached the end of support, we recommend you to upgrade to VMM 2019.

System Center - Virtual Machine Manager (VMM) 可以用來部署和管理軟體定義網路 (SDN) 基礎結構。System Center - Virtual Machine Manager (VMM) can be used to deploy and manage a Software Defined Network (SDN) infrastructure.

您可以在 VMM 網狀架構中部署 SDN 元件,包括:You can deploy SDN components in the VMM fabric, including:

  • 網路控制站:網路控制站可讓您自動化網路基礎結構的設定,不需要手動設定網路裝置和服務。Network Controller: The network controller allows you to automate configuration of your network infrastructure, instead of manually configuring network devices and services.
  • 適用於 SDN 的 RAS 閘道:RAS 閘道是一種 Windows Server 2016 中多租用戶、具備 BGP 功能的軟體路由器,針對 CSP 和使用 HNV 裝載多個租用戶虛擬網路的企業而設計。RAS Gateway for SDN: RAS Gateway is a software-based, multitenant, BGP capable router in Windows Server 2016 that is designed for CSPs and Enterprises that host multiple tenant virtual networks using HNV.
  • 適用於 SDN 的軟體負載平衡 (SLB) :Windows Server 2016 中的 SDN 可以使用軟體負載平衡 (SLB) 將租用戶和租用戶客戶網路流量平均地分散到各個虛擬網路資源。Software Load Balancing (SLB) for SDN: SDN in Windows Server 2016 can use Software Load Balancing (SLB) to evenly distribute tenant and tenant customer network traffic among virtual network resources. Windows Server SLB 可讓多部伺服器裝載相同的工作負載,提供高可用性和延展性。The Windows Server SLB enables multiple servers to host the same workload, providing high availability and scalability.

有數種方式可用來部署這些元件:There are a couple of ways to deploy these components:

  • VMM 主控台:在 VMM 主控台中手動部署網路控制站SLBRAS 閘道VMM console: Deploy the network controller, SLB, and RAS gateway manually in the VMM console.
  • PowerShell:使用 PowerShell 指令碼部署所有元件。PowerShell: Deploy all components using PowerShell scripts.

PowerShell 部署的優點Advantages of PowerShell deployment

  • 使用 PowerShell 指令碼部署所有 SDN 元件。Deploy all SDN components with PowerShell scripts.
  • 使用指令碼可減少人為錯誤的產生,並大幅節省部署時間。Using a script can reduce the introduction of manual errors, and save significant deployment time.
  • 如果您使用指令碼部署,之後便可在 VMM 主控台中修改設定,就像手動部署 SDN 元件一樣。If you deploy using the script, afterwards you can modify settings in the VMM console, just as you would if you deploy the SDN components manually.
  • 如同手動部署,您可以選擇設定新的管理邏輯網路和交換器,或者重複使用現有的網路和交換器。Like the manual deployment, you have the option of setting up a new management logical network and switch, or to reuse an existing network and switch.
  • 如果指令碼部署失敗,即會復原所有已變更的設定,讓您可以重新開始。If the script deployment fails, all changed settings are rolled back, so that you can start again.
  • 您可以關閉特定元件的部署,例如,如果您已經部署網路控制站,就只能部署 SLB 和 RAS 閘道。You can turn off deployment for specific components, For example, if you already have network controller deployed, you can deploy SLB and RAS gateway only.

在您開始使用 Intune 之前Before you start

部署步驟Deployment steps

以下是您要使用 PowerShell 設定 VMM 中的 SDN 元件所需執行的動作。Here's what you need to do to set up SDN components in VMM with PowerShell.

  1. 設定主機和實體網路基礎結構:您必須存取您的實體網路裝置,以便設定 VLAN、路由等等。您也需要 Hyper-V 主機來裝載 SDN 基礎結構和租用戶 VM。Configure hosts and physical network infrastructure: You need access to your physical network devices to configure VLANs, routing etc. You also need Hyper-V hosts to host the SDN infrastructure and tenant VMs. 深入了解Learn more.

  2. 針對服務範本準備虛擬硬碟 (VHD 或 VHDX 格式)。Prepared virtual hard disk for the service templates in VHD or VHDX format.

  3. 下載網路控制站服務範本、SLB 服務範本及 RAS 閘道服務範本。Download the network controller service template, the SLB service template, and the RAS gateway service template.

  4. 網路控制站SLBRAS 閘道範本匯入到 VMM 程式庫。Import the network controller, SLB, and RAS gateway templates into the VMM library.

  5. 設定 Active Directory 安全性群組Set up Active Directory security groups. 一個用於網路控制站管理,而另一個用於網路控制站用戶端。One for network controller management, and another for network controller clients. 每個群組必須至少要有一個使用者帳戶。Each group will need at least one user account in it.

  6. 設定 VMM 程式庫共用。您可以選擇使用程式庫檔案共用以保留診斷記錄檔。Set up a VMM library share.You can have an optional library file share for keeping diagnostic logs. 網路控制站將會存取此資源庫共用,以儲存其整個存留期的診斷資訊。This library share will be accessed by the network controller to store diagnostics information throughout its lifetime.

  7. 針對所有 SDN Hyper-V 主機設定專用的 VMM 主機群組Set up a dedicated VMM host group for all SDN Hyper-V hosts. 請注意,主機必須執行最新版本的 Windows Server 2016,並啟用 Hyper-V 角色。Note that hosts must be running the latest version of Windows Server 2016, and have the Hyper-V role enabled.

  8. 設定憑證Set up a certificate. 您需要 SSL 憑證,以便在 VMM 和網路控制站之間進行 HTTPS 通訊。You need an SSL certificate for HTTPS communications between VMM and the network controller.

  9. 下載並執行 SDN 指令碼。Download and run the SDN scripts. 有三個指令碼:There are three scripts:

    • VMMExpress.ps1:此指令碼會部署 SDN 堆疊。VMMExpress.ps1: This script deploys the SDN stack. 下載此指令碼之後,您就能自行自訂。After you download it, you can your own customizations.
    • Fabricconfig.psd1:此檔案會接受用於設定 SDN 的所有輸入。Fabricconfig.psd1: This file accepts all the inputs for setting up SDN.
    • Fabricconfig_Example.psd1:包含虛設參數的範例檔案。Fabricconfig_Example.psd1: A sample file that contains dummy parameters. 您可以使用自己的參數來取代那些參數。You can replace those with your own parameters.

後續步驟Next steps

設定 SDN 的主機和實體網路基礎結構Configure hosts and physical network infrastructure for SDN .