本文共 4145 字,大约阅读时间需要 13 分钟。
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: | compute_driver=vmwareapi.VMwareVCDriver host_ip=<vCenter host IP> host_username=<vCenter username> host_password=<vCenter password> cluster_name=<vCenter cluster name> datastore_regex=<optional datastore regex> | |
$ 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:
Feature | | | | | | | | | | | |
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 | ✗ | ✔ | ✔ | | | ✗ | ✗ | | | ✗ | ✔ |
- Inject Networking only works with nova-network in Flat mode, and only with Debian/Ubuntu based virtual machines, and only at boot time
- 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
- (unused)
- XenAPI support for serial console
- (unsued)
- Functionality provided by cloudbase-init for windows
- 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.
- Support of Xen using Libvirt
- Security Groups supported on VC/ESX Driver when using the Quantum NVP Plugin
-
- Copy on write images are not suported (see bug ).
- Only cold-snapshots are available.
-
- Feature does not make sense for Baremetal / Ironic
- Feature currently enabled by some Ironic drivers, but not all.
1、pause、unpause(vspherer没有此功能,注:
Suspend与Pause不一样,支持Suspend)
具体更多关于热迁移,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原生代码侵入也较大。