Terraform Set EFI Boot

Still learning about Terraform and all the great ways it can help me do my job. I just reset my home lab and created my Linux VM template for CentOS. I went through the whole process to set it up as template and kicked off my Terraform file for a VM creation. It created the VM, but it when the VM booted it said “No OS Found”. Because this is not my first round having this issue I knew what the issue was, the boot mode was wrong. I did some research (Google) and found a great article with this same issue. From the article it states that Terraform by default, the boot mode is BIOS and VMware defaults VM is EFI. So needless to say I did not want to re-create my VM and change the setting to BIOS. In order to address this situation you need to modify some files.

Enough of that, lets get into it.

Edit the VM’s declaration file. Add the following line below “scsi_type”

firmware = var.vsphere_vm_firmware

Next add in the variable files the following line

variable "vsphere_vm_firmware" {}

Next edit your terraform.tfvars file. Place the line under the vsphere section

vsphere_vm_firmware = "efi"

With this process you can go about your business and create VM’s.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s