KVM – Setting Up The Cluster with Proxmox

November 2, 2015 / General Discussion

* Summary
* Installation Process
* Storage space provision
* Backup and Restore
* Hot Failover
* Configuration of Network


Proxmox VE (virtual environment) is an operating system dedicated to the operation of virtual machines based on KVM. It includes a Debian 7 environment, and integrates the service Apache to access the web configuration interface. As oVirt, it approaches VMware vCenter. They are both more and less competitors.

Proxmox VE is available free under a free license. In addition, it offers paid support as well (via forum, support, and application developers) and a paid email security solution.

Features of Proxmox
  • Snapshots of VMs (+RAM, Disk)
  • Virtual machines migration without interruption
  • Clustering option for high availability
  • Virtual machines backup and restoration
It also allows to:
  • Support authentication with PAN, Active Directory
  • Roles and groups administration
  • VLANs management for VM

So let’s see how we can set up a cluster on two servers with Proxmox.

Process of Installation

It only takes a few minutes to install Proxmox on each server. Latter, very few parameters need to be completed such as the IP address, the server name, the language, and the administrator password – root for Linux.

Proxmox is responsible to install the required packages with dependencies. That is to say, the packets corresponding to virtualization with KVM and elements necessary for configuring a web server in order to access the virtual machine management interface.

Unfortunately, Proxmox does not leave us the choice to manage partition sizes. It creates the following partitions:

  • The first partition contains the system
  • The second partition contains the storage of virtual machines

Once the installation is done, we can access the interface via the IP address of the physical server. Just after the authentication, we come to the view that displays the main information of our infrastructure, both physical and virtual servers, storage spaces, backups, and restores.

It also includes parts such as server configuration, authentication, permissions, etc… The bottom frame displays actions, and the results of operations performed on the servers.

Cluster Setup

We will create the cluster on the primary server:

pvecm create your-cluster-name

On the secondary server:

pvecm add cluster-IP-address

This will simplify the management of both servers, as it appears as a single interface.

Storage Space Provision
Here, we are using a Debian server with RAID and LVM to store virtual machines: The tree structure is as follows to store virtual machines backups and ISO images:

mkdir –p /home/partageNFS/VM
mkdir /home/partageNFS/backupVM
mkdir /home/partageNFS/ISO 

There are several solutions to add storage space under Proxmox. Here, we will install the NFS (Network File System).

ptitude install nfs-server

The configuration for this part used:

vi /etc/exports
/home/partageNFS/VM             *(rw,sync,no_subtree_check)
/home/partageNFS/backupVM       *(rw,sync,no_subtree_check)
/home/partageNFS/ISO            *(rw,sync,no_subtree_check)

Note: A service restart is necessary for the changes to be taken into account.

/etc/init.d/nfs-kernel-server restart

Adding on the cluster storage spaces:
This step we are doing for VM directory backup and ISO, specifying the content that goes well.

Backup and Restore Proxmox offers several types of backup options, either by stopping the VM or hot backup without service interruption. What is interesting here is the continuity of service so we can develop the hot Snapshot without disturbing the services. Proxmox uses vzdump tool, which not only allows us to save but also restore the virtual machines. Vzdump is a PERL script based on the following commands:

* TAR, GZIP: for backup compression,
* RSYNC: for the copy of the virtual machine
* LVM: LVM partition is mounted to store entries that occur during backup.

While creating logical volumes, think it will leave some free space in the volume group to create a temporary logical volume for Snapshot. Here is the command for execution by the system during a backup Snapshot Mode:

vzdump VM Name --mode SNAPSHOT --storage DESTINATION --node server name

Other arguments are also possible such as compression, -compress COMPRESSION TYPE.

You can also schedule an automatic backup of one or more VMs from Monday to Sunday:

A restore wizard available in the Proxmox is a very handy, simple, and effective solution, that offers the destination path of the virtual machine that you want to restore and name. The machine will be recreated on the server where you will restore the image.

In the versions that proceeded to 2.3, the restore utility was the TAR. Since then, the 2.3 “VMA” replaces the old backup format. So this tool will allow us to restore the backup of a virtual machine using the following command:

vma extract -v -r / name of the machine restored

Hot Failover
Through this cluster and storage server, you can migrate a virtual machine from one server to another Proxmox.

Network Configuration
With regard to the network part, it is possible to configure the interfaces. Several modes are available including 2 keys:

* load balancing between 2 network cards
* When a network adapter card fails the second takes over