Update 4/10/19 – Found out that we needed to have Perl as a requirement in the template for vCenter to do its magic.
In previous post (here) I walked through how to build a Ubuntu template that was ready to be used in vRealize Automation Cloud. In this follow-up post I will walkthrough the process to make a vRealize Automation Cloud Ready CentOS template. This one is super easy!!
Prerequisites:
- A downloaded copy of CentOS (I test this with CentOS 7 and 8)
- A working vSphere environment.
- A subscription to VMware vRealize Automation Cloud.
- About 15 minutes!!
Deploying the CentOS Image:
Again, I am going to assume that you have deployed many an OS image via a provided ISO so I am not going to go step through that process. A couple suggestions, but not mandatory, when you go through the initial CentOS build:
- Try to use DHCP from the start. It will prevent you from having to change it to DHCP later (if, of course, you’re going to use DHCP which will make life easier)
- Make sure to keep auto-updates off. It can cause issues down the road that are a pain to troubleshoot.
Configuring the Image:
The below steps are the important ones when creating a template that will work great with Cloud Assembly.
- After going through the initial install, log in as root through SSH (for easy copy and paste).
- After you have complete the initial installation of CentOS, you will need to install cloud-init.
- yum install -y cloud-init
- yum install -y perl (perl is required across the board)
- Perform any image level configurations you wish. (for example: disable firewall <systemctl disable firewalld> or disable root login, etc, etc.)
- Run the following command to clean cloud-init.
- cloud-init clean
THAT’S IT!!! You’re done. Shutdown the VM and convert it to a template.
Using the Content Catalog in Cloud Assembly
Cloud Assembly can use the content catalog as a source for templates as well as using templates that are stored on clusters associated to the vCenters you used for Cloud Accounts. Now that you have your template you can ‘Clone to Library’ to put the template into a content library.
Next, in Cloud Assembly, go to your vSphere Cloud account and click on the Sync Images button.
Finally, you can go into Image Mappings and select the template hosted on a cluster or from the Content Catalog.
You now have a an CentOS template ready to be deployed via a Cloud Assembly blueprint and ready to be configured using Cloud Config.
In Closing….
Using the steps above you now have CentOS templates that is ready to be used in Cloud Assembly with cloud-init. In a future post I will show how to create a Windows Server template for Cloud Assembly.