Hello All,

I'm trying to get my feet wet with using packer for template management in 
my vSphere environment.   I've started with a simple case following this 
blog ( 
https://theithollow.com/2017/03/06/using-packer-create-vsphere-aws-images/ ) 
and adjusting based on other examples I've found online.    

Using VMware workstation (trying both windows and linux as a host) on my 
local VM, I've attempted to use either the vmware-iso or vmware-vmx 
builders to create a VM within Workstation and then use the vsphere 
post-provisioner to distribute to my vsphere environment.  While the 
builders and provisioner seem to work flawlessly, the vsphere 
post-provisioner keeps erroring out with "Script disconnected unexpectedly" 
and deleting the working directory.   

ovftool is in the $PATH


Is there something I'm missing?   Is there some other method or plugin that 
I need here?

Example of my json:

{
    "builders": [
        {
            "type": "vmware-vmx",
            "source_path": 
"/root/Downloads/output-vmware-iso/test-centos.vmx",
            "ssh_username": "vagrant",
            "ssh_password": "vagrant",
            "ssh_wait_timeout": "10000s",
            "shutdown_command": "echo 'shutdown -P now' > shutdown.sh; echo 
'vagrant' | sudo -S sh 'shutdown.sh'"
        }],
    "provisioners": [
        {
            "type": "shell",
            "inline":
            [
                "sleep 30",
                "sudo yum -y update ",
                "sudo yum -y install git",
                "sudo touch ~/I_DID_MORE_THINGS",
                "sudo shutdown -h now"
            ]
        }],
        "post-processors": [
            {
                "type": "vsphere",
                "host": "vCenter-hostname",
                "username": "vCenter-user",
                "password": "vCenter-password",
                "cluster": "CLUSTERNAME",
                "datacenter": "DATACENTERNAME",
                "resource_pool": "RPNAME",
                "datastore": "DATASTORENAME",
                "vm_folder": "FOLDER",
                "vm_name": "test1",
                "vm_network": "PORTGROUP",
                "disk_mode": "thin",
                "insecure": "true"
            }
        ]

}

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/db842bd2-ba62-4169-8468-fb8bd9154048%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to