In part 4 we published an application blueprint through Application Serivces, that is pretty awesome but we still really haven’t done anything just yet. I mean its all just about working but the real hard part is creating the application blueprints. Just for fun, lets create a generic blueprint and run a deployment. While logged into Application Services go to Applications and click on the green + (plus) button to create a new application.
- Name the application and select a business group, if you've followed along my various home lab series you would select StarWars here since it is the only business group we gave permission to in vRealize Automation.
- Click save, click Create Application Version then click Save
- Now you are able to create a blueprint; click Create Blueprint
- Drag the logical template to the design pane, again if you're following along with me this would be the CentOS 64 logical template
- Now all this would do is create a virtual machine like you could do through vRealize Automation or vSphere; here however we also have several preconfigured services we can drag into our logical template to install applications.
- Let's do a typical single node web and database server
- Drag Apache, vFabric RabbitMQ and and vFabric Postgres into the logical template, it should look something like this:
Now one of the hardest parts about automating something is now all the dependencies. In this scenario I happen to know a few things are missing, not because I am a genius but because I went through several iterations of this blueprint before getting it to work. This, however also allows me to demo some other features of Application Services. In my CentOS template, SELinux is enabled - now I could convert my template to a virtual machine, disable it, clean up the virtual machine machine again and convert it back to a template. It’s what I would have done not 6-8 months ago. Now, however, I’ll simply use the tools available to me, tools like Application Services or Ansible to put the virtual machine into the state I want it:
- From the Application Components page, drag two "script" items into the logical template
- Edit the first script by clicking on it; name it (no spaces), click on Actions, click "Click here to Edit," copy the following into the window and click the reboot checkbox
set SELinux disabled
cp /etc/selinux/config /etc/selinux/config.bak
sed -i s/SELINUX=permissive/SELINUX=disabled/g /etc/selinux/config
- SELinux will now be disabled upon reboot.
- We also have to tweak the EPEL install to allow it to pull data properly (seems to be a known issues right now). Rather than letting the EPEL package install as part of the services we used earlier, we can also do that in a script and configure the options we need for it to work.
- Edit the 2nd script as you did before but copy the following into the window
yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sed -i “s/mirrorlist=https/mirrorlist=http/” /etc/yum.repos.d/epel.repo
- Click the OK button, you should now see something like this:
- Now click the deploy button, name the deployment, and select the business group
- Click Map Details, ensure all details match what you have setup, and click Next
- Provide a name to your virtual machine and edit CPU and memory as needed (and to match your vRA blueprint limits) - click Next
- Review the deployment blueprint and click Next
- Click the deploy button (you could also publish to vRA here as we did in part 4, but I'm just demonstrating the deployment)
- The deployment will start
Now at one point I wasn’t sure it was working, I could see Application Services say it was working (system was under 80-90% load consistently) however I wanted to see what vSphere was doing. As you an see in the two screenshots below, the virtual machines are being deployed as you might expect (they are from two different deployments so yes the dates are different)