Terraform Creates a Ubuntu 22.04 VM in VMware vSphere

preview_player
Показать описание
Learn to use #terraform to create a #ubuntu 22.04 VM in VMware vSphere ESXi.

We continue our work from the previous video by using the Packer image we created to clone it and build a VM in #vsphere.

We will see how to leverage #cloud-init to customize our VM as we build it.

▬▬▬▬▬▬ T I M E S T A M P S ⏰ ▬▬▬▬▬▬
00:00 - Introduction
01:24 - Run Terraform
01:47 - Terraform 101 Course Announcement
02:28 - Terraform Configuration Explained
11:42 - See the Results
14:22 - Wrap-Up

▬▬▬▬▬▬▬▬ Useful Links 🛠 ▬▬▬▬▬▬▬

▬▬▬▬▬▬▬▬ Playgrounds 🎠 ▬▬▬▬▬▬▬▬

▬▬▬▬▬▬▬▬▬ Courses 🎓 ▬▬▬▬▬▬▬▬
🎟️ Get 15% off of my Terraform 101 Course with this coupon ► YOUTUBE15TF101
🎟️ Get 15% off of my Vault 101 Course with this coupon ► YOUTUBE15VAULT101
▬▬▬▬▬▬▬▬ Community 🌎 ▬▬▬▬▬▬▬▬▬

▬▬▬▬▬▬▬▬ Connect 👋 ▬▬▬▬▬▬▬▬▬
Рекомендации по теме
Комментарии
Автор

Can I ask a question about a older video that you have? About building a k3s kubernetes cluster on vSphere using Terraform (cloud) and Packer? I don't have access to the Terraform cloud agent, so my question is if you really need to have Terraform cloud agent? If not how would you deploy the vm's and install k3s on them? Also a big thanks for creating both the Packer and the k3s terraform vSphere deployment!

flopfliepvlier
Автор

Hi sam,
THanks for your video. Very informative.

I tried it but using Rocky Linux 9.4 and extra_config doesn't seems to work and in consequence it just keep trying to create the VM until fail due exceed the timeout.

Do you know what can be happening?

jesusrivera
Автор

Hi sam,
I did all the steps you said in the video, but I get this error "timeout waiting for an available ip address". I increase the timeout, but it doesn't help. Is it possible for you to guide me on what to do?
vcenter 6.5

oyamakarateh
Автор

Hi! I have a question for you, I tried to deploy a Virtual Machine with Ubuntu with extra_configs but when the vm is created does not upload the cloud-init configurations. First, I created a Virtual Machine manually and then I created a template (clicked right on the vm --> template --> convert in template). I was looking for the issue and I found that would be possible that I need clone the virtual machine as OVF to use extra_config? I saw in vcenter that I can create a template as OVF (click right on the virtual machine --> clon as template in library and then select type of templante: OVF. In conclusio, the question is: is mandatory use a template as OVF to upload extra_configs to create a vm in vcenter?

fernandocampagna
Автор

Looks like the dns search string is hard coded into the metadata.yaml file. Anyway to fix that?
Also how would I got about setting a password for the ssh user?

DeadlyDragon_
Автор

Another question: if you want to create e.g. 3 VMs, how to use the count argument in combination of the locals?

alexanderlohn
Автор

Hi sir, thanks for the helpful video and GitLab code here! Does it want an actual VM or a Template in it seems like Terraform will only work with a VM, not a template....?

SamAndrew
Автор

Hi, I dont want to use a template but I want to use a iso from cdrom and some user-data to spin up a ubuntu vm, how to we do that?

tanniemartina
Автор

Hi, how to install terraform plugin in standalone ?

Koaxjo
Автор

what if i dont want to creat the vm in vsphere and just want the ISO to give someone else

cunninghamb
Автор

hi i used your configuration but unfortunately could not set user password for my vms can you please help me

Green_code
Автор

Where is the gitlab code? The link takes you to a blog post

genio
Автор

thank you for the tutorial but am facing an issue with my disk size if i set it up to size = 1 it works normally but if i set it to size = any number superior at 1 i get an error saying unable to enumerate all disks

anishanoune
Автор

I did all the steps, the machine is created, but the network and ssh_user templates are not applied, and VM up with template IP What was my mistake please?

MrArp
Автор

Disk size is not working if you give it a greater size! Do you know why?

alexanderlohn
Автор

so.. vm gets created, network get sconfigured by metadata from extra settings but... there seems to be issue with userdata - no users are created, cant enter the vm. no errors, the base64 encoded contents of file is present in tfstate and decodes properly.. still not applied. cant check logs, as vsphere console scrolls so fast and cant go up to see the output

zawiasfx
Автор

on your blog post, in the last line (GitLab repo) it's not true and open blog post again not gitlab.

MrArp
Автор

my code is very similar to the documentation, but terraform only creates a vm, when i open the vm via consoleweb, there is no Operating system. idk what i did wrong :(

iagor
Автор

Hah. I'm tf certified and can't even tf a hello world.

jmbaronster