(7.1) LVM & SSD Cache

kromberg

Member
Nov 24, 2021
87
5
13
52
I am trying to add an SSD to a LVM VG. Here are the steps I did for it:
  • created an new Linux LVM partition on the ssd: fdisk /dev/sdd
  • created the physical volume on the ssd: pvcreate /dev/sdd1
  • extended the VG in question: vgextend vm2-lvm /dev/sdd1
  • created the cache lv: lvcreate -n DataLVcache -L58G vm2-lvm /dev/sdd1
  • created the meta lv: lvcreate -n DataLVcacheMeta -L58M vm2-lvm /dev/sdd1
  • activated the cache: lvconvert --type cache-pool --cachemode writeback --poolmetadata vm2-lvm/DataLVcacheMeta vm2-lvm/DataLVcache
  • attached the cache to an existing vm's lv: lvconvert --type cache --cachepool DataLVcache vm2-lvm/vm-104-disk-0

Running boniie++ on the vm I am not seeing any difference in the performance with the cache enabled. Have I done all the needed steps? Also looks like if new lv are added by creating and new vm disk or moving a disk, the cache pool needs to be attached manually. And if a disk/lv is moved off the vg, the cache needs to be detached before it is moved.
 
Why do you want to extend an existing VG with another disk?
Based on our experience this almost always leads to issues sooner or later.
 
How is the VM configured? Please provide the output of qm config <VMID>.

Does your SSD have power loss protection?

What SSD are you using, which disk (model) are you using for the VM disks?
Is everything attached directly via the mainboard, or an HBA or a RAID Controller?
 
root@thor:/etc/pve/qemu-server# qm config 104 agent: 1,fstrim_cloned_disks=1 boot: order=ide2;scsi0 cores: 8 ide2: none,media=cdrom machine: q35 memory: 16384 name: scatha net0: virtio=3A:AF:D5:FD:1E:2B,bridge=vmbr1,firewall=1 ostype: l26 scsi0: ssd-lvm:vm-104-disk-0,size=32G scsi1: vm2-lvm:vm-104-disk-0,size=1000G scsihw: virtio-scsi-pci smbios1: uuid=ae45b7a0-e348-4c02-8212-7ccaf0de7235 vmgenid: 9b4f2609-2802-4e4e-bad7-8e92ffd75dcc

vm2-lvm is a single single disk that is from a adaptec raid controller using 4 SATA drives in RAID5. Adaptec controller has a BBU. scsi1 is just a slice of the whole drive.
The SSD in question is an Intel DC S3700 connected to a MB SATA3 port.
The server is connected to a UPS.

I am wanting to add the SSD to the VG of the LVM because it can handle more IOPS than the adaptec controller can do.
 
I ran such a setup many years ago. I recommend just running it in write-through mode due to the single point of failure (one SSD). Therefore you will not get any write IOPS enhancement, just reading.
 

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!