LESS ERROR : load error: failed to find /home4/kacole2/public_html/templates/tx_zenith/less/typography.lessLESS ERROR : load error: failed to find /home4/kacole2/public_html/templates/tx_zenith/less/template.lessLESS ERROR : load error: failed to find /home4/kacole2/public_html/templates/tx_zenith/less/responsive.lessLESS ERROR : load error: failed to find /home4/kacole2/public_html/templates/tx_zenith/less/k2.less

Follow Me Icons

 

Follow @KendrickColeman on TwitterConnect on LinkedInWatch My Videos on YouTubeFollow me on FacebookCheck Out My Projects on GitHubStay Up To Date with RSS

Search

BSA 728x90 Center Banner

Optimized Pet Clinic App for Quick vCloud & Spring Demonstrations

There is a pretty cool little mulit-tiered Spring application that comes from VMware called Pet Clinic. I got the chance to play around with it for a little while during a current POC process and using it as an easy way to get apps spun up for tradeshows.

 

Pet Clinic has 2 virtual machines inside the vApp. An Apache Server and a Tomcat + Database Server. The vApp itself comes configured with static IP addresses, pre-configured application based on IPs, and a CentOS at a default.

 

When playing with the vApp, it took about 5-8 minutes to boot because of the all the standard services set to boot. That was the first thing that needed to be fixed. Second, customizations needed to happen. vCloud Director does a good job at doing the customization because it's done natively. Once the customization is done it breaks the spring application because the apache server is hard coded to point to the TC+DB server. So I figured it needed a little bit of automation.

 

First, I turned off a bunch of un-needed services which most were taken from this page. Now the vApp boots in about 1 minute exactly. A much better turn around time. This time doesn't include customizations which takes another reboot. So calculate 1:30-2 minutes for total boot time.

 

 

The next piece was figuring out a way to automatically update the proxy.conf file for apache (located at "/etc/httpd/conf.d/proxy.conf") to automatically change the built-in IP to the new IP. I know there are much cleaner ways to do this, but I figured it was best to let a bash file take care of this and initiate it from vCloud Customizations.

 

Here is the bash file

{codecitation=bash}

#!/bin/bash
#wait a few seconds to make sure the tomcat VM is up
sleep 15

#grab my current up address
ip=$(ip addr show eth0 | grep -o 'inet [0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+' | grep -o [0-9].*)

#Grab the first 3 octects of my current IP
first=$(echo $ip | cut -d"." -f1-3)

#Grab the last octect of my IP address
lasto=$(echo $ip | cut -d"." -f4-4)
echo $lasto

#Take the last octect a subtract 1
lastminus1=$(($lasto - 1))

#Set a variable for the missing period of the last octect
period="."

#Set the new IP Address of the Tomcat Server
newip=$first$period$lastminus1

#Run an if statement. If it pings the new IP, then quit.
#If not, take the last octect and add 1
if ping -c 1 $newip
then
finalip=$newip    
else
lastplus1=$(($lasto + 1))
finalip=$first$period$lastplus1
fi

#Replace the old IP with the new IP
sed -i "s/10.2.103.198/$finalip/g" /etc/httpd/conf.d/proxy.conf
service httpd restart

{/codecitation}

 

Here is the process to make it all work in vCloud Director:

1. Download the OVF of Pet Clinic. 

  • https://drive.google.com/open?id=1DYPZWAvFxJ1L0fwDuWTqsNns-sGTSrpU

un: root

pw: napa

 

2. Once downloaded to your desktop, open up vCloud Director and Navigate to your catalogs. Choose the catalog you wish to deploy to and then click the upload button.

 

3. The upload relies on Java RE so click yes and always trust the content so you don't have to worry about this again

 

4. Browse and Find your freshly download ovf

 

5. Choose an Org vDC to throw it in as well as a Storage Profile Type.

 

6. Click Upload and accept the SSL certificates and watch it upload.

 

7. After Upload completes it will be in your catalog.

 

8. Go to your cloud, choose to add a vApp from the catalog

 

9. Click on "All Templates", Choose Pet Clinic and Click Next.

 

10. Give it a name and a description (not necessary) and Click Next.

 

11. Select an Org vDC For Deployment, Configure the Virtual Machine Name (what you would see in vCenter (not necessary)) and select a Storage Profile for each VM. Click Next.

 

12. THIS STEP IS VERY IMPORTANT! You Must change the Computer Name to something other than the default. I don't know why, but you just have to. To put the VM on the correct network, you must hit the check box that says "Switch to the advanced networking workflow". Now you can select a new network and change the IP Assignment to "Static IP Pool". The VPLEX Network is what I was using for my tests and will not exist on your network. I also do not know if keeping the IP Assignment to DHCP will work, I never tested it out. But I can tell you that you should follow the steps laid out how Apache Server is configured.

 

13. Click Next, Next, Finish and let your vApp get deployed. You will notice that the properties for each VMs in the vApp already have the "Enable guest customization" button toggled. Leave it.

 

The Apache Server has a bit extra and has the customization script configured for you as well.

 

14. Turn on the vApp and let it go for about 2 minutes. After that, navigate to http://IP_OF_APACHE-SERVER/pets

 

If by some chance it's not working still. console into the Apache server.

Username: root

Password: napa

 

and do a "cat /etc/httpd/conf.d/proxy.conf" and make sure the IP address specified in there is the IP address of your Tomcat and IMDB Server

 

Want to try the same with the TravelApp? Download here:

 

https://drive.google.com/open?id=1f9uDaYTq7yUCoa5yii8YdKVSZeGDH2FH

Related Items

Related Tags

LESS ERROR : load error: failed to find /home4/kacole2/public_html/templates/tx_zenith/less/styles/blue.lessLESS ERROR : load error: failed to find /home4/kacole2/public_html/templates/tx_zenith/less/styles/green.lessLESS ERROR : load error: failed to find /home4/kacole2/public_html/templates/tx_zenith/less/styles/orange.lessLESS ERROR : load error: failed to find /home4/kacole2/public_html/templates/tx_zenith/less/styles/purple.less