Deploy VMware vCenter 7 with Ansible

By | July 22, 2020

One of the many benefits of having a home lab is you get to tinker and try new things. If you are like me and have had to start over from scratch, you are not alone.

I can’t tell you how many times I have had to re-deployed VMware vSphere and vCenter in my lab environment testing and something just went wrong.

Having to deploy vCenter with one or two hosts every once a while is not the big of a deal. If you have to re-deploy several times or deploy the same variables to many hosts, well that is a different story.

Last year during NetApp Insight, I attended a lecture given by David Blackwell on how to deploy a NetApp array with Ansible and my mind was blown. This opened my eyes to the endless possibilities of what you could do with automating and getting repeated results using Ansible.

I noticed David was using a Macbook Pro and he made mention that you could deploy Ansible and run it locally. Needless to say, I installed Ansible later that evening.

During the conference, I ran into my good friend Sean and conveyed how awesome the Ansible lecture was. Sean knew of Dave and had already been working on some Ansible Playbooks and pointed me to his blog. Make sure to check out his website for some amazing content. You can modify the properties of the playbooks to enhance and automate additional steps and that’s what I did during my installation. Check out Madlabber

VMware ISO /OVA Preperation

In my last blog post, I downloaded the VMware vCenter 7 VCSA ISO using my VMUG Advantage membership, so I don’t need to download it.

Before we can automate the deployment of vCenter with Ansible, we need to do some minor work by extracting the OVA file from the downloaded ISO image.

I have an Ansible directory for all the various technologies, this helps keep things tidy.

Mount the vCenter 7 vcsa

browse to the vcsa folder

copy the vcsa ova to your Ansible VMware directory

extract the vcsa ova to your Ansible VMware Directory and rename the ova to something shorter, I named mine vcsa7.ovf

Open and edit the Deploy-VCSA.yml, on my mac, I have already Install Xcode as you need this to edit your yaml files.

  • notice the hostname, username, esxi variables, these will be located in the vcsa_vars.yml
  • make sure to select the VM Network Interface
  • make sure to set the validate cert to no, this is a lab and I am not concerned with certifications

Open and review the vCenter-properties.yml as these are the additional settings you can change.

  • you can enable SSO
  • you can deploy secondary vcenter and join existing SSO
  • you can Join AD

Open and edit the vcsa-vars.yml file

Deploy VMware Ansible YAML

Launch Terminal and run the following command

  • ~ansible-playbook Deploy-VCSA.yml

Go grab so coffee and monitor the Deployment of your vCenter VCSA 7, this usually takes roughly 20 minutes.

You have successfully deployed VMware vCenter 7 using Ansible.

Please follow and like us:

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.