Keeping OS templates in VMmanager

From ISPWiki
Jump to: navigation, search
Hierarchy: VMmanager KVM -> OS templates section
VMmanager Cloud -> OS templates section

Keeping OS templates

The following article descibes how OS templates are kept in VMmanager.

Master node

The main cluster node (the one where the control panel is currently running) performs various operations with OS templates: updates them, shares to other cluster nodes, etc.

After adding an OS repository, VMmanager downloads the oslist file using the link from the repository edit form. This file contains a list of templates in the repository. VMmanager downloads xml-files with names from the list into the /usr/local/mgr5/var/oscache/ directory REPOSITORY_NAME/TEMPLATE_NAME Once completed, the templates will be displayed in the "OS templates" module of the control panel.

If a user installs an OS template, the panel will download the required archives and place them into the /nfsshare/REPOSITORY_NAME/TEMPLATE_NAME directory.

Use the following parameter to specify the /nfsshare directory

path ostemplatedir /nfsshare

in the /usr/local/mgr5/etc/vmmgr.conf configuration file

NFS

The master node exports the nfsshare directory using NFS. The following steps are completed:

  1. The system defines an IP address. Primary IP address of the control panel bound to the license, is used by default. To change the IP address, from which the NFS will be imported, add/edit the following parameter in the VMmanager configuration file


MainIp <ip-address> 
  1. When adding a cluster node, VMmanager edits the /etc/exports file.

Secondary nodes

On the newly created cluster node, the /nfsshare directory is created, to which the nfs-resource is mounted:

mount <ip-address>:/nfsshare /nfsshare 

The following information is added into the /etc/fstab file

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

VMmanager-cloud: OS templates replication

When configuring VMmanager-cloud replication, a user should provide the IP address of a reserve server and the directory for OS templates

In the VMmanager configuration file

OsTemplBkpIp 10.1.254.1
OsTemplBkpDir /bkp/nfsshare

10.1.254.1 - is the ip address of a reserve server, where OS templates will be kept

Make sure NFS is configured on that server. If the reserve server is running Linux, the /etc/exports file will look like something like this"

/bkp/nfsshare/ 10.1.1.1(rw,no_root_squash,no_subtree_check) 10.1.1.3rw,no_root_squash,no_subtree_check) 10.1.1.3(rw,no_root_squash,no_subtree_check)

10.1.1.1, 10.1.1.2, 10.1.1.3 - IP addresses of cluster nodes

The following utility starts every six hours to copy OS templates into the reserve server

/usr/local/mgr5/sbin/nodereplication -c ostemplates

If the master node fails, rgmanager selects another node to start the recovery process.

While recovering a cluster node, VMmanager will check if the cluster node being restored, is the master node (if the IP address is specified in the MainIp parameter of the configuration file)

  • The cluster node being recovered is master: on all cluster nodes /nfsshare is mounted on the master node, and /etc/fstab is edited
  • The cluster node being recovered is not master: on all cluster nodes /nfsshare is mounted on the reserve server