This repository is a sample how user terraform in a VMware environment.
How to deploy a virtual machine with Terraform and set it with a custom parameters. This can be very useful saving time in production environment.
Pre requirement :
-
vCenter Appliance (using with 1 ESXi). --> 1 DATACENTER --> 1 DATASTORE --> 1 CLUSTER --> 1 vsphere virtual network name
-
Lastest terraform version (Using Windows or Linux CLI see : https://www.terraform.io/downloads.html)
-
a cloned Virtual Machine within VMware tools installed.
-
If you use a Linux environment you have to install terraform.
-
Open CLI command (DOS or Bash).
-
Go to terraform folder and terraform.exe.
-
"terraform init" to initialize terraform.
-
Go to Windows or Linux folder.
-
Set appropriate variables on "variable.tf" and "main.tf" files.
-
Check your deployement using "terraform plan" command.
-
Deploy your VM using "terraform apply" command.
-
You are able to destroy your ressource using "terraform destroy".