ESX Integration » History » Version 69
THIS has been depreciated in favor of communicating directly with VMWare vcenter, the information in this page remains for archive purpose only.
Check Compute resources: Compute Resources
ESX integration is almost complete. I am just waiting for my patches to be merged and some final testing on the foreman devel or esx branch.
Although ESX and ESXi are different products they should be considered identical when it comes to working with the Vmware SDK.
Furthermore, vSphere is almost identical to ESX SDK with the exception that vSphere has additional objects and actions available to choose from when using the SDK.
All of these "ESX" products implement the Vsphere SDK through Https
- libvirt 0.9.1+ (not totally sure on this) but I know it doesn't work with 0.8.1
- ruby-libvirt 0.4.0
- ESX, ESXi, vsphere server, VMware Server (ESX 5 may not be supported)
- A CA (Certificate Authority) to sign new certificates (don't need if you use no_verify=1 option)
- RHEL6 or CentOS6 (not required but its what I use)
- Unofficial virt lib and foreman esx branch (or attached patch) from http://github.com/logicminds
- Install libvirt and libvirt-devel
- Install ruby-libvirt gem
- Start libvirtd
- Test with virsh
- Install unofficial repos
- Setup hypervisor in foreman
Use these steps if not using the no_verify=1 option
- Create ssl key
- Sign key with CA cert and CA key
- Transfers these keys to your ESX or Vsphere server
- Copy CA cert and client cert
I tried various versions. The latest has too many dependancies so I stuck with 0.9.1 which is perfect for what I need.
I have compiled some RPMs to make it easier to install but you may need to resolve some additional dependancies.
This shouldn't be too bad if you have the EPEL repo.
You will need to use the following to install all the rpms once downloaded.
yum -y --nogpgcheck localinstall libvirt-*
rpm -Uvh libvirt-*
Install libvirt gem¶
gem install ruby-libvirt
cd /usr/share/foreman (or other foreman path) wget http://files.remoteadmin.co/rpms/0001-Feature-955-vmware-provisioning-support.patch git apply 0001-Feature-955-vmware-provisioning-support.patch RAILS_ENV=production rake db:migrate mv /usr/share/vendor/plugins/virt /tmp
Install virt lib¶
cd /opt git clone git://github.com/logicminds/virt.git virt cd /opt/virt git checkout coreyschanges ln -s /opt/virt /usr/share/foreman/vendor/plugins/virt
Start the libvirtd Service¶
service libvirtd start
Setup ESX Hypervisor in Foreman¶
- Goto Hypervisor (ensure ruby-libvirt is installed and libvirtd is running)
- Add hypervisor to hypervisor list (esx://server?no_verify=1)
- Find the bugs and submit patches to my attention in foreman-dev.
Until this gets put in the foreman project don't create any tickets just yet since our code is currently forked.
If your not using no_verify=1 please follow this page to Setup Certificates
Troubleshoot by Testing with virsh¶
I created a foreman user on my esx server
[root@puppet ~]# virsh Welcome to virsh, the virtualization interactive terminal. Type: 'help' for help with commands 'quit' to quit virsh # connect esx://pdxesx?no_verify=1 Enter foreman's password for pdxesx: virsh # version Compiled against library: libvir 0.9.1 Using library: libvir 0.9.1 Using API: ESX 0.9.1 Running hypervisor: ESX 4.1.0 virsh # list Id Name State ---------------------------------- 16 puppetagent1 running
Virtual Center support¶
I am kinda disappointed with libvirt's vcenter support. The VPX driver is basically only talking to a single esx host which is similar to the esx driver.
So you will need to add every esx host you wish to control as a separate hypervisor in foreman. However, because a single node in a cluster has the ability to
migrate vms to other nodes you may only need to control one of the nodes and let vmware handle migration when resources are low.
The benefit of using the vpx driver is the use of vcenter centrally managed RBAC.
Support for Vcenter using the following URI
username = esxusername (AD environments do not need to append @domain or anything)
I had a chance to test vcenter the other day and it appears that libvirt's support is different for esx than vpx.
I was not able to create a vm with vpx so only the ESX driver works at this time reliably.
- Destroy doesn't delete VM only unregisters the vmx file (Libvirt and virt issue)
- Libvirt doesn't yet support List of VMware Networks (Virtual Switches / Port Groups)
- Virt and foreman only show info about first disk(although virt supports multiple disks)
- Listing the VMs on the hypervisor is slow (300ms per vm guest) although it has been improved from previous versions
Known ESX Limitations¶
- Does not work with ESX free edition (unless ESXi is unlicensed)
- Libvirt does not support ESXi 5.0 directly but might be supported under vsphere