If you’ve tried to use the CentOS 6.3 template that VMware provides as part of the out-of-the-box application templates for vCloud Application Director 6.0.1, then you’re probably aware of the difficulty involved due to sub-optimal documentation and the template’s initial configuration. I’ve worked through the documentation and after a bit of work and head scratching, I was able to successfully deploy the jPetStore sample application. Here are the steps from start to finish.
Prepare the CentOS 6.3 template
- After downloading the CentOS 6.3 .ovf, .mf, and .vmdk file, deploy the ovf to your destination vSphere host using the vCenter web or thick client. Make sure you’re deploying it to the cluster(s) that are assigned to the appropriate business group within vCloud Automation Center. Take a snapshot here, in case you need to revert to the original template.
- Edit the newly deployed VM and verify that DHCP is visible under vApp Options > Deployment.
- Power on the VM, and open the VM console. Logon using username root and password vmware. You’ll need to change the contents of two files as they contain left over network information from eng.vmware.com.
- Make a backup of resolv.conf and then empty the file. This will force the VM to use the DNS settings provided by your network DHCP.
[code gutter=”false”]
cp /etc/resolv.conf resolv.conf.bak
cat /dev/null > /etc/resolv.conf
[/code] - Second, backup /etc/sysconfig/network and make changes so eth0 will use DHCP when it comes up.
[code gutter=”false”]
cp /etc/sysconfig/network /etc/sysconfig/network.bak
cat > /etc/sysconfig/network
DEVICE=eth0
NETWORKING=yes
BOOTPROTO=dhcp
ONBOOT=yes
CTRL+C
[/code] - If you have an existing vCloud Application Director agent bootstrap service, uninstall the service.
- Check to see if the agent is running and stop it if it is.
[code gutter=”false”]ps -ef | grep agent_bootstrap
kill -9 <process identified>[/code] - Run the Shell file to remove the agent bootstrap service.
[code gutter=”false”]/opt/vmware-appdirector/agent-bootstrap/agent_reset.sh[/code]
- Uninstall the agent bootstrap service
[code gutter=”false”]rpm -e vmware-appdirector-agent-service-6.0.0.0-0.i386[/code]
- Check to see if the agent is running and stop it if it is.
- Download and install the vCloud Automation Center guest agent. (The docs are incorrect here.)
- Open a browser window and go to https://<IP or FQDN of vCAC appliance>:5480/installer. Download the Linux guest agent packages & scp them to the CentOS VM (If you’re running Windows, you can use WinSCP) or from the VM:
[code gutter=”false”]wget –no-check-certificate https://<IP or FQDN of vCAC appliance>:5480/installer/LinuxGuestAgentPkgs.zip[/code]
Note: –no-check-certificate is needed when hitting an https link and you’re using self-signed certificates.
- If you used wget or SCP’d the entire zip file to root’s home, use unzip.
[code gutter=”false”]unzip -d LinuxGuestAgentPkgs LinuxGuestAgentPkgs.zip[/code]
Note: the -d flag will create a folder named LinuxGuestAgentPkgs and unzip there.
[code gutter=”false”]cd LinuxGuestAgentPkgs/rhel6-x86
rpm -i gugent-6.0.1-71.i386.rpm[/code]
- Open a browser window and go to https://<IP or FQDN of vCAC appliance>:5480/installer. Download the Linux guest agent packages & scp them to the CentOS VM (If you’re running Windows, you can use WinSCP) or from the VM:
- Download and install the Application Director agent bootstrap service.
[code gutter=”false”]wget –no-check-certificate http://p10-l1-appd01.dooleylab.dns/agent/vmware-appdirector-agent-service-vcac_6.0.0.0-0_i386.rpm
rpm -i vmware-appdirector-agent-service-vcac_6.0.0.0-0_i386.rpm[/code] - Register the Application Director agent bootstrap service to the vCloud Automation Center server.
[code gutter=”false”]/opt/vmware-appdirector/agent-bootstrap/vcac-register.sh -r vCAC_Port -s IaaS_Server_FQDN[/code]
Note: You may see errors in the output saying that it’s unable to get the local issuer certificate, however it should still work, as I received those errors but still successfully deployed the template.
- Verify that the vrm-agent and vmware_appdirector_agent services are set to on for runlevel 3.
[code gutter=”false”]chkconfig –list | grep agent[/code]
- Verify that the dmidecode-2.11-2.el6.i686 rpm is installed. (It should be already.)
[code gutter=”false”]rpm -qa | grep dmi[/code]
- Register and run the vCloud Automation Center agent.
[code gutter=”false”]/usr/share/gugent/installgugent.sh vCAC_FQDN_or_IP:443 ssl
/usr/share/gugent/rungugent.sh[/code]You should receive a number of application debug messages. Providing no error messages are returned, you’re good to go.
- Shutdown the VM and take another snapshot.
Create the vCloud Automation Center blueprint
- Chances are that the data collection processes haven’t run on the vCAC server yet, so login and go to Infrastructure > Compute Resources > Compute Resources. Hover over the compute resource that contains the CentOS VM and click on Data Collection. Request the Inventory, State, and Performance data collection processes. Click Refresh to see their progress.
- Create the blueprint using the Clone workflow, making sure to select the latest snapshot that was taken on the CentOS template VM.
Update the CentOS 6.3 logical template
- Login to vCloud Application Director using a vCloud Automation Center business group user that has a minimum of Application Architect, Application Catalog Administrator, Application Cloud Administrator, Application Publisher and Deployer roles assigned in vCloud Automation Center Administration > Groups.
Note: If you’re using an Active Directory identity source and didn’t enter a domain alias, you’ll need to use the fully qualified domain name. - Create a cloud provider if one hasn’t been created already, and add the CentOS 6.3 template (blueprint).
Note: If you get a credentials error, see this post about case sensitivity depending on the type of tenant identity source you’re using. - Go to Logical Templates > CentOS 6.3 32bit > Logical Template Versions > Edit > New Cloud Template Mapping. Choose the registered cloud provider and CentOS 6.3 cloud template, then save.
- Go to Deployment Environments > Create a Deployment Environment > give it a name, choose the registered cloud provider.
Deploy the jPetStore application
- Go to Applications > jPetStore > Application Versions > Create Deployment Profile, give it a name, then deploy.
- Step 1: Deployment Environment – click Map Details and make sure that the Node Name is jPetStore, Logical Template is CentOS63 32bit, and Cloud is the CentOS 6.3 x32 template.
- Step 2: Application Properties – You can leave the vCPU and Memory property values blank and they’ll use the values defined in the jPetStore application blueprint, providing you have a minimum of 2048MB defined in the vCAC blueprint or a maximum equal to or more than 2048MB. If you have 1024MB defined as the minimum and maximum and don’t specify 1024MB as the new memory property value, deployment will fail. You can choose to enter a hostname, otherwise Application Director will give is a random name starting with jPetSt. The blueprint’s machine prefixes have no effect here.
- Step 3: Execution Plan – there’s nothing to do on this page for the out of the box version of jPetStore.
- Step 4: Review – You can choose to Publish first, which will add this deployment in vCAC’s Catalog Items in the appropriate business group scope. If you don’t want to publish it to vCAC, click Deploy. Note: You’ll still need add it to the appropriate service for it to be made available to an entitled vCAC user.
- After the deployment completes successfully, grab the VM’s IP address from the deployment details. Navigate to http://jPetStore_VM_IP:8080/jpetstore-1.0.0 and enjoy jPetStore in all of its glorious glory. 🙂
Environment:
- vCloud Application Director 6.0.1.0 Build 1571033
- vCloud Automation Center 6.0.1 Build: 1571033, using vCenter’s SSO
- vCenter Server Appliance 5.5.0.10100 Build 1750781
- CentOS 6.3 32 bit template dated 2013-12-10
[…] couple months ago, I blogged about setting up the CentOS 6.3 template for what was then known as Application Director. The […]