I was introduced to HashiCorp Packer several years back by Timo Tsugliani, who if you are not following on Twitter, you are missing a TON of really useful nuggets which this guys shares both VMware/IT related and cool stuff. I am constantly learning about new things things from Timo and this guys is just a wealth of knowledge if you get the chance to work with him. At the time, I had played with Packer for a bit but did not have an actual use case for it, so I mostly forgot about it.
Fast forward a few years later and with recent projects like the vCenter Event Broker Appliance (VEBA) Fling, I have really spent time learning about Packer in greater depth and I now realize how powerful Packer is for building various artifacts including VMware-based templates that is not only easy but consistently from source control. It took me awhile to get to the aha moment but now I use Packer for so many different things to help simplify my life.
With the recent open sourcing of our VEBA Fling which includes the use of PhotonOS and Packer, I was reminded of a blog series that I did earlier on how to build your own Linux and/or Windows Virtual Appliance using OVF properties (Part 1, Part 2 and Part 3). I realized it would have been useful to have an actual reference implementation on building a very simple PhotonOS Virtual Appliance that exercises some basic OVF properties so folks could quickly get started beyond the manual steps that were documented. I was also motivated by a chat I had with Luc Dekens (Godfather of PowerCLI) last week on some of the Automation he was trying to with PhotonOS and I figured this might be something he and others could also benefit from.
With that, I have published https://github.com/lamw/photonos-appliance which includes a reference implementation of build a VMware PhotonOS OVA which supports the following OVF properties as shown in the screenshot below. Full details can be found in the Github repo and hopefully this is useful for anyone looking to build their own Virtual Appliance which can be Linux and/or Windows-based as Packer supports both OS types.
Jesse says
Thank you very much. The article and the git project are very helpful to me.
I think there may be some small problems in the setup.sh file:
Line 36: HOSTNAME_PROPERTY must not be empty, and the value of HOSTNAME_PROPERTY may be empty (the user did not fill in guestinfo.hostname). This will cause the shell script to execute the Static IP Address part, regardless of whether the user fills in guestinfo.hostname
The above are some of my humble opinions, please correct me if there is any wrong idea
Eduardo Vargas says
Hello, wich is the root password of the OVA?
William Lam says
There is no "default" password, you must define it as part of the deployment configuration