Vsphere-template ... reregister_vm = false skips the folder setting

Hi, everybody!

I tried to mark a previous OVA upload as template. So I used vsphere post-processor to upload and vsphere-template post-processor to turn the upload into a template. So far the idea.

At first I received EOF errors on the vsphere-template pre-processor. The documentation said “try setting reregister_vm to false”. So I did. And it worked.

But … I had specified a folder for the template. The post-processor actually cared to create this folder. But it did not move/rename the VM, now being a template, there.

I would guess that normally the VM gets unregistered in its original place (root) and re-registered in its target-folder. Switching off the registering, renders the VM stuck in its place and the move won’t happen.

From my point of view this is not exactly the expected behaviour. Is there a fix or workaround for this?

source "null" "uploader" {
    communicator = "none"

build {
    sources = [

    post-processors {

        post-processor "artifice"{
            files = ["output/ubuntu/packer-ubuntu-server.vmx"]

        post-processor "vsphere" {
            keep_input_artifact = true

            vm_name = "ubuntu"

            host = ""
            esxi_host = ""
            datacenter = "Adrians Stack"
            cluster = "Hells Dells"
            datastore = "Saga DS2"
            vm_network = "VM Network"

            overwrite = true

            insecure = true
            username = "koffeiniker@stack.local"
            password = "#####"

        post-processor "vsphere-template" {

            host = ""
            username = "koffeiniker@stack.local"
            password = "#####"

            insecure = true

            folder = "/Packer Templates"

            reregister_vm = false

Again: result of this packer-template is an empty folder, named as requested and the template-VM, properly marked but still in the DC-folder.

 packer build .\upload.pkr.hcl
null.uploader: output will be in this color.

==> null.uploader: Running post-processor:  (type artifice)
==> null.uploader (artifice): Using these artifact files: output/ubuntu/packer-ubuntu-server.vmx
==> null.uploader: Running post-processor:  (type vsphere)
    null.uploader (vsphere): Uploading output/ubuntu/packer-ubuntu-server.vmx to vSphere
    null.uploader (vsphere): Validating Username and Password with dry-run
    null.uploader (vsphere): Calling OVFtool to upload vm
    null.uploader (vsphere): Opening VMX source: output/ubuntu/packer-ubuntu-server.vmx
    null.uploader (vsphere): Opening VI target: vi://koffeiniker%40stack.local@
    null.uploader (vsphere): Deploying to VI: vi://koffeiniker%40stack.local@
    null.uploader (vsphere): Transfer Completed
    null.uploader (vsphere): Completed successfully
==> null.uploader: Running post-processor:  (type vsphere-template)
    null.uploader (vsphere-template): Waiting 10s for VMware vSphere to start
    null.uploader (vsphere-template): Choosing datacenter...
    null.uploader (vsphere-template): Creating or checking destination folders...
    null.uploader (vsphere-template): Creating folder: ubuntu
    null.uploader (vsphere-template): Marking as a template...
Build 'null.uploader' finished after 2 minutes 52 seconds.

==> Wait completed after 2 minutes 52 seconds

==> Builds finished. The artifacts of successful builds are:
--> null.uploader: Did not export anything. This is the null builder
--> null.uploader: Created artifact from files: output/ubuntu/packer-ubuntu-server.vmx
--> null.uploader: VM: ubuntu Folder:  Datastore: Saga DS2
--> null.uploader: VM: ubuntu Folder:  Datastore: Saga DS2

Best regards and thanks in advance,

Meanwhile I found the vm_folder option of the vsphere post-processor.

This seems to work now. So I need to spec vm_folder in vsphere and folder in vsphere-template. A move actually doesn’t happen.