

My Automated Lab project: #4 Deploy the VMs from templates using Terraform
source link: https://www.virtualtothecore.com/my-automated-lab-project-4-deploy-the-vms-from-templates-using-terraform/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

My Automated Lab project: #4 Deploy the VMs from templates using Terraform
Install Terraform
sudo apt-get install jq unzip -y # pull latest using github api export TERRA_VERSION=$(curl -sL https://api.github.com/repos/hashicorp/terraform/releases/latest | jq -r ".tag_name" | cut -c2-) # download wget https://releases.hashicorp.com/terraform/${TERRA_VERSION}/terraform_${TERRA_VERSION}_linux_amd64.zip # unzip unzip terraform_${TERRA_VERSION}_linux_amd64.zip # set permissions and move into path chmod +x terraform sudo mv terraform /usr/local/bin # validate terraform version
Configure the Terraform plan for my first Windows VM

variable "vsphere_user" {} variable "vsphere_password" {} variable "vsphere_server" {} variable "vsphere_dc_name" {} variable "vsphere_datastore" {} variable "vsphere_compute_cluster" {} variable "vsphere_portgroup_name" {} variable "vsphere_folder" {} variable "vsphere_template_name" {} variable "winadmin_password" {} variable "server_name" {} variable "server_IP" {} variable "netmask" {} variable "def_gw" {} variable "dns_server" {} variable "server_cpu_num" {} variable "server_mem" {} variable "firmware" {}
# Which Windows administrator password to set during vm customization winadmin_password = "Veeam123!" # Firmware of template firmware = "bios" # VBR Server settings server_name = "vbrserver" server_IP = "172.27.217.62" server_cpu_num = 4 server_mem = 6144 # Common network params netmask = "24" def_gw = "172.27.217.1" dns_server = "172.27.217.21"
Execute the Terraform plan
terraform init
terraform validate
terraform apply
Terraform will show us what it is about to modify:



Recommend
-
11
How to Deploy a Full Environment for a Wordpress Site via Docker by Using Terraform ...
-
11
-
8
Using Terraform to Deploy AWS ResourcesProvisioning infrastructure resources has always been a time-consuming manual process. Infrastructure has now moved away from physical hardware in data centers to software-defined infrastructure using vi...
-
5
The goal of this article is to help developers understand and use
-
8
How To Deploy EKS Cluster on AWS using TerraformSearch ComputingForGeeksElastic Kubernetes Service is a mana...
-
6
-
25
How To Deploy and Manage Redis Database on AWS Using Terraform ...
-
6
Code is available on GitHub Telegram bots Telegram, one of the biggest messenger platform, offers a Bot API that allows third-party automation
-
9
My Automated Lab project: #6 Create a S3 Bucket with Terraform Luca Dell'Oca,
-
8
The configuration files This time, I have a little bit different configuration: As always, you can grab the files in my Github repo at
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK