-
Notifications
You must be signed in to change notification settings - Fork 13
Issues, Fixes and Feature Requests #10
Description
I have got this to make it work finally with some issues (may be bugs).
ENVIRONMENT
- Host OS: OSX 10.11.2
- Builder: VirtualBox
- Guest OS: CentOS 6.7 and 7.2 x86_64
- packer 0.9.0
- go 1.5.3
- ovftool 4.1.0
- ESXi 5.5
ISSUES and FIXES
- packer build failed with below error
virtualbox-vsphere (vsphere-ova): Powering on packer-centos_6.7-x86_64-vm
virtualbox-vsphere (vsphere-ova): Powered on packer-centos_6.7-x86_64-vm
Build 'virtualbox-vsphere' errored: 1 error(s) occurred:
* Post-processor failed: Failed: Timed out while waiting for VM Tools to be recogonized
==> Some builds didn't complete successfully and had errors:
--> virtualbox-vsphere: 1 error(s) occurred:
* Post-processor failed: Failed: Timed out while waiting for VM Tools to be recogonized
==> Builds finished but no artifacts were created.I guess there are two main reasons for the failure
- There is no virtual CD Drive in the resultant VMs (template and VM)
- OS identifier gets mapped to
Other (32-bit)which is neither Linux nor Windows
However, I fixed these issues using this script. Thanks to shell-local post-processor introduced in packer v0.9.0.
But still my build gave the same error as above. Somehow, post-processor keeps waiting for VM Tools to be recognized which are not installed in my Virtualbox VMs. And AFAIK, VMware Tools do not get installed in a VirtualBox VM. So, in order to make your post-processor work, I create below script while provisioning VM and called it through rc.local (which gets invoked when ESXi powers on the VM.
ps -aef | grep [v]mtoolsd
if [ $? -eq 1 ]
then
cd /root && tar xf VMwareTools.tar.gz && cd vmware-tools-distrib && ./vmware-install.pl -d && sed -i '/^bash -xv/d' /etc/rc.local && reboot
fi
Finally, I was able to make everything work. I can sleep happily now :)
FEATURE REQUESTS
It would be great (may be a toggle) for these options
- power-on the VM
- name the template (do not append
-vmat the end) - Overwrite Existing VMs/Templates
- No dependency on VMware Tools
- Thin disk in templates instead of Thick
- Delete Artifacts:
"keep_input_artifact": falsehas no effect as of now - Some working packer JSON example(s)