[CentOS-virt] lvm and kvm

Mon Aug 15 20:52:40 UTC 2011
Ed Heron <Ed at Heron-ent.com>

On Mon, 2011-08-15 at 15:54 -0400, James B. Byrne wrote:
> I am performing some configuration testing on a kvm host.  When
> installing a guest operating system is it advisable to place each
> instance in a separate lv or better to accept the default and store
> them on the root file system?

  I think you are asking LV based or file based guest storage.  I vote
for LV on the host.

> Respecting lvm, does one configure lvs in a virtual server to take
> space from the main vg or does one allocate lv space from inside
> that allocated to the virtual instance?  Is it even considered
> advisable to use lvs with virtual guests?
> ...

  It seems that you are asking whether to use (1) multiple host LV's to
keep different partitions on different virtual disks, (2) a single host
LV with nested LVM or (3) a single host LV with traditional
partitioning...

  I use Xen, but if we treat this as a philosophical discussion, that
probably doesn't matter.

  I like option 1 (multiple host LVs) for the flexibility it gives, but
I don't like the large number of LVs on the host.

  I don't like option 2 (nested LVM) due to the difficulties of resizing
guest PV.

  Option 3 (single host LV, raw guest partitions) keeps the number of
host LVs lower, but only the last guest partition is easily resized. 

  If you can accept the number of LVs or you need to resize your
partitions frequently, I'd recommend option 1.

  I have gravitated to option 3 because I find I don't need to resize my
guest virtual disks very often.  MS Windows uses a single partition, so
those VMs are simple.  On my Linux VMs, I normally only need to resize
either the var partition or the home partition depending on the
machine's function, but not both, so I put that partition last.

  I recommend against using LVM within a VM.