LXC Snapshot no available yet ? Will it work on LVM ?

Moreover, splitting my disk space between lxc (now allocated in thin pool space) and kvm is also a big regression.
I need to make larger and more complex capacity management to use it.

You can use the same storage backend for both systems (KVM and LXC). So LVM will get simply replaced by
thin-LVM. You will then have more functionality and better performance. It is currently technology preview, but
we work hard to get that stable soon.
 
I tried that but this is not working :/

I really don't understand why you don't keep BOTH !

lvm thin for who want VM snapshot

And classic lvm for who want the snapshot backup mode ...




As i understand, with lvm thin pool you create a LV ( thin type ) then you store several CT on the same LV ? That is right ?
 
I really don't understand why you don't keep BOTH !

I not a matter of 'keeping' something. LXC storage is completely different than what we had previously with OpenVZ,
so one need to implement that completely new. Not sure how much work that is ...

As i understand, with lvm thin pool you create a LV ( thin type ) then you store several CT on the same LV ?

Yes.
 
It is not possible to store a lxc on a lvm2
Then snap the lvm
Do the backup with the snap
And delete the snap when backup complete

?


Lxc is just a bunch of file dropped on a ext4 filesystem or there is a specific lxc filesystem ?
 
How can I convert all my LVM storage to thinpool ?
Same question here. Running lvconvert seems to destroy the content on the existing volume?

Bear in mind that most preinstalled Proxmox VE images are using LVM storage as default.
 
Hi

I try to follow theses steps but it fails :

root@pve:~# lvcreate -n pvepool -L 340g pve
Logical volume "pvepool" created.
root@pve:~# lvconvert --type thin-pool pve/pvepool
WARNING: Converting logical volume pve/pvepool to pool's data volume.
THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
Do you really want to convert pve/pvepool? [y/n]: y
Converted pve/pvepool to thin pool.
root@pve:~# mkfs.ext4 /dev/pve/pvepool
mke2fs 1.42.12 (29-Aug-2014)
Creating filesystem with 89128960 4k blocks and 22282240 inodes
Filesystem UUID: fae430d4-3fd2-4a7f-9de2-7a79ba07f91d
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
root@pve:~# lvdisplay pve/pvepool
--- Logical volume ---
LV Name pvepool
VG Name pve
LV UUID 1mMJyl-B7Lt-2TXg-kviK-kc4J-Sd6x-Hm8o1e
LV Write Access read/write
LV Creation host, time pve, 2015-12-16 10:32:04 +0100
LV Pool metadata pvepool_tmeta
LV Pool data pvepool_tdata
LV Status available
# open 0
LV Size 340.00 GiB
Allocated pool data 0.00%
Allocated metadata 0.42%
Current LE 87040
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:5​

Then add a storage.cfg's entry for thin pool (in /etc/pve/storage.cfg) :
Code:
dir: local
        path /var/lib/vz
        content rootdir,images,vztmpl,iso
        maxfiles 0

lvmthin: thin1
        vgname pve
        thinpool pvepool

Reboot ... and then :

root@pve:~# lvdisplay pve/pvepool
--- Logical volume ---
LV Name pvepool
VG Name pve
LV UUID 1mMJyl-B7Lt-2TXg-kviK-kc4J-Sd6x-Hm8o1e
LV Write Access read/write
LV Creation host, time pve, 2015-12-16 10:32:04 +0100
LV Pool metadata pvepool_tmeta
LV Pool data pvepool_tdata
LV Status NOT available
LV Size 340.00 GiB
Current LE 87040
Segments 1
Allocation inherit
Read ahead sectors auto

root@pve:~# lvscan
ACTIVE '/dev/pve/swap' [8.00 GiB] inherit
ACTIVE '/dev/pve/root' [50.00 GiB] inherit
ACTIVE '/dev/pve/data' [11.03 GiB] inherit
inactive '/dev/pve/pvepool' [340.00 GiB] inherit​


  1. Should I manually add a /etc/fstab entry ?
  2. Is my storage.cfg entry incorrect ?
 
Last edited:
Hi

I try to follow theses steps but it fails :

root@pve:~# lvcreate -n pvepool -L 340g pve
Logical volume "pvepool" created.
root@pve:~# lvconvert --type thin-pool pve/pvepool
WARNING: Converting logical volume pve/pvepool to pool's data volume.
THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
Do you really want to convert pve/pvepool? [y/n]: y
Converted pve/pvepool to thin pool.
root@pve:~# mkfs.ext4 /dev/pve/pvepool

I haven't tried it yet, but I don't think you should format your thin-pool to ext4, you only need to give the thin pool to Proxmox via storage.cfg, and then it will store the raw images on it. (Just like with regular lvm storage: you only gave a vg to Proxmox, not an lv or a filesystem.)
 
I run the same steps without the mkfs.ext4 command ... same result :

When i'm trying to create a container :
"TASK ERROR: unable to create containers on storage type 'lvmthin'"

After a reboot :
root@pve:~# lvdisplay pve/pvepool
--- Logical volume ---
LV Name pvepool
VG Name pve
LV UUID bd3bM6-0ejX-367r-nKOb-usY6-iv7w-gzYIAH
LV Write Access read/write
LV Creation host, time pve, 2015-12-16 16:49:30 +0100
LV Pool metadata pvepool_tmeta
LV Pool data pvepool_tdata
LV Status NOT available
LV Size 340.00 GiB
Current LE 87040
Segments 1
Allocation inherit
Read ahead sectors auto​
 
You need to create a LVM thin pool, for example:
Code:
# see: man lvmthin
# lvcreate -n pvepool -L 20G pve
# lvconvert --type thin-pool pve/pvepool

The corresponding storage.cgf looks like this
Code:
lvmthin: thin1
     vgname pve
     thinpool pvepool

Yeah it doesn't work. I have repeated your steps exactly, the storage shows up in the list (type: Unknown, content: Disk Image, Container), yet when I try to restore a container to it, it says:

TASK ERROR: unable to create containers on storage type 'lvmthin'

It looks like I can restore KVM guests to it, but the problem is I need snapshot backup for LXC containers...
 
Last edited:
The thread topic is about LVM snapshot backup for containers. And yes, this is now available as technology preview.

Is it really available? Have you guys tested this? Is this only available in pvetest?
I have followed Dietmar's steps to create a thin lvm, and I can't restore containers to it. It is also fully unsupported by the webinterface.
 
Seems I missed something here, LVM snapshots for containers are back now, so what is the problem?

You can use the same storage backend for both systems (KVM and LXC). So LVM will get simply replaced by thin-LVM. You will then have more functionality and better performance. It is currently technology preview, but we work hard to get that stable soon.

Tom, Dietmar! At least two of us have tested thin-lvm, we can confirm it does not work for LXC at all.

Any idea when can we expect a fix to test?
 
Since we reported that this technology preview does not work for LXC containers at all, the Proxmox dev team ceased all communications regarding this issue. We have no answer here, nor any reaction to my bugreport, total radio silence. Which is a shame, since snapshot backups were such an integral (and dependable) part of Proxmox before, it would really be nice to have at least a timeframe.

This is one of the reasons we have decided to postpone our cluster upgrade to 4.1, we will be using 3.4 for the foreseeable future. I will gather and post all our reasons behind this decision soon.
 
I workaround this issue now with my own backup script:
Code:
#!/bin/bash

NOW=$(date +"%m%d%Y")

cp /etc/pve/lxc/100.conf /backup/temp/etc/pve/lxc/
cp /var/lib/lxc/100/config /backup/temp/var/lib/lxc/100/
cp /var/lib/vz/images/100/vm-100-disk-1.raw /backup/temp/var/lib/vz/images/100/

cp /etc/pve/lxc/101.conf /backup/temp/etc/pve/lxc/
cp /var/lib/lxc/101/config /backup/temp/var/lib/lxc/101/
cp /var/lib/vz/images/101/vm-101-disk-1.raw /backup/temp/var/lib/vz/images/101/

tar czvf /backup/backups/server-backup-$NOW.tar.gz /backup/temp/*

OLD=$(date +"%m%d%Y" --date="7 days ago")
rm /backup/backups/server-backup-$OLD.tar.gz
This will copy the disk images of 100 and 101 to a backup drive and then compress it. Not sure if this is the best idea but it works.

You also need to create a few directories for the script: /backup/temp, /backup/temp/etc/pve/lxc/, /backup/temp/var/lib/vz/images/ and in my case /backup/temp/var/lib/lxc/100/, /backup/temp/var/lib/lxc/101/, /backup/temp/var/lib/vz/images/100/, and /backup/temp/var/lib/vz/images/101

To be honest, I am overall very unhappy with LXC. This is just highly experimental and no where near a replacement for OpenVZ. I guess I have to move everything to KVM
 
Any news on the matter ?
I was hoping to switch from KVM to LXC to optimise my server's resources, but without snapshots it's not an option...
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!