I am writing a python program using the pysphere library, to clone a template in vCenter 5.1. The VM will be running Linux as the guest OS, and I need to have the DHCP_HOSTNAME variable set in the /etc/sysconfig/network-scripts/ifcfg-eth0 file at boot time. The template is set up for DHCP and has a suitable ifcfg-eth0 file already, and I just want to customize the hostname and DNS servers. When the cloned VM boots, the VMware tools are rewriting the ifcfg-eth0 file, and the resulting file does not contain DHCP_HOSTNAME anymore. Is there some customization setting that will retain it?
I am using CustomizationLinuxPrep to customize the cloned VM. I have attached CustomizationGlobalIPSettings with dnsServerList and dnsSuffixList. I also have a CustomizationLinuxPrep with the hostName and domain. Finally, I have CustomizationDhcpIpGenerator specified for each nic in the clone.
Should I add or remove something, in order to have DHCP_HOSTNAME in the ifcfg-eth0 file?
Also, the /var/log/vmware-imc/toolsDeployPkg.log file contains this output regarding the ifcfg-eth0 file:
DEBUG: opening file for writing (/etc/sysconfig/network-scripts/ifcfg-eth0).
DEBUG: Command: chmod 644 /etc/sysconfig/network-scripts/ifcfg-eth0
Is there a way to get more details in the log, like what it is writing and why?