在 VMM 构造中使用 PowerShell 设置软件定义网络 (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 的多租户路由器,专门为使用 HNV 托管多个租户虚拟网络的 CSP 和企业设计。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.

开始之前Before you start

部署步骤Deployment steps

以下是在 VMM 中使用 PowerShell 设置 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. 对于 VMM 与网络控制器之间的 HTTPS 通信,需要 SSL 证书。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:一个包含 dummy 参数的示例文件。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 .