Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Issues, Fixes and Feature Requests #10

Open
vikas027 opened this issue Mar 5, 2016 · 5 comments
Open

Issues, Fixes and Feature Requests #10

vikas027 opened this issue Mar 5, 2016 · 5 comments

Comments

@vikas027
Copy link

vikas027 commented Mar 5, 2016

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

  1. There is no virtual CD Drive in the resultant VMs (template and VM)
  2. 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 -vm at the end)
  • Overwrite Existing VMs/Templates
  • No dependency on VMware Tools
  • Thin disk in templates instead of Thick
  • Delete Artifacts: "keep_input_artifact": false has no effect as of now
  • Some working packer JSON example(s)
@daxgames
Copy link

daxgames commented Mar 5, 2016

You could try this. https://github.com/daxgames/packer-post-processor-vsphere-ova/tree/ovftool_import

I have a pull request open here but @rubbish has had issues getting it working. I would love for someone else to try it because I cannot test it at this point I do not currently have access to vSphere.

@vikas027
Copy link
Author

vikas027 commented Mar 5, 2016

@daxgames I am testing out Ansible with ESXi 5.5 now, will try that soon and share my result. Thanks !

@daxgames
Copy link

daxgames commented Mar 5, 2016

Thanks. I hope it works for you.

@vikas027
Copy link
Author

@daxgames I tested out your code, it works great. Thank you for making this post-processor better.

@daxgames
Copy link

@vikas027 Glad to hear it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants