open-vm-tools icon indicating copy to clipboard operation
open-vm-tools copied to clipboard

Inline comment breaks "disable_vmware_customization" check

Open fluggelgleckheimlen opened this issue 7 months ago • 3 comments

Describe the bug

The regex check for "disable_vmware_customization" is too strict and fails when there are inline comments after the flag. As a result, the cloud-init workflow doesn't start: https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/libDeployPkg/linuxDeploymentUtilities.c#L205 You should relax the check from matching only whitespace (\s*$) to any characters (.*$), since YAML allows inline comments.

Reproduction steps

  1. Add the following line to /etc/cloud/cloud.cfg: disable_vmware_customization: false # UseCloudInitWorkflow
  2. Customize the VM, start it, and see an error during customization.
  3. Check the cloud-init status in the VM logs. It will return 4 instead of 0: grep UseCloudInitWorkflow /var/log/vmware-imc/toolsDeployPkg.log

Expected behavior

Customization succeedes with the cloud-init workflow.

Additional context

No response

fluggelgleckheimlen avatar May 07 '25 08:05 fluggelgleckheimlen

Thanks for reporting this issue.

I have filed an internal bug with the Guest Customization team to address the issue.

johnwvmw avatar May 07 '25 19:05 johnwvmw

Thanks @fluggelgleckheimlen for reporting this issue. According to YAML rule "The # must be preceded by at least one space to avoid being misinterpreted as part of a value (especially inside strings).", we will address this issue by changing \s*$ to \s*(?:\s+#.*)?$, sounds good?

Thanks @johnwvmw for filing the internal bug.

PengpengSun avatar May 08 '25 06:05 PengpengSun

@PengpengSun that should work, thanks!

fluggelgleckheimlen avatar May 09 '25 09:05 fluggelgleckheimlen