Part 1: Terraforming my vSphere homelab

Aleksandra Todorovska
3 min readJan 7, 2024

A reflection on getting started

Introduction

For the past two years, I have on and off dabbled in learning how to use Terraform. The following paragraphs will cover my reflection of that (still in progress) journey and in the 2nd post of this series will be the actual technical content.

Staying motivated

On the off chance the current reader is not already familiar with Terraform, I will start with a basic definition of Terraform. It’s an automation tool with declarative code, that simplifies mostly the infra provisioning category of the already established IT practice known as Infrastructure as code.

Terraform is also a technology agnostic tool in relation to where it is used, which means once learned, its usefulness extends beyond just managing a vSphere environment. However, the learning materials predominantly focus on using Terraform with cloud environments.

That’s one of the first hurdles I bumped into, as I was trying to learn Terraform by using courses and books that cover Terraform with AWS and Azure. Since my initial goal was using it with VMware’s on-prem vSphere and I couldn’t find a resource exclusively focusing on vSphere, this meant a lot of back and forward “translation” of the logic, concepts and syntax, and also studying in parallel more about vSphere (was prepping for the VCP-DCV certification). After a year, between that exhaustive practice and my irregular actual “coding” with Terraform caused by lots of yak shaving in my homelab, I decided yet again to restart that learning journey last September.

When trying to learn something new, willpower is just a catalyst to get the process started. What makes you stick to it, will be different for everyone and the following tips are what’s working for me so far.

  • Embrace the trial and error process

Since I was never able to set low enough expectations in the beginning when learning something new, experiencing the frustration of stupid mistakes is unavoidable. What I did to soldier through those moments of despair is taking breaks and trying to reflect on the progress (no matter how little it is) by documenting what’s working so far for potential knowledge articles in the form of note-to-future-self-to-avoid-pitfalls sort of a thing.

  • Find applied inspiration!

During the same frustration slip-ups, I also tried to find inspiration stories\case studies of what companies have achieved with Terraform where they present a simple overview to highlight the main concepts and key elements. This would put in perspective what is actually doable with this tool and inspire my enthusiasm to learn and produce ideas for tiny projects where I could implement the newly acquired skills.

  • Practice, practice, practice (with realistic goals)

By getting ideas for tiny projects, I would basically create a realistic goal to hit, which in turn gives some structure in the learning process. Having a destination of sorts, like for example be able to create folders in the vSphere inventory, helped direct my energy to write simple (read caveman) code that just works and then improve it to be in accordance with best practices.

Learning material

What I’m currently using as a learning material, is the following:

Terraform’s official documentation

Always in the correlation with:

  1. Key concepts — Terraform Best Practices (terraform-best-practices.com)
  2. Terraform Basics: Series Introduction (youtube.com) (These new series seem to just click with me better than the pluralsight course offered by Ned Bellavance)
  3. Terraform Cookbook | Packt (packtpub.com) (By far, the best approach of dividing a chapter is done in this book, which makes extrapolating the core takeaways easier despite the fact it’s still using the practical examples for cloud)

One off videos(focusing on vSphere):

  1. CODE 2755: Live Coding: Terraforming Your vSphere Environment

2. vSphere Automation Solutions — PowerCLI vs. Terraform*

3. PowerShell Guide to Terraform by Kyle Ruddy

*Account is needed to view content from the VMware conferences. A free one can be created via customer connect portal and then used for login.

Conclusion

Technology is advancing at a faster pace with each year that passes and continual learning is crucial for staying relevant as IT professionals. Mastering new tools also makes our jobs and lives easier. Such an investment is learning about Terraform and what I have to show for persevering in this learning journey will be covered in my next blog post.

--

--