The operation is not supported on the object

I am setting up my packer template file and trying to create a linux template but keep getting “The operation is not supported on the object.” my esix host shows

haTask-ha-folder-vm-vim.Folder.createFolder-2098998511

Description
Creates a new folder

Folder:
State
Failed - The operation is not supported on the object.

Errors

I created a folder called Templates on datastore1 and in my json file I also set the folder like below.
“folder”: “Templates”,

I used the below Rockey Linux URL to get started. Any idea what I am missing?
https://docs.rockylinux.org/guides/automation/templates-automation-packer-vsphere/

Hi, can you share your build please ? should be easier for troubleshooting to know what you try to do.
For testing purpose, try to create a folder called RockyLinux (like in example) and set folder to “Templates/RockyLinux” to check if the error is the same or not. Maybe it assumes to have a subfolder within Templates :slight_smile:
Have a look to this Build 'vsphere-iso' errored: error creating vm: folder '/datacenter/vm/' not found · Issue #285 · jetbrains-infra/packer-builder-vsphere · GitHub

"variables": {
      "version": "0.0.X",
      "HTTP_IP": "yum.corp.lan",
      "HTTP_PATH": "packer/rockylinux/8/ks.cfg"
    },
    "sensitive-variables": ["vcenter_password"],
    "provisioners": [
      {
        "type": "shell",
        "expect_disconnect": true,
        "execute_command": "bash '{{.Path}}'",
        "script": "{{template_dir}}/scripts/requirements.sh"
      }
    ],
    "builders": [
      {
        "type": "vsphere-iso",
        "CPUs": 2,
        "CPU_hot_plug": true,
        "RAM": 2048,
        "RAM_hot_plug": true,
        "disk_controller_type": "pvscsi",
        "guest_os_type": "centos8_64Guest",
        "iso_paths": [
          "[datastore1] ISO/Rocky-8.7-x86_64-minimal.iso"
        ],
        "network_adapters": [
          {
            "network_card": "vmxnet3",
            "network": "VM Network"
          }
        ],
        "storage": [
          {
            "disk_size": 40000,
            "disk_thin_provisioned": true
          }
        ],
        "boot_command": [
        "<up><tab> text ip=192.168.x.xxx::192.168.x.xxx:255.255.255.0:template:ens192:none nameserver=192.168.x.x inst.ks=http://{{ user `HTTP_IP` }}/{{ user `HTTP_PATH` }}<enter><wait><enter>"
        ],
        "ssh_password": "password",
        "ssh_username": "root",
        "shutdown_command": "/sbin/halt -h -p",
        "insecure_connection": "true",
        "username": "{{ user `vcenter_username` }}",
        "password": "{{ user `vcenter_password` }}",
        "vcenter_server": "Ipaddress here",
        "datastore": "datastore1",
        "vm_name": "template-rockylinux8-{{ user `version` }}",
        "folder": "Templates",
        "host": "esxi8",
        "notes": "Template RockyLinux version {{ user `version` }}",
        "convert_to_template": true,
        "create_snapshot": false
      }
    ]
  }

=> Wait completed after 61 milliseconds 12 microseconds
2023/04/12 16:26:12 machine readable: error-count string{“1”}
2023/04/12 16:26:12 ui error:
==> Some builds didn’t complete successfully and had errors:
2023/04/12 16:26:12 machine readable: vsphere-iso,error string{“error creating vm: ServerFaultCode: The operation is not supported on the object.”}
2023/04/12 16:26:12 ui error: → vsphere-iso: error creating vm: ServerFaultCode: The operation is not supported on the object.
2023/04/12 16:26:12 ui:

Can you test the following :
For testing purpose, try to create a folder called RockyLinux (like in example) and set folder to “Templates/RockyLinux” to check if the error is the same or not. Maybe it assumes to have a subfolder within Templates :slight_smile:

I created a Folder called Templates/RockyLinux but made no difference.

ok, what kind of credentials are you using ? possible to try with local admin of your vcenter ? just to check if it’s permission related or not ?

What is your vCenter version ?

I am using the root account so permissions should be a non-issue. I don’t have vCenter.

Ok it comes clearer. I assume you got free esxi license ?
According to this doc, just specify host, without vcenter_server

Also, here’s a good example with esxi only

I also see it could be have some limitation with vspherz-iso and Esxi 7.0+

Corrent I am using the Free version of. I thought I removed the “vcenter_server”: appers not.
I my understanding Is I should still be able to use vsphere-iso builder for a standalone install of esxi. Ill have to research that more. I removed the vcenter_server but it complains it’s required. I am using Esxi 8.0

Yeah, in that case you should probably have a look to vmware-iso, which seems to allow direct connection to ESXi, it seems there’s no limits with 8.0 free version : VMware ISO - Builders | Packer | HashiCorp Developer