WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Automation / Quick Tip - Prepare VMware Photon OS for use with vSphere Guest OS Customization and cloud-init

Quick Tip - Prepare VMware Photon OS for use with vSphere Guest OS Customization and cloud-init

06.29.2022 by William Lam // 1 Comment

After publishing my latest article on using the new vSphere 7.0 Update 3 feature vSphere Guest OS Customization  (GOSC) with cloud-init, I came to learn that my blog post was also shared with our Guest OS Customization Engineering team. They reached out sharing their excitement about the blog post and shared one additional nugget when working with VMware Photon OS.

It turns out that VMware Photon OS can also leverage the new vSphere GOSC with cloud-init feature, but a couple of settings must be updated for this to work.


Below are the instructions in preparing VMware Photon OS so that it can leverage the new vSphere GOSC with cloud-init feature.

Step 1 - Install the desired version of VMware Photon OS using the ISO method. In the example below, I am using the latest Photon OS 4.0 release with all default options selected.

Step 2 - Update the following to entry to the bottom of /etc/cloud/cloud.cfg configuration file with the value of false:

disable_vmware_customization: false

Step 3 - Update the following to entry to the bottom of /etc/cloud/cloud.cfg configuration file with the value of true:

allow_raw_data: true

Step 4 - Run the cloud-init clean operation:

/usr/bin/cloud-init clean --logs

Step 5 - Shutdown the Guest OS

To help simplify the GuestOS preparation steps, I have created the a quick shell script that you can use that will automatically apply all the required changes listed above and then shutdown the GuestOS.

#!/bin/bash

sed -i 's/disable_vmware_customization.*/disable_vmware_customization: false/g' /etc/cloud/cloud.cfg
sed -i 's/allow_raw_data.*/allow_raw_data: true/g' /etc/cloud/cloud.cfg
/usr/bin/cloud-init clean --logs
shutdown -h now

At this point, you can either apply the vSphere GuestOS Customization directly onto this VM or simply turn this VM into a vSphere Template or Content Library Image to become the base image for deploying new VMs that can then be customized using cloud-init. Please refer to the "Apply GuestOS Customization" section of this blog post for more details. 

More from my site

  • Using the new vSphere Guest OS Customization with cloud-init in vSphere 7.0 Update 3
  • Demo of VMware Cloud Consumption Interface (CCI)
  • Beta for VMware Cloud Consumption Interface (CCI) formally Project Cascade
  • Infinite possibilities with new VM Service CloudInit transport for vSphere with Tanzu in vSphere 8
  • Exploring the Cloud-init Datasource for VMware GuestInfo using vSphere

Categories // Automation, vSphere 7.0 Tags // cloud-init, Photon OS, vSphere 7.0 Update 3

Comments

  1. *protectedRicardo Marinho says

    08/20/2024 at 8:13 am

    Great Catch! You save me!

    Reply

Thanks for the comment!Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

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

  • VMUG Connect 2025 - Minimal VMware Cloud Foundation (VCF) 5.x in a Box  05/15/2025
  • 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

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...