{"id":43,"date":"2015-11-06T12:40:55","date_gmt":"2015-11-06T11:40:55","guid":{"rendered":"https:\/\/www.softwolves.com\/wolfblog\/?p=43"},"modified":"2015-11-06T12:45:36","modified_gmt":"2015-11-06T11:45:36","slug":"making-ovf-images-using-packer","status":"publish","type":"post","link":"https:\/\/www.softwolves.com\/wolfblog\/2015\/11\/06\/making-ovf-images-using-packer\/","title":{"rendered":"Making OVF images using Packer"},"content":{"rendered":"<p>At my $DAYJOB,\u00a0the need recently arose for not only making our software available as an installer that the end-user can install on their machines, but also for providing pre-built OVF (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Open_Virtualization_Format\">Open Virtualization Format<\/a>) images, mainly targeted towards costumers running\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/VMware_vSphere\">VMware vSphere<\/a>\u00a0and wanting to not have software running on\u00a0bare metal.\u00a0They can of course run the regular installer, but providing a pre-installed image\u00a0cuts deployment time considerably and\u00a0eliminates many of the mistakes that can be done while performing the installation.<\/p>\n<p>Hunting around for solutions on how to actually generate these images,\u00a0using some kind of automated procedure as we will regenerate the images several times and in slightly different configurations, I eventually landed on\u00a0<a href=\"https:\/\/packer.io\">Packer<\/a>. Packer lets me\u00a0<a href=\"https:\/\/packer.io\/docs\/builders\/vmware.html\">drive VMWare Workstation<\/a>\u00a0by submitting a configuration file listing an ISO image to install from and giving the commands necessary to run the installation automatically.<\/p>\n<p>One of the issues with doing this is that most installations will add some unique identifiers in the image, and we do not want that. For instance, SSH host keys are generated, as are MAC addresses for the network cards, and also some other stuff is dropped. Fortunately, I was not the first one to have faced this problem, so it was fairly easy to <a href=\"https:\/\/github.com\/frapposelli\/packer-templates\/blob\/master\/scripts\/centos-vmware-vcloud_cleanup.sh\">find a solution<\/a> that would clean up the generated image. In addition to that, I had the post-install script install VMWare Tools\u00a0in the virtual image, and then go on to remove various UUIDs and MAC addresses from the generated\u00a0VMWare configuration file.<\/p>\n<p>The result of running Packer is, however, still a VMWare image. It does have a\u00a0<a href=\"https:\/\/packer.io\/docs\/builders\/virtualbox-ovf.html\">driver for OVF<\/a>, but that one\u00a0is using <a href=\"https:\/\/www.virtualbox.org\">Oracle VirtualBox<\/a> instead. OVF is supposed to be platform-independent but\u00a0there are enough differences between how the images are built to create trouble if we use the wrong build platform. Instead we landed on using <a href=\"http:\/\/www.vmware.com\/resources\/techresources\/1013\">VMWare OVF Tool<\/a> on the generated\u00a0VMWare image, converting it into an OVF archive (.ova). This is the part that takes the longest time in our build process, which starts out with generating the ISO to\u00a0install from on-the-fly. But in the end, we have an OVA file that can be imported into VMWare (vSphere, Workstation or Player all work fine) and be up and running in under two minutes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At my $DAYJOB,\u00a0the need recently arose for not only making our software available as an installer that the end-user can install on their machines, but also for providing pre-built OVF (Open Virtualization Format) images, mainly targeted towards costumers running\u00a0VMware vSphere\u00a0and wanting to not have software running on\u00a0bare metal.\u00a0They can of course run the regular installer, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[25,26,27,24],"class_list":["post-43","post","type-post","status-publish","format-standard","hentry","category-software","tag-ovf","tag-packer-io","tag-virtualization","tag-vmware"],"_links":{"self":[{"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/posts\/43","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/comments?post=43"}],"version-history":[{"count":1,"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/posts\/43\/revisions"}],"predecessor-version":[{"id":44,"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/posts\/43\/revisions\/44"}],"wp:attachment":[{"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/media?parent=43"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/categories?post=43"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.softwolves.com\/wolfblog\/wp-json\/wp\/v2\/tags?post=43"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}