# Vsphere terraform - best practices and how to manage - help

**URL:** <https://discuss.hashicorp.com/t/vsphere-terraform-best-practices-and-how-to-manage-help/77165>\
**Category:** Terraform\
**Created:** [February 16, 2026, 3:48pm UTC](https://discuss.hashicorp.com/t/vsphere-terraform-best-practices-and-how-to-manage-help/77165 "2026-02-16T15:48:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomcatprime](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/tomcatprime/32/47079_2.png) [@tomcatprime](https://discuss.hashicorp.com/u/tomcatprime)\
**Post date:** [February 16, 2026, 3:48pm UTC](https://discuss.hashicorp.com/t/vsphere-terraform-best-practices-and-how-to-manage-help/77165/1 "2026-02-16T15:48:36Z")

</div>

Hey everyone,

I’m currently tasked with moving about 2,000 VMs over to Terraform. Most of these are for our devs, and they’re organized in vSphere folders by username (e.g., `Devs/jsmith/vm-01`).

I’m trying to avoid a “copy-paste”, so I’m thinking about this setup:

- **Global Module:** One master VM module that handles all the vSphere heavy lifting.

- **T-Shirt Sizing:** A global map (Small, Medium, Large) so I can standardize resources across the whole fleet in one place.

- **The Workflow:** I want to manage everything through `terraform.tfvars`. If a dev needs a VM, I just add an object to a map in the vars file. If they’re done, I delete that line.

With 2k VMs, a single state file sounds like a performance nightmare. Should I break these into multiple “Dev” folders with separate state files to keep `terraform plan` fast or maybe one state file per developer folder?

As backend I am planning to use MinIO, any tips on handling state locking or specific S3 endpoint configs I should watch out for?

What’s the best way to handle the `Devs/<username>` path dynamically so Terraform doesn’t trip over itself if a folder doesn’t exist yet?

I’ll be grateful for all advices.

Thank you so much 🙂

---

<div class="post-metadata">

**Author:** ![william\_hashicorp](https://avatars.discourse-cdn.com/v4/letter/w/ce73a5/32.png) [@william\_hashicorp](https://discuss.hashicorp.com/u/william_hashicorp)\
**Post date:** [March 17, 2026, 2:56pm UTC](https://discuss.hashicorp.com/t/vsphere-terraform-best-practices-and-how-to-manage-help/77165/2 "2026-03-17T14:56:20Z")

</div>

Did you end up figuring it out?

---

<div class="post-metadata">

**Author:** ![tomcatprime](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/tomcatprime/32/47079_2.png) [@tomcatprime](https://discuss.hashicorp.com/u/tomcatprime)\
**Post date:** [August 5, 2026, 3:18pm UTC](https://discuss.hashicorp.com/t/vsphere-terraform-best-practices-and-how-to-manage-help/77165/3 "2026-08-05T15:18:01Z")

</div>

Hello,

I initially set up a basic Terraform project, but it wasn’t very practical for the test cluster given how frequently VMs are deployed and destroyed. Instead, I created an Ansible playbook to deploy VMs on demand based on requests.
