Converting LVM to LVM Thin

NickH

Member
Aug 13, 2020
31
1
13
64
A while ago I added an NVME disk to my server, but it seems I created it as a normal LVM and not LVM Thin so I am unable to take snapshots or convert to qcow2. From reading the forums I had:
Code:
root@pve:~# lvs -o name,segtype nvme_2g_1
  LV            Type
  vm-108-disk-0 linear
  vm-111-disk-0 linear
  vm-112-disk-0 linear
I have done:
Code:
root@pve:~# lvconvert --type thin-pool  nvme_2g_1/vm-112-disk-0
  Thin pool volume with chunk size 64.00 KiB can address at most 15.81 TiB of data.
  WARNING: Converting nvme_2g_1/vm-112-disk-0 to thin pool's data volume with metadata wiping.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
Do you really want to convert nvme_2g_1/vm-112-disk-0? [y/n]: y
  Converted nvme_2g_1/vm-112-disk-0 to thin pool.
root@pve:~# lvconvert --type thin-pool  nvme_2g_1/vm-108-disk-0
  Thin pool volume with chunk size 64.00 KiB can address at most 15.81 TiB of data.
  WARNING: Converting nvme_2g_1/vm-108-disk-0 to thin pool's data volume with metadata wiping.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
Do you really want to convert nvme_2g_1/vm-108-disk-0? [y/n]: y
  Converted nvme_2g_1/vm-108-disk-0 to thin pool.
And now I have:
Code:
root@pve:~# lvs -o name,segtype nvme_2g_1
  LV            Type
  vm-108-disk-0 thin-pool
  vm-111-disk-0 linear
  vm-112-disk-0 thin-pool
However I am still unable to convert the disks to qcow2 or take snapshots. The VM's themselves still work (despite the dire warnings during the conversion).

At the same time, in the Webconfig, under Datacenter > pve, on the left where there are the disk icons I see 'local (pve)', 'local-lvm (pve)' and 'nvme_2g_1 (pve)'. However none of these contain my volumes that I have converted. On the right under Datacenter > pve > Disks > LVM-Thin I do see them.

How do I now get the VM's to be able to take snapshots? And how do I get them to show up again in Datacenter > pve, on the left in the nvme_2g_1 disk?
 
Last edited:
what you did was probably not what you wanted. for lvmthin, there needs to be a 'thin pool' (consist of a 'data' and 'metadata' lv)
you converted your lvs of your vm to such a 'thin pool' (i'd take the warning seriosly though)

i think what you actually wanted is to create a new lv, convert that to a thinpool and move the disks over

in you situation, i'd take a backup of the existing vm disks elsewhere and start over with the pool (i.e. delete all relevant lvs from that lvm vg, and create a new thin pool)
for more information see: https://pve.proxmox.com/wiki/Logical_Volume_Manager_(LVM)
and the lvm manpage: 'man lvm'
 
Oh bother! I have 2 small VM's and one large one on this disk. The small ones can be moved to the other disk, but the big one is too big to move and there is an xfs partition in the VM so it cannot be shrunk.

Does it make sense to move the small VM's to my other disk (where one of them originally came from) and backup and nuke the big one (there is not much critical there). At that point the NVME becomes free.

Can I, from the dashboard, then do all the necessary manipulations or do I have to drop to the command line? From your reference, I already have a /var/lib/vz/ which is on the original system disk, so I assume I don't have to go through that step and mount it anywhere? Or would it make sense to add the NVME disk to the "pve" VG, which is already thinly provisioned?
root@pve:~# lvs -o name,segtype nvme_2g_1 LV Type vm-108-disk-0 thin-pool vm-111-disk-0 linear vm-112-disk-0 thin-pool root@pve:~# lvs -o name,segtype pve LV Type data thin-pool root linear snap_vm-100-disk-0_Post_Install thin snap_vm-100-disk-0_Updated_to_7_8 thin snap_vm-100-disk-0_Upgrade_to_1_5_3 thin snap_vm-100-disk-0_With_docker_and_app_sia thin snap_vm-101-disk-0_Updated_to_7_8 thin snap_vm-101-disk-0_sia_rpm_installed thin snap_vm-103-disk-0_Gateway_7_8 thin snap_vm-103-disk-0_Initial thin snap_vm-103-disk-0_With_users thin snap_vm-106-disk-0_Base thin snap_vm-106-disk-0_Joined1 thin snap_vm-107-disk-0_devel_setup thin swap linear vm-100-disk-0 thin vm-101-disk-0 thin vm-102-disk-0 thin vm-103-disk-0 thin vm-104-disk-0 thin vm-105-disk-0 thin vm-106-disk-0 thin vm-107-disk-0 thin vm-108-disk-0 thin vm-109-disk-0 thin vm-110-disk-0 thin vm-113-disk-0 thin vm-114-disk-0 thin This confuses me a bit as vm-108-disk-0 appears on both disks. I moved it from pve to nvme_2g_1. Do I need to delete the lv from pvs?
 

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!