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
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 // Leave a 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

Thanks for the comment! Cancel reply

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

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

  • Changing the default HTTP(s) Reverse Proxy Ports on ESXi 8.0 03/22/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
  • Is my vSphere Cluster managed by vSphere Lifecycle Manager (vLCM) as a Desired Image or Baseline? 03/10/2023
  • Interesting VMware Homelab Kits for 2023 03/08/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...