Sometimes an lxc container can be a better alternative than an entire KVM virtual machine. It has a smaller overhead, easier and more efficient resource management and lower impact on the physical machine.
- Proxmox Ve Docker Container
- Proxmox Ve Lxc Docker
- Proxmox Install Docker Container
- Proxmox Ve Docker Software
You get (potentially) less isolation from the physical machine and you are forced to use the host kernel. Moreover, you cannot run different a different OS.
Proxmox has a great support of lxc containers and they're a often a good choice. I've recently converted some VMs to lxc containers and they're faster, lighter and the Ram occupation is quite lower.
There are two major drawbacks: you cannot migrate a running lxc container (it will be shut down, moved and restarted - if using a shared storage, it is often a matter of seconds) and backups to Proxmox Backup Server are slower than a VM's backup.
This is because a VM can monitor, thanks to KVM dirty bitmaps, its disk operations to know in advance which blocks should be checked and copied. When dealing with lxc containers it can't be done, so every backup will need to check every single file - this proved to be efficient in terms of space and deduplication, but quite slow in terms of time. One of my VMs (750 GB stored but with rare disk access) required just some minutes to be backed up with dirty bitmaps, but more or less 2 hours to backup since it's been transformed to a lxc container.
Proxmox Ve Docker Container
borg backup proved to be quite efficient, so I tried to find a way to backup those containers performing a snapshot, backing up the snapshot and, then, releasing it.
We cannot use dattobd on the container, so we must snapshot and backup from the host. This has one big advantage: we don't need the container to even know its backup location as every operation will be done by the Proxmox host.
Docker Machine Driver for Proxmox VE. This driver can be used to kickstart a VM in Proxmox VE to be used with Docker/Docker Machine. Download and copy it into your PATH (don't forget to chmod +x) or build your own driver. Check if it works: $ docker-machine create -driver proxmoxve -help grep -c proxmox 35. Proxmox VE (Virtual Environment) is a Debian-based open-source server that allows system administrators to deploy and manage VMs (virtual machines) and containers. In this article, we will cover connecting a Proxmox VM to the Internet.
My containers generally are stored in Ceph rbd volumes or LVM thin pools.
Proxmox Ve Lxc Docker
I've created a script to deal with both those situations - and it doesn't depend on Proxmox, so it also works if you don't use it.
First of all, you should create a user and a borg repository on a remote machine and allow the Proxmox host to login via ssh using a key. Then, create a directory (/tobackup in the following scripts, on the host) where the snapshots will be mounted.
In the following example/scripts, no encryption will be used for the backup storage. If you want to encrypt your backup, you will have to perform small modifications.
Here's my rbd_borg_bck.sh :
For example, to backup a disk stored in pool 'vmrbdpool' named vm-101-disk-0 via ssh to server backupserver.mydomain.org, username on the server (and repository name, inside that user's home directory, called server01), you can launch the script this way:
This can also be scheduled and launched by cron (on the Proxmox host) or any other way.
For the LVM thin pools, the script is a bit different. Here's my lvm_thin_borg_bck.sh
In this example, we want to backup a disk '/dev/prox1/vm-120-disk-0', username on the server is server01 (same repository name), server is backupserver.mydomain.org and, as last argument, 'prox1' which is the lvm pool.
Proxmox Install Docker Container
Borg is efficient and fast and, thanks to this kind of setup, I can create a backup of the 750 GB container in 2 minutes.
Proxmox Ve Docker Software
Thanks to this kind of setup, backups can be done in a consistent and efficient way.