openstack juno 配置vmware(vcenter、vsphere)

官方配置文档:





When you use the VMwareVCDriver (vCenter versions 5.1 and later) with OpenStack Compute, add the following VMware-specific configuration options to the nova.conf file:

Select Text
1
2
3
4
5
6
7
8
9
[DEFAULT]
compute_driver=vmwareapi.VMwareVCDriver
[vmware]
host_ip=<vCenter host IP>
host_username=<vCenter username>
host_password=<vCenter password>
cluster_name=<vCenter cluster name>
datastore_regex=<optional datastore regex>





将qcow2的镜像格式转化为vmdk:
   
   
$ qemu-img convert -f qcow2 ~/Downloads/trusty-server-cloudimg-amd64-disk1.img \ -O vmdk trusty-server-cloudimg-amd64-disk1.vmdk


$ glance image-create --name trusty-cloud --is-public False \ --container-format bare --disk-format vmdk \ --property vmware_disktype="sparse" \ --property vmware_adaptertype="ide" < \ trusty-server-cloudimg-amd64-disk1.vmdk








将kvm 节点stop,让虚拟机调度到vcenter:





也可以通过zone来控制生成虚拟机到对应的节点:








官方juno对vmware的支持:
FeatureXenServer/XCPKVM/libvirt on (x86)QEMU/libvirt (x86)LXC/libvirtXen/LibvirtVMwareHyper-VBaremetalIronicDockerPowerKVM
Launch✔ *(12)
Reboot✔*(11)
Terminate
Resize

* (15)* (15)
Rescue




Pause

* (15)* (15)
Un-pause

* (15)* (15)
Suspend

* (15)* (15)
Resume

* (15)* (15)
Inject Networking✔*(1)(2)✔*(1)✔*(1)


✔*


Inject File✔*✔*



✗*(6)

Serial Console Output✔(4)




VNC Console✔*✔*✔*


SPICE Console


RDP Console

Attach Volume


Detach Volume


Live Migration

✗ (10)* (15)* (15)
Snapshot

✔ * (13)* (15)* (15)
iSCSI





iSCSI CHAP






Fibre Channel







Set Admin Pass


✗*(6)* (15)* (15)

Get Guest Info




Get Host Info




Glance Integration

Service Control





VLAN Networking✗*(7)✗*(16)

Flat Networking
Security Groups✗*(9)✗*(7)


Firewall Rules

✗ *(14)✗*(7)* (15)* (15)

Routing

✗*(7)

nova diagnostics




Config Drive

Auto configure disk



Evacuate




Volume swap




Volume rate limiting




  1. Inject Networking only works with nova-network in Flat mode, and only with Debian/Ubuntu based virtual machines, and only at boot time
  2. XenServer integration also supports using a guest agent to inject networking settings, at any time when a VM has the guest agent installed, through an admin API extension
  3. (unused)
  4. XenAPI support for serial console was added in Havana
  5. (unsued)
  6. Functionality provided by cloudbase-init for windows http://www.cloudbase.it/cloud-init-for-windows-instances/
  7. Vlan and Routing is only supported on Hyper-V when using the Quantum / Neutron Hyper-V Agent; VlanManager mode is not supported with nova-network.
  8. Support of Xen using Libvirt
  9. Security Groups supported on VC/ESX Driver when using the Quantum NVP Plugin
  10. https://bugs.launchpad.net/nova/+bug/1192192
  11. Copy on write images are not suported (see bug https://bugs.launchpad.net/nova/+bug/1253571).
  12. Only cold-snapshots are available.
  13. https://bugs.launchpad.net/nova/+bug/1269448
  14. Feature does not make sense for Baremetal / Ironic
  15. Feature currently enabled by some Ironic drivers, but not all.

在juno版本中,不能支持的功能:
1、pause、unpause(vspherer没有此功能,注:  Suspend与Pause不一样,支持Suspend
2、热迁移不支持
3、resize  不支持

具体更多关于热迁移,resize请参考博客(注:博客还未整理):

热迁移功能不支持总结:




来看下vsphere的热迁移:



关于openstack底层对vmvare热迁移的支持: 
注此处的host不能为ip必须为vsphere里面的自增长hostname:

获取  vsphere里面的自增长hostname的函数为:




但是前端页面不支持,


以图为例讲解:
如下图有三个计算节点:其中conpute1、compute2底层驱动配置的为kvm驱动,comute3底层配置的为vmware驱动。 


1、从上图可以看出compute1、compute2对应的驱动为kvm,则它们的当前节点即为自己(即一个compute的kvm驱动driver对应管理自身主机)
2、compute3对应的驱动为vmware,那么它底层对应对接的为多个cluster(当然也可以只有一个cluster),然而一个cluster下面又挂接着多个host。
3、假若从compute1热迁移到compute2,走openstack正常迁移流程,更多详细请自行参考博客相关内容。
4、假若是想对compute3的虚拟机进行迁移,如果还是走openstack原有流程那么则虚拟机会从compute3迁移到compute1或者compute2,将vmdk的虚拟机迁移到kvm,目前来说会是失败的,
因为当前版本不支持openstack对vmware底层虚拟机的迁移(至少页面)。
5、从vsphere对compute3下面的虚拟机进行热迁移(vsphere挂了共享存储),是能够成功的。但是迁移只是对vsphere内部迁移有效,及虚拟机能够从host3、host4、host5之间互相迁移。
6、那么从openstack底层的驱动vmwareapi的driver驱动来看,有个dest参数,如果将dest设置为host3、host4、host5中的一个值,测试发现是能够将vsphere下面虚拟机进行迁移。因此说明
底层驱动是支持热迁移。页面和上层nova代码没有适配迁移(因为目前在上层nova及web中vsphere的host3、host4、host5是不可见的)。


因为要想适配vmwareapi的热迁移,需要对页面和nova上层代码进行修改,当然不能简简单单对页面进行修改,因为此处的目的host在调度时候,需要去判断host状态,
因此要想通过调度需要做改进,有两种方式实现:
1、判断如果是vmware的虚拟机进行迁移,则跳过调度中,对vmware目的host的判断,直接传递到底层
2、在数据库compute_nodes中增加vsphere中host的值,这样调度可以直接走(不建议此方法)
总结:无论哪种方法对openstack的代码侵入都比较大!


resize功能不支持总结:

2、目前对vmwareapi驱动的虚拟机进行resize  时,正常应该吧finish_migration函数的rpc消息发给vmware驱动所在机器,实际确发送给了qemu
所在机器,因此就出现了问题。
3、初步判断原因为,当将虚拟机从host1 resize到host2   finish_migration 将在host1上面执行。当  使用了vmwareapi驱动时,按照kvm的resize逻辑,还是将  finish_migration 放到了kvm所在节点进行执行,因此出错了。正确情况为需要适配vmwareapi驱动  的resize,将  finish_migration     执行仍然放到自身节点上。
4、根据上述步骤3分析,由于resize代码逻辑太过复杂,就先强行修改rpc发送消息的目标节点到vmwareapi驱动所在节点,避过步骤三的错误。看到在vsphere底层对opentack 调用的resize流程,走的是克隆的方式,假若原始虚拟机为869a86b4-fdd8-49dd-8502-b2af1ec847b5在resize时候,则会克隆一个名为869a86b4-fdd8-49dd-8502-b2af1ec847b5-orig的虚拟机。当调用finish_migration时,则将原始虚拟机为869a86b4-fdd8-49dd-8502-b2af1ec847b5删除掉,再将869a86b4-fdd8-49dd-8502-b2af1ec847b5-orig修改为869a86b4-fdd8-49dd-8502-b2af1ec847b5。

总结:假若想让opentack适配vmware的resize,需要对nova的resize代码进行分析,工作量稍大(resize目前是opentack里面最复杂的逻辑,调用了创建虚拟机,迁移虚拟机等一系列opesntck的基础功能),其次修改适配的话对opentack原生代码侵入也较大。




  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值