Proxmox has pretty flexible backup mechanisms for virtual machines, however, in order to run snapshot backups, i.e. live backups without bringing the virtual machine down, ensuring no downtime, NFS storage should be used. This document will describe the process of setting up NFS [1] storage and connecting it to Proxmox VE [2]. Preliminary considerations It is best to use a separate physical server to serve as a file server or a backup server solely. One can always trick Proxmox by setting up a virtual machine to provide the NFS share, however such approach is not strongly recommended. If you are short on physical servers you can create a virtual machine and point it to use a separate physical hard drive; to do that specify the hard drive to be used in the qemu-server configuration file used by the virtual machine. For instance:
# nano /etc/pve/nodes/yournode/qemu-server/100.conf
# with the virtual drive the configuration will look like:
ide0: local:111/vm-111-disk-1.raw,size=5G
# to use the physical drive, change it to something like:
ide0: /dev/sdb
Make sure to use the correct disk. This setup was tested in the lab and proved suitable. It may be possible to use the virtual disk as well, but such a setup wasn’t tested.
NFS setup #
CareNet infrastructure is running Ubuntu Server 12.04 x64 for the servers, thus, the following instructions apply to this operating system, but should work for other Linux distributions as well, but the installation process may be different.
To install NFS server:
# apt-get update
# apt-get install nfs-kernel-server nfs-common portmap
To add an NFS share or export:
# nano /etc/exports
/backup/vm 10.10.10.10(rw,async,no_root_squash)
For simplicity and to ensure security, it is recommended to use NFS only with trusted clients in trusted networks. We use a separate private network to connect to the NFS share from Proxmox. To further enhance security configure a firewall on the system running NFS to allow connections only from trusted clients.
The no_root_squash option in the above exports configuration is used to enable root user access to the share, so that Proxmox can write to it. Note: This setup is used solely for live backups with Proxmox. If you need more specific or extended setup go through the official how-to [1] and pay close attention to security implications of using NFS.
Connecting NFS export to Proxmox #
CareNet server is running Proxmox VE 2.2, which provides a quick and simple way to add NFS storage to the system. To connect an NFS share open the web interface and go to Datacenter -> Storage -> Add. Fill in the required info. For the example provided above the setup will look like the following:
ID: nfs (this is just a name for the share, use something descriptive here)
Server 10.10.10.11 (considering you run your NFS server at 10.10.10.11)
Export: /backup/vm
Content: Backups, Images, ISO (make sure to include Backups)
Enabled: yes
Max Backups: 2 (this option is used to set the backup depth: 2 means only two backup copies will be stored, the new backups will overwrite the older backups)