josenk / terraform-provider-esxi

Terraform-provider-esxi plugin
GNU General Public License v3.0
538 stars 154 forks source link

Esxi Guest WIndows 10 can't get the IP Address #181

Closed michaelpk13 closed 2 years ago

michaelpk13 commented 2 years ago

Describe the bug After terraform apply i can't get the IP Address for my newly deployed windows 10 vm (clone from vm). i can console to my newly deployed windows 10 VM without problem. after running ipconfig in windows CMD, i can see the IP Address that the VM got from DHCP Server.

To Reproduce Steps to reproduce the behavior:

  1. terraform plan
  2. terraform apply
  3. terraform refresh
  4. output only returned " ip_address = "" "

Expected behavior before this i tried using linux and i got the IP Address without problem. i expect to get the IP Address like the linux i tried before but sadly the ouput for windows is empty.

Terraform files main.tf terraform { required_version = ">= 0.12" } provider "esxi" { esxi_hostname = var.esxi_hostname esxi_hostport = var.esxi_hostport esxi_hostssl = var.esxi_hostssl esxi_username = var.esxi_username esxi_password = var.esxi_password } resource "esxi_guest" "w_guest" { guest_name = var.w_instance_name disk_store = "n-DS1" boot_firmware = "efi" boot_disk_type = "thin" boot_disk_size = "30" memsize = "4090" numvcpus = "2" resource_pool_name = "/" power = "on" clone_from_vm = "wtemplate" network_interfaces { virtual_network = "VM Network" nic_type = "e1000e" } guest_startup_timeout = 45 guest_shutdown_timeout = 30 }

outputs.tf output "ip_address" { value = esxi_guest.w_guest.ip_address } Desktop (please complete the following information):

josenk commented 2 years ago

From the README.

ip_address - Computed - The IP address reported by VMware tools.

Do you have VMware tools installed on your Windows image?

michaelpk13 commented 2 years ago

I'am so sorry for the inconvenience, this is my first project using esxi and using terraform. After the kali one can get IP without VMware tools i just assume it's the same for windows. after installing the vmware tools now i cant get the IP of the newly deployd Windows VM. Once again I apologize for my mistake and I am grateful for your guidance sir