Halo! Saya Ask Owen. Tanyakan tentang proyek, pengalaman, skill, pendidikan, atau cara menghubungi Owen.
Platform Engineering
Designing Self-Service VM Provisioning on VMware vSphere
How to turn a VM request into validated inputs, an inspectable Terraform plan, repeatable configuration, and a clear handover.
Self-service infrastructure is not a form with a “Create VM” button. It is a contract between the requester, the platform, and the team that will operate what gets created.
The interface may be simple, but the system behind it still has to resolve template readiness, compute placement, networking, naming, access, configuration, and lifecycle ownership.
Define the request contract first
I start by separating what the requester decides from what the platform owns.
The requester can usually express intent:
- operating-system family;
- workload environment;
- approved size or capacity class;
- network zone;
- application owner and cost context;
- required configuration profile.
The platform translates that intent into implementation details such as the template, datastore policy, cluster placement, tags, and configuration roles.
This boundary keeps the form understandable and prevents internal infrastructure detail from becoming a permanent public API.
Validate before planning
Validation should answer whether the request is coherent before Terraform contacts the target platform.
request:
environment: non-production
operating_system: rhel
size: standard-small
network_zone: application
owner: team-referenceUseful checks include allowed combinations, naming rules, required ownership, template availability, and whether the selected configuration path supports the chosen operating system.
Make the plan a review interface
Terraform’s plan is more than a technical artifact. It is the point where intent becomes an inspectable infrastructure change.
The plan should make the following visible without exposing credentials:
- resources that will be created;
- resolved template and placement decisions;
- network and storage relationships;
- tags and ownership metadata;
- any replacement or deletion behavior.
For higher-risk environments, approval belongs between plan and apply. The approval should refer to the exact saved plan so the reviewed change and executed change remain the same.
Separate provisioning from configuration
Terraform is well suited to creating the VM and its infrastructure relationships. Ansible is well suited to configuring the guest after it becomes reachable.
I keep these responsibilities distinct:
- Terraform clones and configures the virtual machine.
- The workflow waits for the guest and records its reachable identity.
- Ansible applies the selected operating-system baseline.
- Validation checks confirm that the requested capability is available.
- The result is handed over with owner, state, and next action.
That boundary makes partial failure easier to reason about. A configuration failure does not mean the VM was never created, and a retry should not accidentally create a second machine.
Treat retries as a product requirement
A self-service workflow will eventually stop after one system has changed and another has not. The interface needs to explain that state.
Possible outcomes include:
- request rejected before planning;
- plan created and waiting for approval;
- infrastructure created, configuration pending;
- configuration failed with a safe retry path;
- validation failed after configuration;
- provisioning completed and ownership handed over.
The worst response is a generic “pipeline failed.” A useful response names the completed checkpoint and the next safe action.
Windows and Linux are different paths
Windows Server and Linux templates may share a request model, but they do not share every readiness signal, connection method, hardening role, or restart behavior.
Trying to erase those differences usually creates hidden branching. I prefer one visible workflow with operating-system-specific modules and validation rules. The shared interface remains consistent while the implementation stays honest.
Provisioning is not the end of the lifecycle
A VM should enter the environment with enough context to be operated later:
- an accountable owner;
- an environment and purpose;
- a configuration baseline;
- monitoring or registration expectations;
- an expiry or review policy when applicable;
- a documented route for change and decommissioning.
Self-service becomes valuable when it shortens the request path without removing the controls that make infrastructure supportable. The goal is not instant creation. The goal is a repeatable path from a clear request to an owned, inspectable result.
