While playing around with the new VMware vCloud Director, I found myself rebuilding the vCD system twice. This meant I needed to automate the deployment so I did not have to do it for the third time if needed. The following script is used to deploy VMware vCloud Director and Oracle Express database on a single CentOS 5.5 64bit system. This setup is very similar to the one documented by Duncan Epping - Creating a vCD Lab on your Mac/Laptop, though our setup is running in our ghettoDatacenter.
This script will assume that you have installed CentOS 5.5 64bit OS on a system and it has direct or proxy access to the internet. You will also need to make sure you have provisioned two virtual NICs for the system, which the second one will automatically be configured for you.
UPDATE: The scripts below have been updated to support the latest release of vCloud Director 5.1.
For our setup, I used CentOS-5.5-x86_64-netinstall.iso to do a network installation using ftp://ftp.cs.ucsb.edu/mirrors/centos/5.5/os/x86_64/images and using all the defaults for "Server" type deployment. Since I can not re-distribute the installers for VMware vCloudr Director and Oracle Express, you will need to download the installers and transfer it to your CentOS system. The last step before you being is to transfer the vcd_setup.sh script and vcd.rsp response file to your CentOS system.
Download: vcd_setup.sh
Download: vcd.rsp
You will need make a few tiny edits the vcd.resp file to fit your environment which will be used to deploy vCD and Oracle Express, including the configurations.
Here is the sample vcd.resp that is included:
If you have read Duncan's vCD article or the vCD installation guide, you will be familiar with all these configurations. The only required changes you will need to make will be the secondary IP Address and the passwords for Oracle Database. Once you have made all the necessary edits, we can start the installation.
You should have the following 4 files located in the same directory on your vCD system:
- vcd_setup.sh
- vcd.resp
- oracle-xe-10.2.0.1-1.0.i386.rpm
- vmware-cloud-director-1.0.0-285979.bin
Note: Make sure you set the executable permission on the vcd_setup.sh, else you will get a permission denied error.
1. Start the installation and type y to begin:
The script will exit if it can not locate both vCD and Oracle Express installers, make sure those are available in the same working directory.
2. The YUM repository will be configured from a generic mirrorlist from CentOS and package dependency for vCD will begin:
3. The next section is disabling the firewall and selinux which is not a best practices, but for a lab, this is fine. NTP is also configured and enabled upon bootup:
4. Oracle Express will now be installed and configured based on the initial configuration file passed to the script (vcd.rsp). An oracle response file is created in /tmp which allows for a silent and unattended installation:
5. Per VMware's best practices, two separate tables spaces (CLOUD_DATA and CLOUD_INDX) are created along with a separate user account with the required privileges per the documentation using sqlplus and configuration file generated on the fly:
6. We now configure the secondary IP Address and generate the keystore for both HTTP and CONSOLE PROXY and stores it in /opt/keystore/certificates.ks:
Note: Make sure that both IP Addresses used for HTTP and CONSOLE PROXY have both their forward and reverse DNS properly configured. The "host" utility will be used to query their hostnames which is used in creating the keystore certificates.
7. vCloud Director will not be installed which actually extracts an embedded RPM for the actual installation:
8. We now configure vCloud Director from our response file and a configuration file is generated again for a silent and unattended installation:
Note: The script does not cover syslog server and syslog port configuration. If you need this, you can easily edit the script to support this.
9. Once the vCloud Director installation and schema creation is completed, vCloud Director is finished installing:
10. Now we can start vCloud Director and wait for the initialization to be completed which the script watches /opt/vmware/cloud-director/logs/vcloud-container-info.log for completion:
11. You can now open up your browser point it to your vCD system and if everything went accordingly, you should see vCloud Director landing page:
I hope this script will be helpful for those that want to kick the tires on vCloud Director but prefer not to go through all the manual steps of configuring an Oracle database and vCD. In total, the script took ~8minutes to complete from start to finish.