What is the best storage configuration for libvirt and KVM?

8,467

Solution 1

A blog article at http://hyperthese.net/post/kvmized-debian-on-lvm/ suggests that you create LVM logical volumes on the host (physical machine) and create filesystems directly on them, without creating partitions, and before creating the virtual machines.

I tried it out, and long story short: seemed to work, and I was able to grow a LV and the filesystem on it. The long story can be found in my answer at https://serverfault.com/questions/100892/kvm-lvm-where-to-put-lvm/348408#348408 .

Solution 2

Hmm, good feature :). I haven't come across this need myself yet. I believe the functionality you're looking for lives in libguestfs: http://libguestfs.org/ .

See virt-resize and virt-filesystems

This article shows how to make use of these tools for the purposes you've outlined.

http://askaralikhan.blogspot.com/2011/07/expanding-kvm-guest-disk-image-using.html

Let us know how it works out.

Share:
8,467
Anders Wallenquist
Author by

Anders Wallenquist

Updated on September 18, 2022

Comments

  • Anders Wallenquist
    Anders Wallenquist over 1 year

    I have a KVM-host with a lot of local disk for virtual machines that I administer using virtmanager. I want an easy solution for addressing disk for my virtual hosts. I also want to be able to add storage to the virtualmachines from time to time.

    LVM are nice and have a lot of features for increasing partition size and for snapshots. But since KVM makes its own partition table on LVM-partitions its not so easy to change size for both the partition and the underlying filesystem. Virtmanager are not able to use all LVM-features so if I should continue with LVM I have to use other administrations tools to.

    Any thoughts?