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
  • Exploring the Cloud-init Datasource for VMware GuestInfo using vSphere
  • Heads Up - No healthy upstream error with VEBA vSphere UI plugin with vSphere 7.0 Update 3
  • Integrated NSX-T deployment in vSphere 7.0 Update 3 fails with timeout
  • New vCenter Events for vSphere 7.0 Update 3
Share this...
  • Twitter
  • Facebook
  • Linkedin
  • Reddit
  • Pinterest

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)

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

Connect

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

Support

Recent

  • vSphere ESXi 7.x will be last version to officially support Apple macOS Virtualization 08/03/2022
  • First look at the new Supermicro E302-12D (Ice Lake D) 07/27/2022
  • Quick Tip - How to actually disable host encryption mode on ESXi? 07/25/2022
  • Exploring the Cloud-init Datasource for VMware GuestInfo using vSphere 07/20/2022
  • Quick Tip - ESXi 7.0 Update 3f now includes all Intel I219 devices from Community Networking Driver Fling 07/18/2022

Advertisment

Copyright WilliamLam.com © 2022

 

Loading Comments...