In todays environment where words such as virtualization, cloud and agility constantly buzz in our ears, enterprises look for ways to manage their increasingly dynamic infrastructure. The Cloud::Services sketch from the CFEngine Design Center implements a policy to manage virtual machines (VMs) on VMware vSphere 5 (ESXi). With this sketch, CFEngine can clone, start/stop, delete and configure VMs seamlessly alongside your physical infrastructure.
The Cloud::Services sketch uses two of VMware’s command line APIs, vCLI and vifs, to interface with the ESXi hosts and its VMs. This allows us to create fully working resources from an uninitiated state in matters of seconds or minutes. We treat the VMs as services and make sure the correct packages are installed to fulfill the requested tasks (web server, database server, load manager, etc).
CFEngine’s convergent model assures that your infrastructure is always in the desired state. If a virtual machine hangs for some reason, CFEngine will bring it back online or, alternatively, fire up a backup VM if that is what you want it to do. Not only does this give redundancy, it also increases the security aspect of your infrastructure. A tripwire on a VM could for instance initiate a process to take it offline until you can diagnose the issue, while another VM boots up to take over the original task. If a VM is deleted by accident, CFEngine will recreate it and configure it to serve the same service.
CFEngine in combination with virtualization platforms and cloud allows for great flexibility with little effort. Although this brief article treats integration with VMware, the Cloud::Services sketch has similar capabilities for Amazon EC2. This can be extended to any virtualization or cloud platform with the appropriate APIs. CFEngine and Vagrant is another example.
The ability to run on almost any platform, the fact that our software is lightweight and uses less memory and CPU cycles compared to our competitors make us confident that CFEngine is among the best tools for managing virtual resources. As many others, we believe that the future lies in mobile devices linked to virtualized services; with CFEngine you could manage almost every aspect of this infrastructure… Exciting indeed!