-
Notifications
You must be signed in to change notification settings - Fork 106
Description
This issue was originally opened by @zerr0s as hashicorp/packer#10411. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.
Hi, forgive me for my bad english.
I'm trying to use packer to automate the creation of templates based on linux (ubuntu 20.04).
Actually I have a problem when packer clones the existing template to create the new VM: The nic is not connected at startup.
I have verified the existence of "ethernet0.startConnected = TRUE" if the vmtx file, and when I created a new vm using the template directly from the vsphere web interface, the option "Connected at startup" is correctly checked.
When the vm is created by packer, I have to check the option from vmware web to connet the nic. After that all provisionners can run correctrly.
What am I doing wrong ??
vmware version: 6.5
packer version: 1.6.5
{
"builders": [
{
"type": "vsphere-clone",
"vcenter_server": "xxxxx",
"datacenter": "xxxxx",
"username": "xxxx",
"password": "xxxxx",
"insecure_connection": "true",
"template": "ubuntu_server_20.04",
"communicator": "ssh",
"ssh_username": "auto",
"ssh_private_key_file": "./sshkey",
"boot_wait": "30s",
"host": "vmwarehost.local",
"vm_name": "newvm",
"datastore": "myds",
"folder": "packer-test",
"CPUs": 2,
"CPU_hot_plug": true,
"RAM": 2048,
"RAM_hot_plug": true,
"RAM_reserve_all": false,
"firmware": "bios",
"network": "LAN",
"customize": {
"linux_options": {
"host_name": "packer-test",
"domain": "mydomain.local",
"time_zone": "UTC"
},
"network_interface": {
"ipv4_address": "192.168.0.5",
"ipv4_netmask": "24"
},
"ipv4_gateway": "192.168.0.1",
"dns_server_list": ["192.168.0.1"]
}
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"ls -lrth /",
"echo done"
]
}
]
}
Thanks.