WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • Apple

Exploring the Cloud-init Datasource for VMware GuestInfo using vSphere

07.20.2022 by William Lam // 1 Comment

While exploring some upcoming capabilities and providing early feedback to Engineering, I came to learn about a new Cloud-init datasource called VMware GuestInfo that was recently merged into the project last August. The Cloud-init Datasource for VMware GuestInfo started out as an OSS project created by Andrew Kutz of VMware and it provides an easy way for a vSphere-based VM to leverage the popular Cloud-init tool for OS initialization and configuration. 

Unlike the recent vSphere Guest OS Customization with Cloud-init feature in vSphere 7.0 Update 3, the Cloud-init Datasource for VMware GuestInfo works by configuring specific guestinfo variables on a VM which are then transported into the guest operating system (GOS) using VMware Tools and is then processed by the cloud-init service that is running inside of the GOS. The nice thing about using this new Cloud-init datasource is that it is not tied to a specific release of vSphere and for those with Cloud-init experience, this is an easy way to incorporate your existing workflows. While I was somewhat familiar with Cloud-init and Linux GOS, I did not know that support for Microsoft Windows was also possible through the use of another project similiar to Cloud-Init called Cloudbase-Init.

It took me some time to figure out how to setup Cloudbase-init with Windows and I have to give a huge shoutout to Jay Vyas for pointing me over to one of his pet projects SIG Windows Development Environment that provided a clue to what the configuration file should look like. While learning about both Cloud-init Datasource for VMware GuestInfo and Cloudbase-init, I found that it was not trivial to get started and I wanted to document some concrete examples that can easily illustrate the power of this capability but also help anyone that might be interested in using this feature and how to quickly get started.

[Read more...]

Categories // Automation, vSphere Tags // cloud-init, cloudbase-init, guestinfo

Packer reference for building PhotonOS Virtual Appliance using OVF properties 

11.25.2019 by William Lam // 1 Comment

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

  • 1
  • 2
  • 3
  • 4
  • Next Page »

Search

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • How to disable the Efficiency Cores (E-cores) on an Intel NUC? 03/24/2023
  • Changing the default HTTP(s) Reverse Proxy Ports on ESXi 8.0 03/22/2023
  • NFS Multi-Connections in vSphere 8.0 Update 1 03/20/2023
  • Quick Tip - How to download ESXi ISO image for all releases including patch updates? 03/15/2023
  • SSD with multiple NVMe namespaces for VMware Homelab 03/14/2023

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 © 2023

 

Loading Comments...