[libvirt-users] libvirt, lvm thin provisioning

I know that lvm supports thin provisioning, and I think I have a pretty good grasp on how that works. Does libvirt support lvm thin provisioning and thin snapshots? I know that in order to set up lvm thin provisioning by hand, I have to create a thin-provisioning pool within the volume group, and then thin-provisioned logical volumes and thin-provisioned snapshots can be created within that thin-provision pool. I also know that it's possible to have more than one thin-provisioning pool within the same volume group, which tells me that in order to properly set up any lvm-aware application to use thin-provisioning, I may need to inform it which thin-provisioning pool it should base LVs and snapshots from. When I look at the example here: http://libvirt.org/storage.html#StorageBackendLogical I don't see anything particular which tells me it supports building off a thin-provisioning pool if I specify such by name. Checking here: http://libvirt.org/formatstorage.html#StoragePool I again don't see anything specific about logical thick vs thin provisioning. I would expect to see *something*, as there are performance consequences when making such choices, so I'm again not sure libvirt recognizes a difference. So is this something that libvirt can do? And is there good documentation somewhere on the subject?

Hello, On 2013-11-22 21:46, Michael Mol wrote:
I know that lvm supports thin provisioning, and I think I have a pretty good grasp on how that works. Does libvirt support lvm thin provisioning and thin snapshots?
libvirt does not support storage pools containing thin pools. Since commit 4132dede0652b7f0cc83868fd454423310bc1a9c (http://libvirt.org/git/?p=libvirt.git;a=commit;h=4132dede0652b7f0cc83868fd45...) at least the thick provisioned volumes in such a pool can still be used. Previously, libvirt would just refuse to start the pool. However, you can assign any thin provisioned volume to a VM manually and it will work. On the hardware/software combination that I tried it on (desktop SATA drives in RAID1 on Ubuntu 13.10) it was abysmally slow though. Proper support for LVM thin provisioning would probably need a new storage pool type, and I haven't found any hints that anybody was working on that. Greetings Oliver

On Tue, 03 Dec 2013 18:13:08 +0100 Oliver Brakmann <oliver.brakmann@posteo.de> wrote:
Hello,
On 2013-11-22 21:46, Michael Mol wrote:
I know that lvm supports thin provisioning, and I think I have a pretty good grasp on how that works. Does libvirt support lvm thin provisioning and thin snapshots?
libvirt does not support storage pools containing thin pools. Since commit 4132dede0652b7f0cc83868fd454423310bc1a9c (http://libvirt.org/git/?p=libvirt.git;a=commit;h=4132dede0652b7f0cc83868fd45...) at least the thick provisioned volumes in such a pool can still be used. Previously, libvirt would just refuse to start the pool.
However, you can assign any thin provisioned volume to a VM manually and it will work. On the hardware/software combination that I tried it on (desktop SATA drives in RAID1 on Ubuntu 13.10) it was abysmally slow though.
I would expect that. My setup would be: RAID6 | PV | VG | thin pool Where the RAID6 is provided by a hardware RAID controller with a battery-backed write cache.
Proper support for LVM thin provisioning would probably need a new storage pool type, and I haven't found any hints that anybody was working on that.
A pity. Thin provisioning would be (as I see it) the first step to whole-VM snapshots as found in systems like VMWare ESX. I'd love to be able to pull that off using Linux/QEMU/KVM. Or at least be able to snapshot a running VM's disk to be able to pull backups off the snapshot without interrupting service in the VM guests.

On 12/03/2013 12:37 PM, Michael Mol wrote:
A pity. Thin provisioning would be (as I see it) the first step to whole-VM snapshots as found in systems like VMWare ESX. I'd love to be able to pull that off using Linux/QEMU/KVM. Or at least be able to snapshot a running VM's disk to be able to pull backups off the snapshot without interrupting service in the VM guests.
Ah, but you already CAN do that. Libvirt external snapshots (since libvirt 1.0.5, or even earlier if you don't care about machine state but just disk state) coupled with qemu 1.3 or newer is perfectly able to create qcow2 chains such that you can do a backup of the snapshot without any downtime to the guest. Admittedly, keeping things optimal so that the qcow2 chain doesn't grow without bounds is a bit harder problem, and qemu 1.7 has added some new functionality not yet integrated into libvirt to make life easier for taking snapshots without having to track the cleanup efforts. But your claim that libvirt can't do online backups the way ESX can aren't quite true :) -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Tue, 03 Dec 2013 13:23:37 -0700 Eric Blake <eblake@redhat.com> wrote:
On 12/03/2013 12:37 PM, Michael Mol wrote:
A pity. Thin provisioning would be (as I see it) the first step to whole-VM snapshots as found in systems like VMWare ESX. I'd love to be able to pull that off using Linux/QEMU/KVM. Or at least be able to snapshot a running VM's disk to be able to pull backups off the snapshot without interrupting service in the VM guests.
Ah, but you already CAN do that. Libvirt external snapshots (since libvirt 1.0.5, or even earlier if you don't care about machine state but just disk state) coupled with qemu 1.3 or newer is perfectly able to create qcow2 chains such that you can do a backup of the snapshot without any downtime to the guest. Admittedly, keeping things optimal so that the qcow2 chain doesn't grow without bounds is a bit harder problem, and qemu 1.7 has added some new functionality not yet integrated into libvirt to make life easier for taking snapshots without having to track the cleanup efforts. But your claim that libvirt can't do online backups the way ESX can aren't quite true :)
Excellent to hear! Where can I find out more about how to handle cleanup? I don't need an automatic backup process requiring manual cleanup.

On 12/03/2013 02:41 PM, Michael Mol wrote:
Ah, but you already CAN do that. Libvirt external snapshots (since libvirt 1.0.5, or even earlier if you don't care about machine state but just disk state) coupled with qemu 1.3 or newer is perfectly able to create qcow2 chains such that you can do a backup of the snapshot without any downtime to the guest. Admittedly, keeping things optimal so that the qcow2 chain doesn't grow without bounds is a bit harder problem, and qemu 1.7 has added some new functionality not yet integrated into libvirt to make life easier for taking snapshots without having to track the cleanup efforts.
Excellent to hear!
Where can I find out more about how to handle cleanup? I don't need an automatic backup process requiring manual cleanup.
This wiki page has captured some discussions from this list regarding the matter (unfortunately not organized the best at the moment, but may have what you need...) http://wiki.libvirt.org/page/I_created_an_external_snapshot%2C_but_libvirt_w... Or if you get stuck, and can't find an answer from searching the list archives, feel free to describe your specific scenario and I'm glad to help brainstorm what to try next. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (3)
-
Eric Blake
-
Michael Mol
-
Oliver Brakmann