Cloud Director Guest OS Customization Fails to Set Password or Script on RHEL/CentOS
search cancel

Cloud Director Guest OS Customization Fails to Set Password or Script on RHEL/CentOS

book

Article ID: 417753

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

When deploying a new VM from a RHEL or CentOS template in the VCD catalog, the Guest OS Customization features in the UI fail to apply.

  • Setting the "Administrator Password" in the UI has no effect. The root password is not changed.
  • Any script placed in the "Customization Script" text box does not run.
  • This failure occurs when selecting Power On and Force Recustomization during VM power-on.

Environment

  • VMware Cloud Director
  • RHEL 8.x, RHEL 9.x
  • CentOS 8.x, CentOS 9.x
  • VM Templates with both open-vm-tools and cloud-init packages installed

Cause

The root cause is a software conflict on the VM template. The customization data sent from the VCD UI is incompatible with the cloud-init package.

The open-vm-tools service, which handles customization, is designed to check for cloud-init.

  1. When open-vm-tools starts, it detects that cloud-init is installed.
  2. It then stops its own traditional customization engine (which the UI uses) and passes all control to cloud-init.
  3. The UI's password and script data is not passed to the guest OS in a manner which cloud-init can read, so it is ignored.

 

Resolution

For the VCD UI customization to work, the cloud-init package must be removed to prevent this conflict.  Modify your VM template to remove the conflicting cloud-init package. This forces open-vm-tools to use its traditional engine, which correctly reads the settings from the VCD UI.

  1. Log in to the RHEL/CentOS template VM.
  2. Ensure the required packages for UI customization (open-vm-tools and perl) are installed.

    sudo dnf install open-vm-tools perl -y

  3. Completely remove the cloud-init package and its configuration files to resolve the conflict.

    sudo dnf remove cloud-init -y
    sudo rm -rf /etc/cloud/
    sudo rm -rf /var/lib/cloud/

  4. Shut down the VM.
  5. Save this modified VM as your new catalog template.

After deploying new VMs from this corrected template, the "Administrator Password" and "Customization Script" fields in the VCD UI during a Power On and Force Recustomization will function as expected.

Additional Information

Documentation for helping to understand the conflict and options are below: