警告

NOTICE: THIS DOCUMENTATION SITE HAS BEEN SUPERSEDED.

For the current documentation site goto: http://docs.cloudstack.apache.org

Host Hyper-V Installation

如果你想使用 Hyper-V hypervisor来运行虚拟机,请在你的云环境中安装Hyper-V。本章节指导不会复制Hyper-V安装文档中的内容。它提供了让Hyper-V与CloudStack协同工作的一些特有的步骤。

Hyper-V主机的系统要求

Hyper-V主机所支持的操作系统

  • Windows Server 2012 R2 Standard
  • Windows Server 2012 R2 Datacenter
  • Hyper-V 2012 R2

Hyper-V主机的最低要求

  • 支持硬件辅助虚拟化的1.4 GHz 64-bit CPU
  • 800MB内存
  • 32GB本地磁盘空间
  • Gigabit (10/100/1000baseT)网卡

支持的存储

  • 主存储:SMB v3,本地存储
  • 辅助存储:SMB

Hyper-V的准备工作清单

为了能顺利地安装,在安装之前请收集以下信息:

Hyper-V Requiremen ts 描述
服务器角色 Hyper-V After the Windows Server 2012 R2 installation, ensure that Hyper-V is selected from Server Roles. For more information, see Installing Hyper-V.
共享位置 New folders in the /Share director y

确保为主存储和辅助存储创建了文件夹。SMB共享和主机应该在同一个域内。

If you are using Windows SMB share, the location of the file share for the Hyper-V deployment will be the new folder created in the \Shares on the selected volume. You can create sub-folders for both PRODUCT Primary and Secondary storage within the share location. When you select the profile for the file shares, ensure that you select SMB Share -Applications. This creates the file shares with settings appropriate for Hyper-V.

域和主机   主机都应该加入AD域。
Hyper-V用户 完全控制权限 SMB文件共享有完全控制权限
虚拟交换机  

If you are using Hyper-V 2012 R2, manually create an external virtual switch before adding the host to PRODUCT. If the Hyper-V host is added to the Hyper-V manager, select the host, then click Virtual Switch Manager, then New Virtual Switch. In the External Network, select the desired NIC adapter and click Apply.

如果使用Windows 2012 R2,虚拟交换机会自动创建。

虚拟交换机名称   Take a note of the name of the virtual switch. You need to specify that when configuring PRODUCT physical network labels.
Hyper-V 域用户  
  • 将Hyper-V域用户添加到Hyper-V管理员组中。
  • 域用户应该对提供主存储和辅助存储的SMB共享拥有完全控制权限。
  • This domain user should be part of the Hyper-V Administrators and Local Administrators group on the Hyper-V hosts that are to be managed by PRODUCT.
  • Hyper-V代理服务使用域用户账号身份运行。
  • Specify the credential of the domain user while adding a host to PRODUCT so that it can manage it.
  • 在添加SMB共享的主存储或者辅助存储时请指定域用户凭证。
迁移 Migratio n 启用迁移。
迁移 Delegati on 如果想使用在线迁移,请启用指派。请在使用在线迁移的主机上启用下列服务:CIFS和Microsoft Virtual System Migration Service。
迁移 Kerberos 为在线迁移启用Kerberos。
拨号访问网络权限 允许访问 允许拨号连接访问

Hyper-V安装步骤

  1. 下载操作系统 Windows Server 2012 R2
  2. 按照 Install and Deploy Windows Server 2012 R2 安装操作系统。
  3. 安装后,请确保安装Hyper-V角色。
  4. 如果当前环境中没有使用AD域,请部署AD域并添加域用户。
  5. 如果存在AD域,确保所有的Hyper-V主机都加入了域。
  6. 添加域用户到下列Hyper-V主机的用户组中: Hyper-V Administrators和Local Administrators。

在Hyper-V主机中安装CloudStack代理

Hyper-V代理帮助CloudStack操作Hyper-V主机。代理与管理服务器通讯并控制主机上的所有实例。为了让主机与CloudStack之间成功的进行交互,每个Hyper-V主机必须安装Hyper-V代理。Hyper-V代理作为Windows的系统服务运行。按照下里的步骤在每台主机上安装Agent。

CloudStack管理服务器使用HTTPS与Hyper-V代理通讯。为了使管理服务器与主机之间能够使用加密通讯,请在8250端口上绑定自签名证书。

注解

代理的安装程序会自动执行这个操作。在代理的安装过程中可以不选择该选项,它可以在步骤1中手动操作。

  1. 为8250端口创建并添加一个自签名证书:

    1. 创建一个自签名证书:

      # New-SelfSignedCertificate -DnsName apachecloudstack -CertStoreLocation Cert:\LocalMachine\My
      

      该命令创建一个自签名证书并将添加到 LocalMachine\My 证书区域。

    2. 将创建好的证书绑定到https通信的8250端口:

      netsh http add sslcert ipport=0.0.0.0:8250 certhash=<thumbprint> appid="{727beb1c-6e7c-49b2-8fbd-f03dbe481b08}"
      

      Thumbprint是你创建证书的指纹。

  2. 按照 `编辑 CloudStack Hyper-V 代理 <https://cwiki.apache.org/confluence/display/CLOUDSTACK/Creating+Hyperv+Agent+Installer>`__编译CloudStack代理程序。

  3. 以管理员权限运行安装。

  4. 在对话框中输入Hyper-V管理员凭证。

    当代理安装完成之后,代理已经作为系统服务启动了。

为Hyper-V配置物理网络

需要先对主机连线以及网卡绑定哪种流量做出规划。默认情况下,CloudStack将正在被使用的设备作为默认路由。

如果你使用Hyper-V 2012 R2,在将主机添加到CloudStack中之前,请手动创建一个外部网络虚拟交换机。如果Hyper-V管理器已经添加了Hyper-V主机,选择该主机,然后点击虚拟交换机管理器,新建虚拟交换机。在外部网络,选择所需的网卡然后点击应用。

如果使用Windows 2012 R2,虚拟交换机会自动创建。

为Hyper-V准备存储(可选)

CloudStack允许管理员使用SMB共享作为主存储和辅助存储。

  1. 创建一个使用SMB v3协议的SMB存储

    更多信息,请参考 部署基于SMB的Hyper-V.

    同样可以使用Windows创建并发布SMB共享。在Windows Server 2012 R2安装完成之后,在服务器角色中选择安装文件和存储服务以便创建SMB文件共享。更多信息,请参考 通过使用服务器管理器 (SM) 创建 SMB 文件共享系统

  2. 在AD域中添加SMB共享。

    SMB共享和通过CloudStack管理的主机必须在同一个域内。管理服务器可以使用域用户凭证访问存储。

  3. 在CloudStack中添加存储时,请确保提供的域和凭证是正确的。确保用户可以通过管理服务器访问存储。