OS templataes: technical details (VMmanager OVZ)

From ISPWiki
Jump to: navigation, search

XML format

OS templates for VMmanager OVZ are based on mechanisms used in VMmanager.

In VMmanager OVZ the xml-file has the following differences:

  • element <ignore-content> - forbids unpacking the template archive for VMmanager OVZ:
<ignore-content>yes</ignore-content>
  • element <externals> - contains a list of files for upload:
 <externals>
     <elem>
         <url>http://example.com/templates/centos-6-i386-minimal.tar.gz</url>
     </elem>
 </externals>


Template unique identifier is the name of the archive from the url element. When creating a template, make sure that the url element is specified in template description, and a unique archive name is used.

Example of the xml-description for VMmanager OVZ template:

 <?xml version="1.0"?>
 <doc>
        <osname>Centos-6-i386-minimal</osname>
        <support>
                <elem>VEmgr</elem>
        </support>
        <ignore-content>yes</ignore-content>
        <externals>
                <elem>
                        <url>http://example.com/templates/centos-6-i386-minimal.tar.gz</url>
                </elem>
        </externals>
 </doc>

Local template

If you need a local template, in /nfsshare create a directory named, for example, Test-i386 Locate the image Test-i386.tar.gz and metainfo.xml into that directory

 <?xml version="1.0"?>
 <doc>
        <osname>Test-i386</osname>
        <support>
                <elem>VEmgr</elem>
        </support>
        <ignore-content>yes</ignore-content>
        <externals>
                <elem>
                        <url>Test-i386.tar.gz</url>
                </elem>
        </externals>
 </doc>

Create the symlin

cd /vz/template/cache
ln -s /nfsshare/Test-i386/Test-i386.tar.gz .

The metainfo.xml file must contain <install_result>ok</install_result>. Depending on this record, the control panel will define whether the template is installed or not.