Inline comment breaks "disable_vmware_customization" check
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
- Add the following line to /etc/cloud/cloud.cfg:
disable_vmware_customization: false # UseCloudInitWorkflow - Customize the VM, start it, and see an error during customization.
- 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
Thanks for reporting this issue.
I have filed an internal bug with the Guest Customization team to address the issue.
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 that should work, thanks!