Alastair Cooke just released AutoLab v1.0 to production, and I wanted to talk a bit about the automation that went into the vCloud Director portion of the AutoLab. Before I get started, I’d like to point out a quote that’s attributed to Sir Isaac Newton, “If I have seen further, it is by standing on the shoulders of giants“. That is most definitely the case here. While working out the automation, I was repeatedly surprised at the number of pertinent blog posts I found that were written one to two years ago and provided the right answers. So while I may have cobbled these scripts together and provided them to Alastair for distribution, the true thanks and appreciation belongs to folks like William Lam, Alan Renouf, and Luc Dekens. Without those guys’ contribution to the VMware community, I’d probably still be banging my head against the proverbial wall.
When you decide to add vCloud Director to your AutoLab, you’ll need to grab the CentOS 6.3 x64 DVD ISOs. CentOS used to distribute the CD & DVD ISOs, but at some point they moved to only offering the DVDs. I recommend visiting a mirror and grabbing the torrent file; that’s the absolute quickest way to download the distribution. When you’re done, I suggest you let the torrent seed for a few days. It’s pretty large, so you may not be be able to seed back at a 1.00 ratio or higher, but letting it run for 48-96 hours is a nice way of giving back to the CentOS community as well.
Once you’ve obtained CentOS, add the vCloud VM from the AutoLab folder, set the VM to boot to the first CentOS DVD and power it up. If your AutoLab is configured correctly, the VM should PXE boot and present you with a menu. Choose the vCloud Director install (at the bottom of the menu) and watch the automation begin. This part, while cool, is just standard Linux PXE booting. The boot menu (found at DC VM’s C:\TFTP-Root\pxelinux.cfg\default) points the VM to initrd.img, tells it to use NFS to grab anaconda-ks.cfg from the NAS VM’s Build share, and perform a kickstart install.
The kickstart file tells the VM to setup its network interfaces, partition the drive, and install packages required for CentOS and vCloud Director. You can find the list of required pacakges in the vCloud Director installation guide. After the kickstart installation completes, there are a series of post commands that fire off. The first set pings for Google; if it responds then an update is performed, and the VMware public keys are pulled down to prevent the vCloud installation from complaining about security. The second set of post commands mounts the NAS VM’s Build share using NFS and copies down a file called vcd-install. This file is set to run as a service after first boot. The vcd-install script is where the real automation begins.
Many thanks to this blog post from William Lam on the vcd-install script which checks for the existence of the Oracle Express rpm and the vCloud Binary. Then it installs, configures, starts Oracle Express, installs, configures, and starts vCloud Director. You can see the output of the installation if you view /root/vcd-install.log on the vCloud VM after it’s done. The vcd-install service then sets itself to off and will no longer run on boot.
After vCloud completes installation, the next step is to run the vShield PowerShell file from the VC VM. This script (thanks to William & Alan, again) will check to see if the vShield virtual appliance is on the Build share. If it is, the script will import the appliance into the AutoLab cluster, do a bit of fiddling to get the appliance’s memory down to an acceptable level and power it on. After it’s up and running, another piece of the vShield script will pass configuration parameters down via the vShield API. Pretty cool stuff!
Well, that just about does it with this blog post and the vCloud/AutoLab 1.0 discussion. I’ve got some revisions to the automation coming in the next version of the AutoLab to make it even smoother and do some cool things like auto-configuring a vDS so you’ll have an external network prepared as you begin to dive into playing with vCloud Director. I hope you’ve found this blog post useful and informative. AutoLab with vCloud Director will be an important centerpiece to the planned VCP-IaaS series on the US #vBrownBag, so get ready now!