An operating system template is a set of disk images and installation scripts consisting of the distribution and other data required for OS installation. Templates facilitate the installation of operating systems on virtual machines.

OS templates are downloaded and updated on the cluster master-node. By default, the OS templates are kept in the /nfsshare directory, which is set by the path ostemplatedir parameter in the control panel configuration file.

OS template synchronization methods


  • nfs: the /nfsshare directory of the main node is mounted on each cluster node. You need to install and configure the NFS-server on the machine with VMmanager.
  • rsync: when installing an OS template or adding a cluster node, VMmanager will synchronize the directories using rsync. This is the only synchronization method available in VMmanager Cloud
  • manual: no synchronization, the template is installed on the master node, synchronization of directories must be performed by the user

You can set the synchronization method in the configuration file with the following parameter: 

OsTplDistributionMethod { nfs | rsync | manual }
BASH

Changing nfs into rsync will unmount all the directories with OS templates and start the synchronization on all the cluster nodes using rsync.

Changing into manual will not perform any action, the administrator should unmount them himself. Then restart VMmanager to apply the changes:

/usr/local/mgr5/sbin/mgrctl -m vemgr exit
BASH

nfs

When adding a new repository, the control panel downloads the oslist file which contains a list of templates in the repository. The control panel downloads  XML-files with the template names from the list into the /usr/local/mgr5/var/oscache/<repository name>/<OS template name> directory. You can see the OS templates from the repository in Cluster settings → OS templates.

When you install an OS template from the control panel, the data archives are downloaded and added into /nfsshare/<repository name>/<OS template name>.

The master node exports the /nfsshare directory using NFS:

1. It defines the resource IP address. By default, this is the primary IP of the control panel assigned to the license. To change the server that exports the NFS, add/edit the parameter in the control panel configuration file: 

MainIp <IP-address>
BASH
<IP-address>Server IP for NFS export.

2. When adding a cluster node VMmanager modifies the  /etc/exports file.

3. Creates the /nfsshare directory on the cluster node that has been added and mounts the NFS-resource:

mount <ip-address>:/nfsshare /nfsshare
BASH

4. Edits the file /etc/fstab and adds:

<ip-address>:/nfsshare /nfsshare nfs rsize=8192,wsize=8192,timeo=14,intr 0 0
BASH

rsync

Templates synchronization runs during the installation or update of templates in VMmanager. The templates that you added to the server manually (custom local templates) won't be synchronized automatically.  

Execute  the synchronization command for such OS templates: 

/usr/local/mgr5/sbin/mgrctl -m vemgr vmhostnode.checktpl
BASH