From vSphere 5.5 - Deploying Centos 7 from template ignores customizations

Solution: I changed /etc/redhat-release to a vSphere recognized value of "Red Hat Enterprise Linux Server release 7.0 (Maipo)", and I can now deploy a VM from my CentOS7 template with customizations applied just fine. Be sure to rm the existing /etc/redhat-release symlink first. See mjevange's answer for the elegant one liner solution.

Background: After creating and deploying a new Oracle Linux 7 (OEL7) template using the same method as above for CentOS 7 and having it WORK, I quickly realized what the issue was. Check it out:

Default /etc/redhat-release file in Centos7:

 cat /etc/redhat-release
 CentOS Linux release 7.0.1406 (Core)  

Default /etc/redhat-release file in RHEL7/OEL7:

 cat /etc/redhat-release
 Red Hat Enterprise Linux Server release 7.0 (Maipo)

(Please note that the version files for CentOS and Oracle Linux are centos-release and oracle-release respectively. Do NOT touch those as they are the distro specific version files.)


UPDATE: Just tested, this still works in Centos 7.1 using RHEL 6 as the guest OS option and the command below.

FYI redhat-release is symlinked to centos-release. If you edit redhat-release, you are actually modifying centos-release.

To follow the solution's recommendation in not modifying distro specific version files, do this instead:

rm -f /etc/redhat-release && touch /etc/redhat-release && echo "Red Hat Enterprise Linux Server release 7.0 (Maipo)" > /etc/redhat-release