Packer VMware image with no DHCP

Hi,

This is for Windows image creating.
We are trying to build VMWare image using packer,our environment doesn’t have DHCP server.Winrm is getting a wrong ip address 169...*.My question is there a way I cna specify static ip address for my image build.

==> vsphere-iso: IP address: 169.254.97.161
==> vsphere-iso: Using winrm communicator to connect: 169.254.97.161
==> vsphere-iso: Waiting for WinRM to become available…

2021/04/23 11:49:06 packer-builder-vsphere-iso plugin: [ERROR] connection error: unknown error Post "http://169.254.97.161:5985/wsman": dial tcp 169.254.97.161:5985: connect: connection refused
2021/04/23 11:49:06 packer-builder-vsphere-iso plugin: [ERROR] WinRM connection err: unknown error Post "http://169.254.97.161:5985/wsman": dial tcp 169.254.97.161:5985: connect: connection refused
2021/04/23 11:49:11 packer-builder-vsphere-iso plugin: [INFO] Attempting WinRM connection…
2021/04/23 11:49:11 packer-builder-vsphere-iso plugin: [DEBUG] connecting to remote shell using WinRM
2021/04/23 11:49:11 packer-builder-vsphere-iso plugin: [ERROR] connection error: unknown error Post "http://169.254.97.161:5985/wsman": dial tcp 169.254.97.161:5985: connect: connection refused
2021/04/23 11:49:11 packer-builder-vsphere-iso plugin: [ERROR] WinRM connection err: unknown error Post "http://169.254.97.161:5985/wsman": dial tcp 169.254.97.161:5985: connect: connection refused
2021/04/23 11:49:16 packer-builder-vsphere-iso plugin: [INFO] Attempting WinRM connection…
2021/04/23 11:49:16 packer-builder-vsphere-iso plugin: [DEBUG] connecting to remote shell using WinRM
2021/04/23 11:49:16 packer-builder-vsphere-iso plugin: [ERROR] connection error: unknown error Post "http://169.254.97.161:5985/wsman": dial tcp 169.254.97.161:5985: connect: connection refused
2021/04/23 11:49:16 packer-builder-vsphere-iso plugin: [ERROR] WinRM connection err: unknown error Post "http://169.254.97.161:5985/wsman": dial tcp 169.254.97.161:5985: connect: connection refused

I am trying to set the static IP too because there is no DHCP on the network. Have you figured out a way to set a static IP?

I have similar issue, no DHCP environment I am setting up static ips as part of the FirstLogoncommand via autounattened.xml, problem is packer picks up the 169* ip even before the ip is set, any workarounds appreciated.