Symptoms
The following error appears on creating cache for a RHEL-base OS template:
Update OS template cache for redhat-el5-x86 template
Error: URL $RH_SERVER/download/mirrors/redhat-el5 contents undefined variable
You can define this variable in /etc/vztt/url.map.
OR
Error invoking external utility: vzctl create failed: Cached package set 'redhat-el6-x86_64' is not found, run create cache utility...
Creating OS template cache for redhat-el6-x86 template
Error: URL $RH_SERVER/download/mirrors/redhat-el6 contents undefined variable
You can define this variable in /etc/vztt/url.map.
See Parallels Cloud Server Templates Management Guide for more details.
Cause
Commercial Linux distributions (e.g. Red Hat Enterprise Linux or SUSE Linux Enterprise Server) do not have official publicly available repositories. So, they are disabled by default in the repositories URL map:
[root@vz ~]# egrep 'RH_SERVER|SLES' /etc/vztt/url.map
#$RH_SERVER http://
#$SLES_SERVER http://
Resolution
Acquire the commercial license to the required Linux distribution and define the repositories in the URL map.
In addition to configuring the repository of the OS itself, it is needed to create a small extra repo with special Virtuozzo RPMs. You can download them from this location: http://vzdownload.swsoft.com/ez/packages
Follow the exact OS path that is required. E.g. for redhat-el5-x86_64 template, the following location will be needed: http://vzdownload.swsoft.com/ez/packages/redhat/el5/x86_64/os
After that, please add this new repository to /vz/template/redhat/5e/x86_64/config/os/default/repositories and try creating the cache again.
Additional information
For RHEL, there's a possibility to setup a proxy server with vzrhnproxy
utility, see the instructions in this article:
Setting Up an RHN Proxy Server for RHEL OS EZ Templates