I have admin level access in the vsphere environment but I keep getting the permissions denied error below. I posted the debug error logging message below and a snippet of my code. One thing I do have in my vars, the "vsphere_cluster" in vsphere 6.7 has spaces in its name. Can that be causing the error ....
vsphere-iso: output will be in this color.
2020/05/22 16:01:45 Build debug mode: false
2020/05/22 16:01:45 Force build: false
2020/05/22 16:01:45 On error:
2020/05/22 16:01:45 Preparing build: vsphere-iso
2020/05/22 16:01:46 Waiting on builds to complete...
2020/05/22 16:01:46 Starting build run: vsphere-iso
2020/05/22 16:01:46 Running builder: vsphere-iso
2020/05/22 16:01:46 [INFO] (telemetry) Starting builder vsphere-iso
2020/05/22 16:01:46 packer-provisioner-ansible plugin: ansible-playbook version: 2.9.9
==> vsphere-iso: Creating VM...
Build 'vsphere-iso' errored: error creating vm: ServerFaultCode: Permission to perform this operation was denied.
2020/05/22 16:01:46 [INFO] (telemetry) ending vsphere-iso
2020/05/22 16:01:46 machine readable: error-count []string{"1"}
==> Some builds didn't complete successfully and had errors:
2020/05/22 16:01:46 machine readable: vsphere-iso,error []string{"error creating vm: ServerFaultCode: Permission to perform this operation was denied."}
==> Builds finished but no artifacts were created.
==> Some builds didn't complete successfully and had errors:
2020/05/22 16:01:46 [INFO] (telemetry) Finalizing.
--> vsphere-iso: error creating vm: ServerFaultCode: Permission to perform this operation was denied.
{
"vsphere_network": "dev-VLAN-34",
"vsphere_cluster": "servers - Dev",
"vsphere_resource_pool": "dev-pool",
"vsphere_datastore": "dev-01",
}
{"builders": [
{
"type": "vsphere-iso",
"username": "user",
"password": "xxxxxxxx",
"insecure_connection": "true",
"vm_name": "buildlinuxvm",
"datastore": "{{user `vsphere_datastore`}}",
"cluster": "{{user `vsphere_cluster`}}",
"host": "{{user `vsphere_host`}}",
"convert_to_template": "true",
"network": "{{user `vsphere_network`}}",
"boot_order": "disk,cdrom",
"guest_os_type": "ubuntu64Guest",
"ssh_username": "jetbrains",
"ssh_password": "jetbrains",
"CPUs": 1,
"RAM": 1024,
"disk_controller_type": "pvscsi",
"disk_size": 10240,
"disk_thin_provisioned": true,
"network_card": "vmxnet3",
"iso_paths": [
"[ngadev-unify-01] packer_cache/ubuntu-18.04.4-server-amd64.iso"
],
"iso_checksum": "e2ecdace33c939527cbc9e8d23576381c493b071107207d2040af72595f8990b",
"iso_checksum_type": "sha256sum",
"floppy_files": [
"./http/preseed_server.cfg"
],
"boot_command": [
"<enter><wait><f6><wait><esc><wait>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs>",
"/install/vmlinuz",
" initrd=/install/initrd.gz",
" priority=critical",
" locale=en_US",
" file=/media/preseed_server.cfg",
"<enter>"
]
}
],