VMware Cloud Community
sengork
Contributor
Contributor

Linux guest customisation script deployment bug

I believe the following should be treated as a vCloud Director bug. In a nutshell the vCloud GUI does not allow customization script length to exceed 8,192 bytes. However observe the following for a guest customisation script that is 1,093 bytes large:

- Guest customisation fails on initial boot:
root@myvcloud1vm:~/sol-guest-cdrom# head /var/log/vmware-imc/customization.log
May 18 13:49:38 customize-guest: Starting guest customization
May 18 13:49:38 customize-guest: base64 decoding failed, pre and post customization will not take place
May 18 13:49:38 customize-guest: no pre-customization script to run

May 18 13:49:39 customize-guest: Configuring computerName = myvcloud1vm


- Reverse engineering what vCloud v1.5.0 appliance's /opt/vmware/vcloud-director/guestcustomization/unix/customize-guest.sh does during deployment phase:
root@myvcloud1vm:~/sol-guest-cdrom# vmtoolsd --cmd "info-get guestinfo.ovfEnv" > ovf.xml
root@myvcloud1vm:~/sol-guest-cdrom# SCRIPT=`/usr/bin/awk -f getXML.awk ovf.xml vCloud_CustomizationInfo`
root@myvcloud1vm:~/sol-guest-cdrom# /usr/bin/awk -f ./base64decode.awk encoded_script="$SCRIPT" script_name=/tmp/script.sh /dev/null
awk: program limit exceeded: sprintf buffer size=1020
FILENAME="/dev/null" FNR=0 NR=0

root@myvcloud1vm:~/sol-guest-cdrom# echo $?
2
root@myvcloud1vm:~/sol-guest-cdrom# cat /tmp/script.sh
root@myvcloud1vm:~/sol-guest-cdrom#

- Yet I can I can confirm that my script is properly stored within the VM OVF environment config:
root@myvcloud1vm:~/sol-guest-cdrom# echo $SCRIPT | base64 -d
#!/bin/bash
export PATH=$PATH:/sbin:/bin:/usr/sbin:/usr/bin:/sbin
..............  >>> OUTPUT TRIMMED <<<< ......
root@myvcloud1vm:~/sol-guest-cdrom#


- This guest is supported on ESXi 5.0 according to the official Guest OS Compatibility Guide:
root@myvcloud1vm:~/sol-guest-cdrom# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.10
DISTRIB_CODENAME=maverick
DISTRIB_DESCRIPTION="Ubuntu 10.10"
root@myvcloud1vm:~/sol-guest-cdrom#

- Guest customisation succeeds when the script is shorter.

0 Kudos
5 Replies
lamw
Community Manager
Community Manager

Hi sengork,

How many characters is your customization script? It is noted in the documentation as well as the following KB article that a max of 1500 characters is allowed - http://kb.vmware.com/kb/1026614

I'm not sure if this max has been increased in VCD 1.5. If the script is <= 1500, I would recommend that you file an SR with VMware Support and they should be able to assist to see if this is a bug.

Thanks

0 Kudos
sengork
Contributor
Contributor

Roughly ~1000 characters, it was certainly below 1500. How can I raise a SR with VMware if I'm not a corporate customer?

0 Kudos
lamw
Community Manager
Community Manager

You don't need to be a corporate customer to file an SR, you just need to have SnS (Support & Subscription) with VMware.

Would you care to share the guest customization script?

0 Kudos
sengork
Contributor
Contributor

Resurrecting this thread as the issue is present in vCloud 5.1 as well.

$ cat /var/log/vmware-imc/customization.log
Nov 13 23:30:16 customize-guest: Starting guest customization
Nov 13 23:30:16 customize-guest: base64 decoding failed, pre and post customization will not take place
Nov 13 23:30:16 customize-guest: no pre-customization script to run

.......

$ cat  /var/log/vmware-imc/toolsDeployPkg.log

.......

Customization command failed: awk: program limit exceeded: sprintf buffer size=1020

......

Please see attachment for the script. I've sanitised the data but character count and format remains exactly the same:

$ wc -m  customization.script.txt

1031 customization.script.txt

0 Kudos
IamTHEvilONE
Immortal
Immortal

Can you check this value in the vCloud Database?

select value from config where name =N'maxCustomizationScriptSize';

I think you need to increase this, and it needs to be a base 2 value.  I don't recall if you have to restart cell services to take advantage of the new ScriptSize setting.  The default is 8192 ... maybe double it to 16384.  This setting is used to pass the script into the guest.

Another double check, if you just use a single line as a script:

echo $0 $1 >> /tmp/test.txt

Does this work as an alternative script in the current environment and configuration?  If so, I would like to see the output.

0 Kudos