Skip to content

Instantly share code, notes, and snippets.

@GMZwinge
Created February 27, 2018 15:59
Show Gist options
  • Save GMZwinge/8743b1be26a931d846c1b43aabb880fd to your computer and use it in GitHub Desktop.
Save GMZwinge/8743b1be26a931d846c1b43aabb880fd to your computer and use it in GitHub Desktop.
Sample Packer template for ESXi 6.0 or 6.5 and vCenter 6.5 that shows the entries uuid.bios and vc.uuid diseappearing from the .vmx file around the time the builder "vmware-iso" ends and the post processor "vsphere-template" starts, then reappear with different values some seconds later (10-15 in our case depending on hardware speed)
{
"builders": [
{
"type": "vmware-iso",
"remote_type": "esx5",
"remote_host": "{{user `esxi_host`}}",
"remote_username": "{{user `esxi_username`}}",
"remote_password": "{{user `esxi_password`}}",
"remote_datastore": "{{user `esxi_datastore`}}",
"keep_registered": "true",
"skip_export": "true",
"output_directory": "{{user `vcenter_template_name`}}",
"vm_name": "{{user `vcenter_template_name`}}",
"vmdk_name": "{{user `vcenter_template_name`}}",
"iso_url": "http://mirror.cisp.com/CentOS/7.4.1708/isos/x86_64/CentOS-7-x86_64-Minimal-1708.iso",
"iso_checksum_type": "sha1",
"iso_checksum": "aae20c8052a55cf179af88d9dd35f1a889cd5773",
"guest_os_type": "centos-64",
"communicator": "ssh",
"ssh_username": "root",
"ssh_password": "aPassword",
"disk_size": 16384,
"floppy_files": [
"packer-ks.cfg"
],
"boot_command": [ "<up><tab> inst.text inst.ks=hd:fd0:/packer-ks.cfg <enter><wait>" ],
"boot_wait": "20s",
"vmx_data": {
"memsize": "2048",
"ethernet0.networkName": "VM Network"
},
"shutdown_command": "shutdown --poweroff now",
"vnc_disable_password": "true"
}
],
"provisioners": [
],
"post-processors": [
{
"type": "vsphere-template",
"host": "{{user `vcenter_host`}}",
"insecure": "true",
"username": "{{user `vcenter_username`}}",
"password": "{{user `vcenter_password`}}"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment