Cloudbase-Init with vRealize Automation and vSphere - No CD Drive!

This article explains how to use Cloudbase-Init with vRealize Automation and vSphere without requiring a CD drive in every Windows VM.

Cloudbase-Init with vRealize Automation and vSphere - No CD Drive!

If you follow this blog or have stumbled upon it through a web search then you could be forgiven for thinking that this post looks a lot like one that I published back in May 2021. It sort of is, but it's much shorter!

Back then I created a simple process to take the cloud-config section of a Cloud Template in vRA and pass it to a deployed vSphere VM through "guestinfo".

Guestinfo refers to configuration or data that is applied to the VM object in vCenter and can be read by the guest OS (e.g. RHEL, CentOS etc) using VM tools.

It has worked flawlessly in my HomeLab ever since and means that my VM templates don't have CD drives, which for some customers that I work with is a big no-no.

The problem at the time however, was that I only had it working for Linux VMs. The Cloud-Init datasource that some of my colleagues at VMware had created only worked with Linux, not Windows. I decided that I would fork that Git repository and try to created something that would work with Windows. This would not only help my HomeLab and customers, but it would also give some valuable Python experience.

I still didn't have anything working by the end of August (too many other projects) and tried to sit down and focus while I was on PTO. Whilst reading the documentation for Cloudbase-Init, I noticed that the vmwareguestinfo data source is built in already!!! I really should have just RTFM in the first place!!!

So, how do we enable it?

In two of my previous posts, I covered how to install Cloudbase-Init and how to automate installing Cloudbase-Init as part of a Packer build. To setup vmwareguestinfo as a data source, it is simply a matter of changing the Cloudbase-Init configuration file.

The file that needs changing is (by default) C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init.conf. The following line needs to be added to tell Cloudbase-Init to use guestinfo:

metadata_services=cloudbaseinit.metadata.services.vmwareguestinfoservice.VMwareGuestInfoService

That was it! The same process that I created originally worked flawlessly for Windows as well.