分享

如何实现同一OpenStack集群同时支持多种虚拟化技术

徐超 发表于 2015-1-26 20:15:58 [显示全部楼层] 只看大图 回帖奖励 阅读模式 关闭右栏 1 16279
问题导读
1、什么是Mutil-Hypervisor?
2、如何配置Openstack Mutil-Hypervisor 环境?
3、如何在Esxi node上创建VM?







1.png
OpenStack 4 岁多啦,每个新版本都能实现一些需求和解决一些问题。其中被企业用户问的最多的一个问题是:同一个 OpenStack 集群能同时支持多种虚拟化技术么(Mutil-Hypervisor)?
答案当然是 Yes!在说明如何配置 Mutil-Hypervisor 前,我们需要了解什么是 Mutil-Hypervisor。



Mutil-Hypervirsor 简介

对很多用户来说,仅采用一种虚拟化技术难以满足他们的需求,所以用户可能会同时采用其它虚拟化技术。比如:1.用户不想被某个虚拟化厂商绑定限制;2. 某些虚拟化产品要求高额的 License,无疑加重了用户的财政开销;3.单个虚拟化产品的功能不满足用户所有的需求。随着虚拟化技术越来越成熟,Mutil-Hypervisor 的需求场景变得越来越常见,但是往 OpenStack 集群增添其它虚拟化技术前,需要慎重全面的考虑它带来的困难及更为复杂的架构。

Openstack 设计之初,重点支持的是 Qemu-Kvm 虚拟化平台。但是大量的企业已经采用了其它的虚拟化平台,比如:Xen,ESXI 等。并且企业不愿意去更改已有的 IT 架构设施,因此 OpenStack 需要支持 Mutil-Hypervirsor。
1.jpg


OpenStack 支持哪些虚拟化平台

OpenStack nova-compute 支持多种虚拟化平台,如下所示:

  • KVM-Qemu – Kernel-based Virtual Machine. The virtual disk formats that it supports is inherited from QEMU since it uses a modified QEMU program to launch the virtual machine. The supported formats include raw images, the qcow2, and VMware formats.
  • LXC – Linux Containers (through libvirt), use to run Linux-based virtual machines.
  • QEMU – Quick EMUlator, generally only use for development purposes.
  • UML – User Mode Linux, generally only use for development purposes.
  • VMware vSphere 4.1 update 1 and newer, runs VMware-based Linux and Windows images through a connection with a vCenter server or directly with an ESXi host.
  • Xen – XenServer, Xen Cloud Platform (XCP), used to run Linux or Windows virtual machines. You must install the nova-compute service in a para-virtualized VM.
  • Hyper-V– Server virtualization with Microsoft’s Hyper-V, use to run Windows, Linux, and FreeBSD virtual machines. Runs nova-compute natively on the Windows virtualization platform.
  • Ironic – Not a Hypervisor in the traditional sense, this driver provisions physical hardware through pluggable sub-drivers (for example, PXE for image deployment, and IPMI for power management).
  • Docker - use to manage container.

关于更多 Hypervisor 详情,请参见 http://wiki.openstack.org/HypervisorSupportMatrix


OpenStack 配置 mutil-hypervisor
我们以 VMware ESXI Hypervisor 为例,阐述如何配置 OpenStack 使之在采用 KVM Hypervisor 的场景下再支持 VMware ESXI Hypervisor。在配置 Mutil-Hypervisor 环境前,我们假定您已经部署了一套采用 KVM 的 OpenStack 集群(Havana及以后版本) 和 一套管理任意数量 ESXI 主机的 Vcenter 5.5 集群。OpenStack 支持 VMware vSphere 系列产品,并且能够使用它的一些高级功能,比如:vMotion, 高可用,动态资源调度。下为 Mutil-Hypervisor 的架构图:
360截图20150126200957896.jpg
从上图可知:VMware vCentor 并不能被直接添加到 openstack 集群中,我们需要新增一个 compute-node 节点,通过 compute-node 节点管理 vCentor 节点。一个 nova-compute 只能管理一个 vCentor 集群,我们可以往单个 vCentor 添加任意数量的 ESXI host,如果你想管理两个不同的 vCentor 集群,你需要两个 nova-compute 节点,分别管理对于的 vCentor 集群。

注:

  • 和像 KVM 等这些基于 Linux 内核的 Hypervisors 不同,vSphere 集成到 OpenStack 时需要一个 vCenter Server 管理 ESXI host,其管理的虚拟机运行在 ESXI host 上,而非 nova-compute 节点上。
  • 虽然 OpenStack 集群可以支持多种虚拟化平台,但是每一个 nova-compute 节点之能够支持一种虚拟化平台,因此 Mutil-Hypervirsor 需要多个 nova-compute 节点。



Prerequisites and limitations

  • DRS(Dynamic Resource scheduler ): 开启 DRS 功能,支持虚拟机自动调度。
  • Shared storage: vCentor 集群必须支持共享存储
  • Clusters and data stores: vCenter 下虚拟机的存储必须由 vCenter 管理的集群提供。
  • Networking: VMware 支持通过 nova-network 或者 neutron 管理 vCenterr 下的虚拟机网络。以 nova-network 为例:

  1. The nova-network service with the FlatManager or FlatDHCPManager:Create a port group with the same name as the flat_network_bridge value in the nova.conf file. The default value is br100. If you specify another value, the new value must be a valid linux bridge identifier that adheres to linux bridge naming conventions. All VM NICs are attached to this port group. Ensure that the flat interface of the node that runs the nova-network service has a path to this network. When configuring the port binding for this port group in vCenter, specify ephemeral for the port binding type. For more information, see Choosing a port binding type in ESX/ESXi in the VMware Knowledge Base.
复制代码


  • Security groups. 若采用 nova-network,security groups 的特别将丢失;采用 neutron,可以保留该特性。
  • VNC. KVM 默认 5900 – 6000 端口用于虚拟机 vnc。ESX 则采用 5900-6105 端口。
  • SSH Keys: vCenter 不支持 SSH keys 注入虚拟机。



配置 Openstack Mutil-Hypervisor

1.计算节点(novavmware1)安装 nova-compute
  1. “apt-get install nova-compute nova-compute-vmware python-suds”  
复制代码


2.配置计算节点novavmware nova.conf文件
  1.   [DEFAULT]
  2. compute_driver=vmwareapi.VMwareVCDriver
  3. [libvirt]
  4. libvirt_type=vmwareapi
  5. [vmware]
  6. host_ip=
  7. host_username=
  8. host_password=
  9. cluster_name=
  10. datastore_regex=
  11. wsdl_location=file:///vmware-sdk/SDK/vsphere-ws/wsdl/vim25/vimService.wsdl #(optional)
复制代码


3.完成 nova.conf 里 vnc、AMQP 等配置项

4.计算节点novavmware1安装 nova-network
  1. “apt-get install nova-network nova-api-metadata”
复制代码


5.制作 vmdk 镜像,并上传至 glance
  1. $ qemu-img convert -f qcow2 /Downloads/ubuntu.img -O vmdk ubuntu.vmdk
  2. $ glance image-create –name ubuntu –is-public=True –container-format=bare –disk-format=vmdk –property vmware-disktype=”sparse” –property vmware-adaptertype=”lsiLogic” –property Hypervisor_type=”vmware” < ubuntu.vmdk
复制代码


至此,Openstack Mutil-Hypervisor 环境配置完毕,试试在 ESX node 创建第一个虚拟机~






本文转载自:http://www.cloudenablers.com/blo ... rvisor-environment/

已有(1)人评论

跳转到指定楼层
zengliang025 发表于 2015-1-27 10:10:27
写得很好,支持楼主!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条