WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple

Packer reference for building PhotonOS Virtual Appliance using OVF properties 

11.25.2019 by William Lam // 3 Comments

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.

[Read more...]

Categories // Automation, OVFTool Tags // guestinfo, linux, ova, ovf, Packer, Photon, vapp, virtual appliance

Building your own Virtual Appliances using OVF properties Part 3

03.19.2019 by William Lam // 3 Comments

To conclude this three-part blog series, we are now going take a look at reference implementation for building your own Microsoft Windows Virtual Appliance (VA). Similar to the Linux VA build, the Windows OVA will also support the ability to customize basic networking configuration including the use of a static or DHCP option.

In addition, to demonstrate the endless possibilities for building your own VA, I have also included an option to automatically join a Microsoft Active Directory Domain as part of the OVA deployment, which is a fairly common operation after deploying a Windows-based system. In the example below, I am using Windows Server 2016 and PowerShell to perform all the required automation.

Step 1 - Create a new VM in vCenter Server and then install Window Server 2016 using the ISO. Once you have completed the OS installation, you may want to apply any patches or packages that you want included as part of your VA. Once that is done, go ahead and shut down the VM.

Step 2 - Select the VM in the vSphere Inventory and then click on Configure->vApp and then check the Enable vApp Options. Once enabled, select OVF environment for the IP allocation scheme. In the OVF Details tab, select VMware Tools for the OVF environment transport. (Optionally) You can specify some additional metadata including appliance name and URLs to help others who maybe consuming your VA once it has been exported to an OVF/OVA.

Step 3 - Next, add the following 9 OVF properties which will be used as input to configure networking within PhotonOS. Click Add and provide a Label, Key and optional Category.

Label Key Category
Hostname guestinfo.hostname Networking
IP Address guestinfo.ipaddress Networking
Netmask guestinfo.netmask Networking
Gateway guestinfo.gateway Networking
DNS Server guestinfo.dns Networking
DNS Domain guestinfo.domain Networking
AD Domain guestinfo.ad_domain Active Directory
AD Username guestinfo.ad_username Active Directory
AD Password guestinfo.ad_password Active Directory


Step 3 - Power back on the VM and once it is available on the network (assuming DHCP), download and copy the sample first boot script customize-windows-server-guest.ps1 to C:\Users\Administrator\Desktop. This script is where all the magic happens and will process the OVF property input and then configure the network settings and if specified, it will also perform the Active Directory domain join. Right now it assumes the networking fields are optional, meaning if they are left blank, it will default the system to DHCP. If you provide all input properties, then it will go ahead and configure a static network address.

[Read more...]

Categories // Automation, OVFTool, vSphere Tags // active directory, guestinfo, ova, ovf, vapp, virtual appliance, windows

Building your own Virtual Appliances using OVF properties Part 2

02.19.2019 by William Lam // 9 Comments

In the previous article, we reviewed the concepts and basic approach to building your own VMware Virtual Appliance (OVF/OVA). In Part 2, we are now going to take a look at a reference implementation for building a Linux VA using VMware PhotonOS. Although I am using PhotonOS as the guest, you can apply these same techniques to any other Linux distribution of your choice.

Step 1 - Create a new VM in vCenter Server and then install PhotonOS using the ISO format. Once you have completed the OS installation, you may want to apply any patches or packages that you want included as part of your VA. Once that is done, go ahead and shut down the VM.

Step 2 - Select the VM in the vSphere Inventory and then click on Configure->vApp and then check the Enable vApp Options. Once enabled, select OVF environment for the IP allocation scheme. In the OVF Details tab, select VMware Tools for the OVF environment transport. (Optionally) You can specify some additional metadata including appliance name and URLs to help others who maybe consuming your VA once it has been exported to an OVF/OVA.

Step 3 - Next, add the following 6 OVF properties which will be used as input to configure networking within PhotonOS. Click Add and provide a Label, Key and optional Category.

Label Key Category
Hostname guestinfo.hostname Networking
IP Address guestinfo.ipaddress Networking
Netmask guestinfo.netmask Networking
Gateway guestinfo.gateway Networking
DNS Server guestinfo.dns Networking
DNS Domain guestinfo.domain Networking


Step 4 - Power back on the VM and once it is available on the network (assuming DHCP), download and copy the sample first boot script rc.local to /etc/rc.d/rc.local. This script is where all the magic happens and will process the OVF property input and then configure the network settings. Right now it assumes these fields are optional, meaning if they left blank, it will default the system to DHCP. If you provide all input properties, then it will go ahead and configure a static network address.

[Read more...]

Categories // Automation, OVFTool, vSphere Tags // guestinfo, linux, ova, ovf, Photon, vapp, virtual appliance

  • « Previous Page
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • …
  • 20
  • Next Page »

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...